/* The reference uses lettering and architectural leaders, letting the sequence
   carry the atmosphere. Load after cinematic.css. */
@font-face {
  font-family: SequenceDisplay;
  src: url('assets/fonts/oswald.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --sequence-display: SequenceDisplay, 'Arial Narrow', sans-serif;
  --annotation-paper: #f7f8f3;
  --annotation-ink: #242924;
}

.hero-intro h1, .intro-meta, .intro-notes, .scene-notes-title,
.scene-notes li, .chapter-name { text-transform: uppercase; }

.readability-scrim {
  inset: 0;
  background: linear-gradient(90deg, #000a 0%, #0005 24%, transparent 48%);
}

.hero-intro {
  top: calc(76px + env(safe-area-inset-top, 0px));
  right: auto;
  bottom: auto;
  left: max(5.5vw, calc(24px + env(safe-area-inset-left, 0px)));
  max-width: min(620px, 52vw);
  color: var(--annotation-paper);
}

.hero-intro h1 {
  max-width: none;
  margin: 0;
  font-family: var(--sequence-display);
  font-size: clamp(54px, 5.4vw, 88px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: .055em;
  text-wrap: initial;
}

.hero-intro .intro-meta {
  margin-top: 17px;
  color: inherit;
  font: 400 12px/1.4 var(--sequence-display);
  letter-spacing: .18em;
}

.intro-divider {
  width: 26px;
  height: 1px;
  margin-top: 24px;
  background: currentColor;
  opacity: .7;
}

.intro-notes {
  display: grid;
  gap: 6px;
  margin: 21px 0 0;
  padding: 0 0 0 16px;
  border-left: 1px solid currentColor;
  list-style: none;
  font: 400 12px/1.5 var(--sequence-display);
  letter-spacing: .07em;
}

.dawn-pill,
.dawn-pill:hover,
.wall-pill,
.wall-pill:hover {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}

.dawn-pill {
  display: block;
  padding: 0;
  color: var(--scene-ink, var(--annotation-paper));
  font-family: var(--sequence-display);
  font-weight: 350;
  line-height: 1.06;
  letter-spacing: .025em;
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
}

.dawn-label {
  display: block;
  max-width: 100%;
}

.dawn-rule {
  display: block;
  width: 24px;
  height: 1px;
  margin-top: 8px;
  background: currentColor;
  opacity: .55;
}

.dawn-pill svg {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: 15px;
  height: 15px;
  margin: 0;
  stroke-width: 1.1;
  transition: transform .2s var(--ease);
}

.dawn-pill:hover svg {
  transform: translate(2px, -2px);
}

.hearth-lettering {
  position: absolute;
  z-index: 4;
  inset: 0 auto auto 0;
  transform-origin: top left;
  overflow: hidden;
  pointer-events: none;
  color: var(--annotation-paper);
  /* Source-space type unit until the measured plane dimensions are applied. */
  font-size: 100px;
}
.hearth-lettering a {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: .07em;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.hearth-lettering strong {
  font: 400 .45em/1.05 var(--sequence-display);
  letter-spacing: .027em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hearth-lettering a:nth-child(n+3) strong { font-size: .38em; }
.hearth-lettering a > span {
  font: 400 .19em/1.3 var(--sans);
  letter-spacing: .016em;
}
.hearth-lettering a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.hearth-lettering a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.stage.static .hearth-lettering { display: none; }

.scene-notes {
  position: absolute;
  z-index: 12;
  top: calc(112px + env(safe-area-inset-top, 0px));
  left: max(5.5vw, calc(24px + env(safe-area-inset-left, 0px)));
  width: min(270px, 23vw);
  color: var(--scene-ink, var(--annotation-paper));
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.scene-notes-title {
  margin: 0 0 24px;
  font: 350 clamp(28px, 2.5vw, 40px)/1.08 var(--sequence-display);
  letter-spacing: .065em;
}

.scene-notes ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 1px solid currentColor;
  list-style: none;
  font: 400 12px/1.5 var(--sequence-display);
  letter-spacing: .055em;
}

.scene-notes li {
  position: relative;
  padding-left: 0;
}

.scene-notes li::before {
  position: absolute;
  top: .7em;
  left: -20px;
  width: 7px;
  height: 1px;
  background: currentColor;
  content: '';
}

.scene-notes-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  margin-top: 20px;
  border-bottom: 1px solid currentColor;
  font: 400 12px/1.4 var(--sequence-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.scene-notes-link svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.1;
}

.chapter-nav {
  isolation: isolate;
  position: absolute;
  z-index: 15;
  right: max(5.5vw, calc(24px + env(safe-area-inset-right, 0px)));
  bottom: calc(21px + env(safe-area-inset-bottom, 0px));
  left: max(5.5vw, calc(24px + env(safe-area-inset-left, 0px)));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 24px;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 38%, transparent);
  color: var(--scene-ink, var(--annotation-paper));
}

/* A continuous edge veil keeps rail labels readable over pool reflections. */
.chapter-nav::after {
  position: absolute;
  z-index: -1;
  inset: -28px -7vw -28px;
  background: linear-gradient(0deg, #030907d9 0%, #030907a6 60%, transparent 100%);
  content: '';
  pointer-events: none;
}

.chapter-nav::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: calc(var(--chapter-progress, 0) * 100%);
  height: 1px;
  background: currentColor;
  content: '';
}

.chapter-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.7vw, 28px);
  min-width: 0;
  min-height: 52px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: 400 12px/1.4 var(--sequence-display);
  letter-spacing: .09em;
  transition: opacity .2s var(--ease);
  opacity: .9;
}

.chapter-link[aria-current='step'],
.chapter-link:hover,
.chapter-link:focus-visible {
  opacity: 1;
}

.chapter-link[aria-current='step']::before {
  position: absolute;
  top: -2px;
  left: 0;
  width: 34px;
  height: 3px;
  background: currentColor;
  content: '';
}

.chapter-number {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chapter-name {
  min-width: 0;
}

.menu-toggle,
.menu-toggle:hover,
.menu-toggle[aria-expanded='true'] {
  min-width: 94px;
  min-height: 44px;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--scene-ink, var(--annotation-paper));
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font: 400 12px/1.4 var(--sequence-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.1;
}

.menu-toggle { text-shadow: 0 1px 3px #000d; }
.menu-toggle svg { filter: drop-shadow(0 1px 2px #000b); }
.menu-toggle.on-plaster {
  --scene-ink: #20221f;
  text-shadow: none;
}
.menu-toggle.on-plaster svg { filter: none; }

.menu-panel {
  border: 1px solid #f7f8f338;
  border-radius: 0;
  background: #0e1715;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.menu-panel > a {
  font-family: var(--sequence-display);
  font-size: 26px;
  font-weight: 350;
  letter-spacing: .035em;
}

.menu-panel > a:hover {
  color: #fff;
}

.menu-settings input {
  accent-color: var(--annotation-paper);
}

.finale .brand-logo {
  width: min(100%, clamp(275px, 34vw, 510px));
  height: auto;
  filter: none;
}

.finale > p {
  font-family: var(--sequence-display);
  font-size: clamp(30px, 3.3vw, 48px);
  font-weight: 350;
  line-height: 1.16;
  letter-spacing: .035em;
}

.finale-link,
.finale-link:hover {
  gap: 36px;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--annotation-paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font: 400 14px/1.4 var(--sequence-display);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.finale-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.1;
  transition: transform .2s var(--ease);
}

.finale-link:hover svg {
  transform: translate(2px, -2px);
}

.scroll-cue,
.progress-rail {
  display: none;
}

.loading-note {
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  background: #0e1715;
  font-size: 12px;
}

.stage.static .chapter-nav,
.stage.static .scene-notes {
  display: none;
}

@media (max-width: 1000px) {
  .scene-notes {
    width: min(230px, 27vw);
  }

  .scene-notes-title {
    font-size: 28px;
  }
}

@media (max-width: 700px) {
  .hero-intro {
    top: calc(100px + env(safe-area-inset-top, 0px));
    right: 24px;
    bottom: auto;
    left: calc(24px + env(safe-area-inset-left, 0px));
    max-width: calc(100% - 48px);
  }

  .hero-intro h1 {
    max-width: none;
    margin-bottom: 0;
    font-size: clamp(42px, 11.8vw, 48px);
    line-height: 1.08;
    letter-spacing: .04em;
  }

  .hero-intro .intro-meta {
    margin-top: 12px;
    font-size: 12px;
    letter-spacing: .13em;
  }

  .intro-divider {
    width: 22px;
    margin-top: 16px;
  }

  .intro-notes {
    gap: 4px;
    margin-top: 16px;
    padding-left: 13px;
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: .035em;
  }

  .scene-notes {
    display: none;
  }

  .chapter-nav {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: calc(16px + env(safe-area-inset-left, 0px));
    gap: 0 4px;
  }

  .chapter-link {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 5px 0;
    font-size: 12px;
    letter-spacing: .025em;
  }

  .chapter-link[aria-current='step']::before {
    top: 2px;
    width: 26px;
    height: 2px;
  }

  .menu-toggle,
  .menu-toggle:hover,
  .menu-toggle[aria-expanded='true'] {
    min-width: 88px;
    min-height: 44px;
    padding: 6px 0;
    gap: 22px;
    font-size: 12px;
  }

  .menu-panel > a {
    font-size: 25px;
  }

  .finale > p {
    font-size: 33px;
    margin-bottom: 28px;
  }

  .finale-link,
  .finale-link:hover {
    width: auto;
    max-width: 100%;
    min-height: 52px;
    padding: 10px 0;
    gap: 26px;
    font-size: 13px;
  }

  .loading-note {
    bottom: calc(124px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
  }
}

@media (max-height: 600px) {
  .finale .brand-logo {
    height: 30svh;
    width: auto;
    max-width: 76vw;
  }
  .hero-intro {
    top: calc(32px + env(safe-area-inset-top, 0px));
    bottom: auto;
  }

  .hero-intro h1 {
    font-size: clamp(34px, 7.3svh, 48px);
  }

  .hero-intro .intro-meta {
    margin-top: 10px;
  }

  .intro-divider {
    margin-top: 12px;
  }

  .intro-notes {
    gap: 2px;
    margin-top: 12px;
    font-size: 12px;
  }

  .scene-notes {
    top: calc(56px + env(safe-area-inset-top, 0px));
  }

  .scene-notes-title {
    margin-bottom: 16px;
    font-size: 27px;
  }

  .scene-notes ul {
    gap: 6px;
  }

  .chapter-nav {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .chapter-link {
    min-height: 44px;
  }

  .finale > p {
    margin-bottom: 16px;
    font-size: clamp(24px, 5.2svh, 31px);
  }

  .finale-link,
  .finale-link:hover {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-nav,
  .scene-notes {
    display: none;
  }

  .chapter-link,
  .dawn-pill svg,
  .finale-link svg {
    transition: none;
  }
}
