/* ============================================================
   DOUBLOON STUDIO · BASE
   Reset, layout, scene shells, skip link, focus, reduced motion.
   Uses tokens only (css/tokens.css). No color or font name here.

   PAGE CONTRACT (the same text is in the site facts file at the repo root)
   - Film player owns: .scene__stage, js/film.js, css/film.css,
     site/media/.
   - Sections own: .scene__words, js/sections.js, css/sections.css.
   - Search basics own: the search-basics block in the head of
     index.html.
   - Small pages own their own .html files.
   State hooks:
   - film.js adds class "film-on" on <html> while the film runs. It is
     never added with scripts off, under reduced motion, or with
     ?film=off in the address.
   - Each .scene gets data-state="idle", "playing" or "held", and the
     scene on the stage carries data-current.
   - Scene words are visible by default. While the film runs, only the
     current scene is seen: html.film-on .film-stage >
     .scene:not([data-current]) is hidden. That one rule lives in this
     file so both sides inherit it.
   ============================================================ */

/* ---------- reset ---------- */

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  overflow-wrap: break-word;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ---------- focus ---------- */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- skip link: visible from the first frame ---------- */

.skip-contact {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 50;
  padding: 0.5rem 0.85rem;
  background: var(--scrim);
  color: var(--text);
  border: 1px solid var(--rule);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
}

.skip-contact:hover,
.skip-contact:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- headings ---------- */

h2 {
  font-family: var(--font-quill);
  font-weight: var(--weight-quill);
  line-height: var(--leading-quill);
  letter-spacing: var(--tracking-quill);
  text-wrap: balance;
}

p {
  max-width: var(--measure);
  text-wrap: pretty;
}

/* ---------- scene shells (the film) ---------- */

.scene {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.scene__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.scene__words {
  position: relative;
  z-index: 1;
  padding: 0 1rem 12vh;
  max-width: 64rem;
  transition: opacity 0.6s ease;
}

.scene__words h2 {
  font-size: var(--size-quill-scene);
  color: var(--text);
}

/* While the film runs, the stage shows one scene at a time: the one
   that carries data-current. The others stay in the page, unseen, so
   screen readers and search still read every scene's words. */
html.film-on .film-stage > .scene:not([data-current]) {
  opacity: 0;
  pointer-events: none;
}

.scene + .scene {
  border-top: 1px solid var(--rule);
}

/* ---------- after the film ---------- */

.section {
  padding: 18vh 1rem 14vh;
  border-top: 1px solid var(--rule);
}

.section h2 {
  font-size: var(--size-quill-section);
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.section--shaping {
  background: var(--surface);
}

.section--about {
  padding-block: 12vh 10vh;
}

.section--contact {
  padding-block: 22vh 16vh;
}

/* ---------- footer fact card ---------- */

.fact-card {
  padding: 3rem 1rem 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: var(--size-small);
  color: var(--text-muted);
}

.fact-card__inner {
  display: grid;
  gap: 1.25rem;
  max-width: 64rem;
}

.fact-card dl {
  display: grid;
  gap: 0.35rem 1.5rem;
}

.fact-card dt {
  font-size: var(--size-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.fact-card dd {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.fact-card__name {
  color: var(--text);
  font-size: var(--size-body);
}

.fact-card ul {
  list-style: none;
  padding: 0;
}

/* ---------- wider screens ---------- */

@media (min-width: 48em) {
  .scene__words,
  .section,
  .fact-card {
    padding-inline: 6vw;
  }

  .scene:nth-of-type(even) .scene__words {
    justify-self: end;
    text-align: right;
  }

  .fact-card__inner {
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }

  .fact-card dl {
    grid-template-columns: max-content 1fr;
  }

  .fact-card dd {
    margin: 0;
  }
}

/* ---------- reduced motion ---------- */

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