/* Assemblage — shared tokens, controls and inquiry form. Compositions live in each page. */

:root {
  --ink: #0A0506;        /* near-black page */
  --burgundy: #4A1525;
  --mauve: #2D1020;
  --rose: #4A2035;
  --cream: #F0E6D3;
  --gold: #D4A853;

  --cream-soft: #CDBFAC; /* secondary text, 10.6:1 on --ink */
  --field: #855467;      /* input fill, 3.3:1 against --ink; cream text 4.9:1 on it */
  --error: #F4B4A8;

  --serif: Georgia, Charter, "Bitstream Charter", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --quick: 160ms;
  --calm: 420ms;

  --gutter: clamp(20px, 5vw, 72px);
  --measure: 34rem;

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }

a { color: var(--gold); text-underline-offset: 0.2em; }

::selection { background: var(--gold); color: var(--ink); }

/* Focus: whole-control fill, never a ring. */
:focus { outline: none; }
a:focus-visible { background: var(--gold); color: var(--ink); text-decoration: none; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.125rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream);
}

/* Buttons: borderless, one radius, press scales slightly. Transitions sit on the base state. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 52px;
  min-width: 44px;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font: 600 1.0625rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--quick) var(--ease),
    color var(--quick) var(--ease),
    transform var(--quick) var(--ease);
}
.btn .arrow { transition: transform var(--calm) var(--ease); }
.btn:focus-visible { background: var(--cream); color: var(--burgundy); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.btn:active { transform: scale(0.97); }

.btn--quiet { background: var(--rose); color: var(--cream); }
.btn--quiet:focus-visible { background: var(--cream); color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #E2BC6C; }
  .btn:hover .arrow { transform: translateX(3px); }
  .btn--quiet:hover { background: #5C2943; }
  .btn:focus-visible:hover { background: var(--cream); }
}

/* Inquiry */
.preview-note {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--mauve);
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1.5;
}
.preview-note strong { color: var(--gold); font-weight: 600; white-space: nowrap; }

.form { display: grid; gap: 1.6rem; }

.field { display: grid; gap: 0.45rem; }
.field label { font-weight: 600; font-size: 1rem; line-height: 1.35; transition: color var(--quick) var(--ease); }
.field label .optional { font-weight: 400; color: var(--cream-soft); }
.field .hint { font-size: 0.9rem; line-height: 1.45; color: var(--cream-soft); margin-top: -0.15rem; }

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--field);
  color: var(--cream);
  font: 400 1.0625rem/1.5 var(--sans);
  caret-color: currentColor;
  transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
.field textarea { resize: vertical; min-height: 9rem; }
.field textarea[rows="3"] { min-height: 6rem; }

/* The field you are writing in becomes a lit page. */
.field input:focus,
.field textarea:focus { background: var(--cream); color: var(--ink); }
.field:focus-within label { color: var(--gold); }

.field [aria-invalid="true"] { background: #6E2A3B; }
.field [aria-invalid="true"]:focus { background: var(--cream); }
.error { color: var(--error); font-size: 0.95rem; line-height: 1.4; font-weight: 600; }
.error[hidden] { display: none; }

.form-actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; align-items: center; padding-top: 0.2rem; }
.form-actions .aside { font-size: 0.9rem; color: var(--cream-soft); }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { color: var(--error); font-weight: 600; font-size: 0.95rem; line-height: 1.5; }
.status a { color: var(--cream); }
.done { display: grid; gap: 1rem; }
.done h3 { font-size: clamp(2rem, 4vw, 2.75rem); color: var(--gold); }
.btn:disabled { cursor: progress; opacity: 0.8; }

.review { display: grid; gap: 1.4rem; }
.review[hidden] { display: none; }
.review h3 { font-size: clamp(1.6rem, 3vw, 2rem); }
.review dl { display: grid; gap: 1.1rem; }
.review dt { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-soft); }
.review dd { white-space: pre-wrap; font-size: 1.0625rem; }
.review dd.empty { color: var(--cream-soft); font-style: italic; }
.not-sent {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--mauve);
  font-size: 0.95rem;
  line-height: 1.5;
}
.not-sent strong { color: var(--gold); }

/* Optional film: rendered only when configured. No thumbnail (Tim, 2026-11-17): a cream panel the film's size reads
   "start here ▶"; pressed, the words fade and the cream dissolves into the film over about a second, then it plays. */
.film-stage { position: relative; aspect-ratio: 16 / 9; }
.film video {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  background: transparent; border-radius: inherit; opacity: 0;
}
.film-start {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: inherit;
  background: var(--cream); color: var(--ink); font: 600 clamp(1.2rem, 2vw, 1.5rem)/1.2 var(--sans);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: opacity 900ms var(--slow) 100ms, background-color var(--quick) var(--ease);
}
.film-start-label { display: inline-flex; align-items: center; gap: 0.6em; transition: opacity 300ms var(--ease), transform var(--quick) var(--ease); }
.film-start-mark {
  width: 0; height: 0; border-style: solid; border-width: 0.45em 0 0.45em 0.75em;
  border-color: transparent transparent transparent currentColor;
}
.film-start:focus-visible { background: var(--gold); }
.film-start:active .film-start-label { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .film-start:hover { background: #FFF6E6; } .film-start:focus-visible:hover { background: var(--gold); } }
.film.is-starting video { opacity: 1; }
.film.is-starting .film-start { opacity: 0; pointer-events: none; }
.film.is-starting .film-start-label { opacity: 0; }
.film.is-playing .film-start { visibility: hidden; }
.film-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.film-meta p { font-size: 0.875rem; color: var(--cream-soft); letter-spacing: 0.01em; }
.film-meta strong { color: var(--cream); font-weight: 600; }
.film figcaption { color: var(--cream-soft); font-size: 0.95rem; }
.film-more {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem;
  border-radius: var(--radius); background: rgba(240, 230, 211, 0.1); color: var(--cream-soft);
  font-size: 0.85rem; text-decoration: none; transition: background var(--quick) var(--ease);
}
.film-more:focus-visible { outline: none; background: var(--cream); color: var(--ink); }
.film-more:active { transform: scale(0.97); }
@media (hover: hover) { .film-more:hover { background: rgba(240, 230, 211, 0.18); } }
/* Tim's seal, the link to his other work (src/seal.js draws it). The box is sized before the seal is drawn. */
.footer-seal { display: block; width: 96px; height: 96px; padding: 6px; border-radius: var(--radius); box-sizing: content-box; }
.footer-seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.footer-seal:focus-visible { outline: none; background: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:active { transform: none; }
}
