/* The answering machine, about 1985.

   Beige plastic on a dark desk. The machine is built from five things and all
   of them are cheap: a rounded box with a warm gradient, a speaker grille made
   of a repeated radial dot, a sunken tape window with two reels, a red counter
   digit, and four chunky buttons with a real bevel on them.

   The bevel is the detail that sells it. A button from 1985 had a light top
   edge and a dark bottom one and it moved down when pressed, and that is two
   box-shadows and a transform. Nothing here is an image. */

:root {
  --am-case:   #d8cdb4;   /* the beige everything was */
  --am-case-2: #bfb298;
  --am-dark:   #4a4436;
  --am-ink:    #2b2820;
  --am-red:    #e03a2f;
  --am-desk:   #2e2620;
  --am-paper:  #fdfbf5;
  --am-dim:    #6b6558;
  --am-orange: #E87722;
}

body {
  background: var(--am-desk);
  /* Woodgrain, very faint: fine vertical striping at two frequencies. */
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 11px, transparent 11px 26px);
  color: var(--am-ink);
  font: 16px/1.65 "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 26px 12px 46px;
}

.am {
  max-width: 780px;
  margin: 0 auto;
  background: var(--am-paper);
  border-radius: 3px;
  padding: 0 34px 34px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}

a { color: #8a4a12; }

/* ── The machine ───────────────────────────────────────────────────────── */

.am-machine {
  background: linear-gradient(165deg, #e6dcc6 0%, var(--am-case) 42%, var(--am-case-2) 100%);
  border-radius: 12px;
  padding: 16px 20px 18px;
  margin: 0 -34px 26px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -3px 8px rgba(0, 0, 0, .22), 0 6px 18px rgba(0, 0, 0, .3);
}

.am-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.am-brand {
  margin: 0;
  font: 700 11px/1 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--am-dark);
}
.am-counter { display: flex; align-items: center; gap: 8px; margin: 0; }
/* The counter, sunk into the case and lit from inside. */
.am-led {
  background: #2a0806; color: var(--am-red);
  font: 700 24px/1 "Courier New", monospace;
  padding: 3px 11px; border-radius: 2px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .8);
  text-shadow: 0 0 8px rgba(224, 58, 47, .9);
  font-variant-numeric: tabular-nums;
}
.am-counter-label {
  font: 700 10px/1 Arial, sans-serif;
  letter-spacing: .2em; text-transform: uppercase; color: var(--am-dark);
}

.am-grille {
  height: 34px; margin: 14px 0;
  border-radius: 3px;
  background-color: #b3a68c;
  background-image: radial-gradient(circle, rgba(0,0,0,.42) 1.5px, transparent 1.6px);
  background-size: 8px 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4);
}

/* The tape window: two reels behind smoked plastic. Held to roughly a
   cassette's proportions and centered, because stretched across the full width
   of the case it read as a letterbox rather than as a window with a tape in
   it. The shape is most of what makes it recognizable. */
.am-tape {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  width: 210px; margin: 0 auto;
  height: 54px; padding: 0 16px;
  background: #6d6555;
  border-radius: 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55);
  position: relative;
}
.am-reel {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, #1d1b16 0 7px, #3a352b 7px 100%);
  border: 2px solid #26231c;
  position: relative;
}
.am-reel::after {
  content: ""; position: absolute; inset: 11px;
  border-radius: 50%; background: #c9bda2;
}
.am-tape-band { flex: 0 0 auto; width: 34px; height: 3px; background: #26231c; }

/* Turning, but only while something is playing. */
.am-tape.is-playing .am-reel { animation: am-spin 1.6s linear infinite; }
@keyframes am-spin { to { transform: rotate(360deg); } }

.am-buttons { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.am-btn {
  font: 700 12px/1 Arial, sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 11px 18px;
  border: 0; border-radius: 3px;
  background: linear-gradient(#efe8d6, #c8bda3);
  color: var(--am-ink);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #9a9077, 0 4px 6px rgba(0, 0, 0, .3);
}
button.am-btn { cursor: pointer; }
button.am-btn:hover { background: linear-gradient(#f6f0e2, #d2c7ad); }
button.am-btn:active { transform: translateY(3px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35); }
button.am-btn:focus-visible { outline: 2px solid var(--am-orange); outline-offset: 2px; }
.am-btn-play { color: #123d12; }
/* Rewind and Announce are part of the picture, not controls. Flat, unlabelled
   as interactive, and not focusable, because a button that does nothing is
   worse than no button. */
.am-btn-dead { opacity: .55; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }

/* ── The page ──────────────────────────────────────────────────────────── */

.am h1 { font-size: clamp(23px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; color: var(--am-ink); }
.am h2 { font-size: 19px; margin: 32px 0 6px; color: #7a4a14; }
.am h3 { font-size: 15px; margin: 16px 0 2px; }
.am p  { margin: 8px 0; max-width: 70ch; }
.am-lead { font-size: 17px; color: #3a352b; }
.am-note { color: var(--am-dim); font-size: 14px; }
.am-list { margin: 8px 0; padding: 0 0 0 24px; max-width: 70ch; }
.am-list li { margin-bottom: 9px; }

/* The outgoing message, set as the recording it is. */
.am-announce {
  margin: 20px 0 0; padding: 14px 18px;
  border-left: 4px solid var(--am-case-2);
  background: #f4efe2;
}
.am-announce p { margin: 0; font-style: italic; font-size: 17px; }
.am-announce-note { margin-top: 8px; font-size: 13px; color: var(--am-dim); font-style: normal; }

/* ── The tape ──────────────────────────────────────────────────────────── */

.am-tape-list { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: none; }
.am-tape-list > li {
  border-top: 1px solid #e4ddc9;
  padding: 16px 16px 16px 18px;
  border-left: 4px solid transparent;
  transition: background .15s linear, border-color .15s linear;
}
/* The message the machine is currently playing. */
.am-tape-list > li.is-playing {
  background: #fff8e2;
  border-left-color: var(--am-red);
}

.am-msg-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 8px !important; align-items: baseline; }
.am-msg-n {
  font: 700 10px/1 Arial, sans-serif;
  letter-spacing: .18em; text-transform: uppercase; color: var(--am-red);
}
.am-msg-who { font-weight: 700; }
.am-msg-when { color: var(--am-dim); font-size: 13px; }

.am-says { margin: 0; padding: 0 0 0 16px; border-left: 3px solid #ded5bd; }
.am-says p { margin: 0; font-style: italic; font-size: 16px; color: #35312a; }

.am-means { margin: 10px 0 0 !important; font-size: 15px; color: #4a453a; }
.am-means-label { font-weight: 700; color: #7a4a14; }

/* ── The form ──────────────────────────────────────────────────────────── */

.am-box {
  background: #f4efe2;
  border: 1px solid #ded5bd;
  border-radius: 4px;
  padding: 18px 22px 22px;
  margin: 30px 0 0;
  max-width: 560px;
}
.am-box h2 { margin-top: 0; }

.am-field { margin: 0 0 12px; }
.am-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.am-field input, .am-field textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #b9ae94; border-radius: 2px;
  background: #fff;
  font: 15px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.am-field input:focus, .am-field textarea:focus { outline: 2px solid var(--am-orange); outline-offset: 1px; }
.am-field.is-bad input, .am-field.is-bad textarea { border-color: var(--am-red); background: #fff7f6; }

.rt-field-err { color: #a5271e; font-size: 13px; font-weight: 700; margin: 4px 0 0; }
.rt-err { border: 1px solid var(--am-red); background: #fff7f6; color: #7d1c15; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }

.am-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 16px 0 0; }
.am-actions button {
  background: var(--am-red); color: #fff; border: 0;
  padding: 11px 30px; border-radius: 3px;
  font: 700 15px/1.2 "Helvetica Neue", Arial, sans-serif; cursor: pointer;
}
.am-actions button:hover, .am-actions button:focus { background: var(--am-orange); }

@media (max-width: 560px) {
  .am { padding: 0 16px 24px; }
  .am-machine { margin: 0 -16px 20px; border-radius: 0 0 12px 12px; }
  .am-tape-list > li { padding: 14px 0 14px 12px; }
}
