/* Poetry Line: a West Berlin phone box, a typed sheet, a telephone directory. */

@font-face { font-family: "Barlow Condensed"; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 400; font-display: swap;
  src: url("fonts/courier-prime-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 700; font-display: swap;
  src: url("fonts/courier-prime-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/courier-prime-latin-400-italic.woff2") format("woff2"); }

:root {
  --booth: #F5B800;        /* phone-box yellow */
  --booth-deep: #E0A600;
  --black: #000;
  --sheet: #FFFFFF;
  --carbon: #26338A;       /* carbon-copy blue for the typed poem */
  --lamp: #D5281B;
  --olive: #4A3D00;        /* secondary text on yellow */
  --rule: #000;
  --sign: "Barlow Condensed", "Arial Narrow", sans-serif;
  --type: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--booth); color: var(--black);
  font-family: var(--sign); font-size: 19px; line-height: 1.35;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--black); outline-offset: 2px;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* -- the sign on top of the box ----------------------------------- */
.sign {
  background: var(--black); color: var(--booth);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; position: sticky; top: 0; z-index: 2;
}
.sign-inner { max-width: 640px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.sign svg { width: 30px; height: 30px; flex: none; }
.sign-word { font-weight: 700; font-size: 30px; letter-spacing: .02em; line-height: 1; text-decoration: none; }
.lamp { margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 18px; color: #fff; }
.lamp i { width: 14px; height: 14px; border-radius: 50%; background: #3D9A3D;
  box-shadow: 0 0 0 2px #222 inset; }
.lamp.busy i { background: var(--lamp); box-shadow: 0 0 8px var(--lamp); animation: blink 1.2s steps(2) infinite; }

.whose { font-family: var(--type); font-size: 16px; margin: 18px 0 12px; color: var(--olive); }

/* -- message waiting ----------------------------------------------- */
.waiting {
  display: flex; align-items: center; gap: 12px; background: var(--black); color: #fff;
  padding: 12px 14px; margin: 0 0 16px; font-size: 20px; font-weight: 600;
}
.waiting i { width: 16px; height: 16px; border-radius: 50%; background: var(--lamp); flex: none;
  box-shadow: 0 0 10px var(--lamp); animation: blink 1s steps(2) infinite; }
.waiting small { display: block; font-family: var(--type); font-weight: 400; font-size: 15px; color: #ddd; }

/* -- the typed sheet ----------------------------------------------- */
.sheet {
  background: var(--sheet); padding: 22px 22px 30px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, .22);
}
.sheet + .sheet { margin-top: 18px; }
.when { font-family: var(--type); font-size: 15px; margin: 0 0 6px; color: #555; }
.when b { color: var(--black); }
.title {
  font-weight: 700; font-size: clamp(38px, 10vw, 58px); line-height: .95;
  margin: 0 0 8px; letter-spacing: -.005em; text-wrap: balance;
}
.author { font-weight: 500; font-size: 24px; margin: 0; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin: 16px 0 0; padding: 12px 0 0; border-top: 2px solid var(--black); font-size: 18px; }
.hole {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--black); font-weight: 700; font-size: 20px; margin-right: 6px;
}
.facts span { display: inline-flex; align-items: center; }
.facts em { font-family: var(--type); font-style: italic; font-size: 16px; }

.poem { font-family: var(--type); color: var(--carbon); font-size: 18px; line-height: 1.6;
  margin: 24px 0 0; }
.poem p { margin: 0 0 1.2em; }
.poem span { display: block; padding-left: 1.5em; text-indent: -1.5em; margin-bottom: .3em; line-height: 1.45; }   /* long lines wrap with a hanging indent */
.poem p:last-child { margin-bottom: 0; }
.poem .note { color: #666; font-style: italic; }

.empty .title { font-size: 40px; }
.empty p { font-family: var(--type); font-size: 17px; }

/* -- directory-style lists ----------------------------------------- */
h2 { font-weight: 700; font-size: 26px; margin: 34px 0 8px; }
.directory { list-style: none; margin: 0; padding: 0; }
.directory li { border-bottom: 1px solid rgba(0, 0, 0, .35); }
.directory a, .directory .row {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 0; text-decoration: none;
}
.directory a { flex-direction: column; align-items: stretch; gap: 0; }
.directory .line1 { display: flex; align-items: baseline; gap: 8px; }
.directory a .what { font-family: var(--type); font-size: 16px; }
.directory .who { font-weight: 700; white-space: nowrap; }
.directory .what { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.directory .lead { flex: 1; border-bottom: 2px dotted rgba(0, 0, 0, .55); transform: translateY(-4px); min-width: 16px; }
.directory .t { font-family: var(--type); font-size: 15px; white-space: nowrap; }

/* -- the dial card --------------------------------------------------- */
.dialcard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 6px; margin: 12px 0 0; }
.dialcard div { text-align: center; font-size: 16px; line-height: 1.1; }
.dialcard .hole { display: grid; width: 46px; height: 46px; font-size: 24px; margin: 0 auto 6px; background: var(--booth-deep); }
.footnote { font-family: var(--type); font-size: 15px; margin: 14px 0 0; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 40px 0 0; padding-top: 12px; border-top: 2px solid var(--black);
  font-family: var(--type); font-size: 15px; }
.foot a { font-weight: 700; }

/* -- forms (settings, leave a poem) ------------------------------------ */
.sheet h2 { margin-top: 0; }
label { display: block; font-weight: 600; font-size: 19px; margin: 18px 0 2px; }
label small { display: block; font-family: var(--type); font-weight: 400; font-size: 14px; color: #555; }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=time], select, textarea {
  width: 100%; font: 18px/1.4 var(--type); color: var(--carbon); background: transparent;
  border: 0; border-bottom: 2px dotted var(--black); padding: 6px 2px; border-radius: 0;
}
textarea { border: 2px dotted var(--black); min-height: 220px; padding: 10px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; }
input[type=range] { width: 100%; accent-color: var(--black); margin: 10px 0 0; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--black); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.btn {
  display: inline-block; font: 600 20px/1 var(--sign); background: var(--black); color: var(--booth);
  border: 0; padding: 12px 18px; cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn.light { background: transparent; color: var(--black); border: 2px solid var(--black); }
.btn.small { font-size: 17px; padding: 8px 12px; min-height: 36px; }
.btn:disabled { opacity: .4; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.notice { background: var(--black); color: var(--booth); padding: 10px 14px; margin: 0 0 16px; font-weight: 600; }
.error { color: var(--lamp); font-family: var(--type); font-weight: 700; min-height: 1.4em; }

.keypad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.keypad button { font: 700 22px var(--sign); height: 48px; border-radius: 50%; border: 2px solid var(--black);
  background: var(--booth); cursor: pointer; aspect-ratio: 1; width: 48px; justify-self: center; }
.readout { font-family: var(--type); font-size: 15px; background: #F2F2EE; padding: 10px; margin-top: 12px;
  white-space: pre-wrap; min-height: 5em; }
.meter { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 18px; margin-top: 8px; }
.meter dt { font-weight: 600; }
.meter dd { margin: 0; font-family: var(--type); }

.msglist { list-style: none; padding: 0; margin: 8px 0 0; }
.msglist li { padding: 12px 0; border-bottom: 1px solid rgba(0, 0, 0, .25); }
.msglist .btn { margin: 8px 8px 0 0; }
.tag { font-family: var(--type); font-size: 14px; padding: 1px 6px; border: 1px solid currentColor; margin-left: 6px; }
.tag.new { color: var(--lamp); }

/* -- answering machine (leave a poem) ---------------------------------- */
.tabs { display: flex; gap: 0; margin: 24px 0 0; border: 2px solid var(--black); }
.tabs button { flex: 1; font: 600 19px var(--sign); padding: 10px 6px; border: 0; background: transparent; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--black); color: var(--booth); }
.machine { background: #1C1C1C; color: #EEE; padding: 18px; margin-top: 16px; }
.machine-top { display: flex; align-items: center; gap: 18px; }
.rec { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #555; background: var(--lamp);
  cursor: pointer; flex: none; position: relative; }
.rec[aria-pressed=true] { background: #EEE; border-color: var(--lamp); }
.rec[aria-pressed=true]::after { content: ""; position: absolute; inset: 22px; background: var(--lamp); }
.counter { font: 700 34px var(--type); background: #000; color: #F5B800; padding: 2px 10px; letter-spacing: .12em;
  border: 2px solid #444; }
.machine p { font-family: var(--type); font-size: 15px; margin: 12px 0 0; color: #CCC; }
.machine audio { width: 100%; margin-top: 12px; }
.level { height: 6px; background: #333; margin-top: 12px; }
.level span { display: block; height: 100%; width: 0; background: #F5B800; transition: width .08s linear; }
.thanks { text-align: left; }
.thanks .title { font-size: 48px; }

/* -- invite card (printable) ------------------------------------------- */
.invite { background: var(--sheet); max-width: 420px; margin: 30px auto; padding: 26px; box-shadow: 3px 4px 0 rgba(0,0,0,.22); }
.invite svg { width: 100%; height: auto; display: block; margin: 16px 0; }
.invite .url { font-family: var(--type); font-size: 15px; word-break: break-all; }
@media print {
  body { background: #fff; }
  .sign, .noprint { display: none; }
  .invite { box-shadow: none; border: 2px solid #000; }
}

@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .lamp.busy i, .waiting i { animation: none; }
}
@media (max-width: 420px) {
  body { font-size: 18px; }
  .poem { font-size: 16px; }
  .sheet { padding: 18px 16px 24px; }
  .dialcard { grid-template-columns: repeat(5, 1fr); gap: 12px 2px; }
  .dialcard div { font-size: 14px; }
  .dialcard .hole { width: 40px; height: 40px; font-size: 21px; }
  .pair { grid-template-columns: 1fr; }
}
