/* backline — the shared look. docs/DESIGN.md explains the idea: a
   black-box stage floor under the ghost light, and every suggestion
   written in marker on a strip of spike tape. The tape colours mean
   something — one per kind of suggestion — the way a stage manager's
   spike marks do. */

/* Permanent Marker, by Font Diner — Apache License 2.0. Vendored from
   Google Fonts (v16, latin subset), 2026-09-18. */
@font-face {
  font-family: 'Permanent Marker';
  src: url('fonts/permanent-marker.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* the room */
  --floor: #1f1d1b;        /* matte stage black, warm, scuffed */
  --floor-2: #2a2724;      /* a raised thing on the floor: a riser, a card */
  --scuff: #3b3733;        /* hairlines, borders */
  --ghost: #f3dfae;        /* the ghost light's tungsten */
  --text: #ebe4d6;
  --muted: #a39a8d;
  --ink: #1b1a19;          /* marker ink on tape */

  /* spike tape — one colour per kind of suggestion */
  --tape-word: #f2cf3a;
  --tape-name: #f46fa8;
  --tape-relationship: #4aa8ea;
  --tape-location: #62cf7c;
  --tape-stage: #62cf7c;
  --tape-object: #ff8d42;
  --tape-emotion: #b590f2;
  --tape-plain: #efe9dc;   /* white gaffer: headings, buttons */
  --tape-other: #efe9dc;

  --marker: 'Permanent Marker', 'Marker Felt', 'Chalkboard SE', cursive;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --gutter: 16px;
  --measure: 34rem;
  --radius: 3px;
}

* { box-sizing: border-box; }

/* `hidden` must win over any display a class sets. */
[hidden] { display: none !important; }

html {
  background: var(--floor);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* the ghost light: one warm pool, top centre, falling off into the
     floor. The only decoration on the page. */
  background:
    radial-gradient(ellipse 70% 42% at 50% -6%, rgba(243, 223, 174, 0.16), rgba(243, 223, 174, 0) 70%),
    var(--floor);
  background-attachment: fixed;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    calc(env(safe-area-inset-right, 0px) + var(--gutter))
    calc(env(safe-area-inset-bottom, 0px) + 32px)
    calc(env(safe-area-inset-left, 0px) + var(--gutter));
}

main {
  max-width: var(--measure);
  margin: 0 auto;
}

a { color: var(--ghost); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ghost);
  outline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------------------------------------------------------- the header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--measure);
  margin: 0 auto 8px;
  min-height: 44px;
}
.top .back {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 10px 10px 0;
  font-size: 0.95rem;
}
.top .back:hover { color: var(--text); }
.wordmark {
  font-family: var(--marker);
  font-size: 1.15rem;
  color: var(--ghost);
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------ the tape */

/* A strip of tape: flat colour, torn ends, laid down a little crooked.
   The torn ends are a clip-path zigzag, so the strip is one element and
   the text inside it stays selectable. `--tape` sets the colour; the
   tilt comes from --tilt so neighbours can disagree. */
.tape {
  --tape: var(--tape-plain);
  --tilt: -1.2deg;
  display: inline-block;
  background: var(--tape);
  color: var(--ink);
  font-family: var(--marker);
  padding: 0.35em 1.1em 0.3em;
  transform: rotate(var(--tilt));
  clip-path: polygon(
    0% 8%, 2% 0%, 98% 0%, 100% 10%, 98.5% 25%, 100% 42%, 98.4% 58%,
    100% 75%, 98.6% 90%, 100% 100%, 2% 100%, 0% 88%, 1.4% 72%, 0% 55%,
    1.6% 38%, 0% 22%
  );
  /* the sheen of vinyl tape, very faint */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.06));
}
.tape.word         { --tape: var(--tape-word); }
.tape.name         { --tape: var(--tape-name); }
.tape.relationship { --tape: var(--tape-relationship); }
.tape.location     { --tape: var(--tape-location); }
.tape.stage        { --tape: var(--tape-stage); }
.tape.object       { --tape: var(--tape-object); }
.tape.emotion      { --tape: var(--tape-emotion); }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--scuff);
  border-radius: var(--radius);
  background: var(--floor-2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.go {
  background: var(--ghost);
  border-color: var(--ghost);
  color: var(--ink);
}
.btn[disabled] { opacity: 0.4; cursor: default; }

/* --------------------------------------------------------- the footer */

.foot {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--scuff);
  color: var(--muted);
  font-size: 0.85rem;
}
.foot p { margin: 0.4rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
