/* The threshold and the player share the same quiet arctic instrument. */
:root {
  --ink: #303943;
  --slate: #505b67;
  --gold: #825d27;
  --paper: #f4f0e7;
  --paper-2: #ebe5d7;
  --serif: 'IBM Plex Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.rise { opacity: 1; transform: none; }
body.page { --bg: var(--paper); }
body.page .room-tone { background: var(--paper-2); }
body.page .room-title { letter-spacing: -.015em; font-weight: 500; }
body.page .room-intro, body.page .lede { font-size: 13px; line-height: 1.9; max-width: 65ch; }
body.page .room .eyebrow { font-size: 10px; letter-spacing: .1em; }
body.page .statute span, body.page .promise, body.page .doorroom li, body.page .willnot p { font-size: 12px; line-height: 1.9; }
body.page .statute b { letter-spacing: .03em; }
body.page .letterform :is(input, select, textarea) { background-color: #faf7ef; }
body.page .letterform :is(input, textarea)::placeholder { color: #596574; }
body.page .page-hero, body.page .doorroom figure { border: 0; }
body.page .hud-top { gap: 22px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
html.cursor-live :is(a, button), html.cursor-live :is(a, button) * { cursor: pointer!important; }
html.cursor-live :is(input, textarea) { cursor: text!important; }
html.cursor-live #film-seek, html.cursor-live select { cursor: pointer!important; }
body:has(:is(a, button, input, textarea, select):hover) #cursor { opacity: 0; }
body :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}
.skip-link {
  position: fixed; top: 14px; left: 24px; z-index: 100;
  transform: translateY(-160%); padding: 12px 18px;
  background: var(--bg); color: var(--ink);
}
.skip-link:focus { transform: none; }
body:has(dialog[open]) { overflow: hidden; }

/* The figures remain the subject. The title occupies the space between them. */
#door { padding: 0; overflow: hidden; background: transparent; }
#door::before { display: none; }
.door-landscape {
  position: absolute; inset: 0;
  background: url('../assets/arctic-opening.jpg') center 62% / cover no-repeat;
  filter: saturate(.94);
  opacity: calc(1 - var(--dz, 0) * 1.4);
  transform: scale(calc(1 + var(--dz, 0) * .045));
}
.door-landscape::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(230,238,248,.68), rgba(228,237,248,.08) 36%, rgba(233,240,248,.03) 64%, rgba(234,241,249,.91));
}
#door .door-mast {
  left: var(--rail); top: 38px; transform: none;
  font-size: 17px; letter-spacing: .25em; text-indent: 0;
  animation: none;
}
#door-ambient { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; opacity: 0; transition: opacity .8s ease; }
#door.has-ambient #door-ambient { opacity: 1; }
#ambient-toggle { position: absolute; bottom: 25px; left: var(--rail); padding: 10px 0; min-height: 44px; background: none; border: 0; color: var(--slate); font: 400 9px/1.4 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
#ambient-toggle[hidden] { display: none; }
.door-nav {
  position: absolute; top: 28px; right: var(--rail);
  display: flex; align-items: center; gap: 34px;
  opacity: calc(1 - var(--dz, 0) * 2);
}
.door-nav a, .door-nav button, #hud-join {
  border: 0; background: none; color: var(--ink);
  font: 500 11px/1.4 'IBM Plex Mono', monospace;
  letter-spacing: .03em; text-decoration: none;
  min-height: 44px; padding: 10px 0; cursor: pointer;
}
.door-nav button span { padding-left: 8px; }
.door-nav a:hover, .door-nav button:hover { color: var(--gold); }
.door-heading {
  position: absolute; left: 50%; top: 23%; transform: translateX(-50%);
  width: min(47vw, 680px); text-align: center;
  opacity: calc(1 - var(--dz, 0) * 2);
  text-shadow: 0 2px 28px rgba(239,245,251,.9);
}
.door-prologue {
  margin: 0 0 24px; font-size: 11px; line-height: 1.6;
  color: var(--slate); letter-spacing: .02em;
}
#door-title {
  font-family: 'Cinzel', serif; font-weight: 500;
  font-size: clamp(40px, 4.7vw, 76px); line-height: 1.13;
  letter-spacing: -.025em; margin: 0;
}
#door .door-tag { top: 65%; animation: none; }
#door .door-tag.tag-you { left: var(--rail); right: auto; text-align: left; }
#door .door-tag.tag-twin { right: var(--rail); left: auto; text-align: right; }
#door .door-tag i { font-size: 10px; letter-spacing: .18em; }
#door .door-tag b { margin-top: 9px; font-size: 8px; letter-spacing: .1em; }
#door .door-tag::after { display: none; }
#door .door-act {
  bottom: 10%; width: min(560px, 90vw);
  animation: none; opacity: calc(1 - var(--dz, 0) * 2);
}
#door .door-act .door-thesis {
  margin: 0 auto 24px; max-width: 52ch; width: 100%;
  font: 400 12px/1.8 'IBM Plex Mono', monospace;
  color: var(--ink); letter-spacing: 0;
}
#door .door-act #door-play {
  margin: 0; padding: 0; border: 0; background: none;
  display: inline-flex; gap: 15px; align-items: center;
  backdrop-filter: none; box-shadow: none; animation: none;
  text-align: left; min-height: 52px;
}
#door .door-act #door-play::before { display: none; }
#door-play svg { width: 44px; height: 44px; stroke: var(--ink); stroke-width: 1; transition: transform .5s var(--ease-out); }
#door-play svg path { fill: var(--ink); stroke: none; }
#door-play:hover svg { transform: scale(1.1); }
#door-play .play-copy { text-align: left; }
#door-play .play-copy b { font-size: 12px; letter-spacing: .04em; }
#door-play .play-copy i { font-size: 8px; letter-spacing: .09em; color: var(--slate); }
.story-link {
  display: block; margin: 14px auto 0; padding: 10px 6px;
  min-height: 44px;
  border: 0; background: none; color: var(--slate);
  font-size: 10px; line-height: 1.5; text-decoration: underline;
  text-decoration-color: #929aa3; text-underline-offset: 4px; cursor: pointer;
}
.story-link:hover { color: var(--ink); }
.door-foot {
  position: absolute; left: 50%; bottom: 33px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  font-size: 9px; letter-spacing: .08em;
  opacity: calc(1 - var(--dz, 0) * 2);
}
.scroll-stroke { width: 1px; height: 30px; background: #acb6c2; overflow: hidden; }
.scroll-stroke::after {
  content: ''; display: block; height: 12px; background: var(--ink);
  animation: scroll-indicator 2.8s var(--ease-out) infinite;
}
@keyframes scroll-indicator { from { transform: translateY(-13px); } to { transform: translateY(32px); } }
.door-edition { position: absolute; right: var(--rail); bottom: 41px; font-size: 9px; letter-spacing: .08em; color: var(--slate); }
.life-heart { width: 110px; height: 110px; left: calc(var(--hx) - 55px); top: calc(var(--hy) - 55px); }
.door-snow { opacity: .45; }

/* The film controls are a single rail, with native keyboard seeking. */
#hud .hud-top { align-items: center; padding-top: 28px; }
#hud .hud-mark { font-size: 12px; }
#hud .hud-cat { display: none; }
#hud .hud-nav { opacity: 1; pointer-events: auto; align-items: center; gap: 30px; }
#hud .hud-nav a { font-size: 11px; min-height: 44px; padding: 13px 0; letter-spacing: .03em; }
#hud-skip { display: none; }
#hud.inert { visibility: hidden; }
#hud:has(~ #runway) { pointer-events: none; }
#hud-sound { left: auto; right: calc(var(--rail) - 14px); bottom: 43px; transform: none; min-height: 44px; }
.transport {
  position: fixed; left: 50%; bottom: 43px; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center; pointer-events: auto;
}
.transport button { padding: 12px 4px; min-height: 44px; border: 0; background: none; color: inherit; font: 500 10px/1.5 'IBM Plex Mono', monospace; letter-spacing: .12em; cursor: pointer; }
.transport span { opacity: .35; }
.hud-dist { bottom: 52px; }
body.infilm #hud .hud-dist { opacity: 1; }
.hud-dist > em { font-size: 9px; opacity: 1; }
#hud-dist { display: none; }
#hud-presence, #hud-dial { display: none; }
body.on-dark .transport, body.on-dark #hud-join { color: var(--night-ink); }
#film-seek {
  position: fixed; left: var(--rail); bottom: 0; width: calc(100% - var(--rail) * 2);
  height: 44px; margin: 0; padding: 0; border: 0; cursor: pointer;
  appearance: none; background: transparent; pointer-events: auto;
  --played: 0%;
}
#film-seek::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right,var(--gold) var(--played),rgba(80,91,103,.25) var(--played)); }
#film-seek::-webkit-slider-thumb { appearance: none; height: 7px; width: 7px; border-radius: 50%; margin-top: -3px; background: var(--gold); border: 0; }
#film-seek::-moz-range-track { height: 1px; background: #929aa3; }
#film-seek::-moz-range-progress { height: 1px; background: var(--gold); }
#film-seek::-moz-range-thumb { width: 7px; height: 7px; border: 0; background: var(--gold); border-radius: 50%; }
body.on-dark #film-seek { --gold: #d6b581; }
body.sealing :is(.transport, #film-seek, #hud-sound, .hud-dist) { visibility: hidden; }

/* A caption sits beside the image. It never competes with the subject. */
.card { border: 0; padding: 22px 24px; width: min(310px, 27vw); bottom: 19vh; background: rgba(237,243,249,.91); }
.card i { font-size: 9px; color: var(--gold); margin-bottom: 13px; }
.card b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.card em { margin-top: 12px; font-size: 11px; line-height: 1.8; color: var(--ink); text-shadow: none; }
body.on-dark .card { background: rgba(29,43,54,.88); border: 0; }
body.on-dark .card :is(b, em) { text-shadow: none; }
.slip { border-radius: 0; padding: 18px 22px; }
#close-type b { letter-spacing: .04em; line-height: 1.25; }

/* The dawn is the invitation. */
#seal { visibility: hidden; }
#seal .seal-landscape { position: absolute; inset: 0; z-index: -1; background: #f4ecd9; opacity: 0; transition: opacity 1.2s ease; }
#seal .seal-landscape img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
body.sealing #seal .seal-landscape { opacity: 1; }
body.sealing #seal { visibility: visible; pointer-events: auto; }
#seal .seal-head { margin-top: 16vh; }
#seal .seal-count { font-weight: 500; font-size: clamp(40px,4.7vw,68px); letter-spacing: -.025em; line-height: 1.12; }
#seal .seal-kicker { font-size: 9px; color: var(--slate); letter-spacing: .13em; margin-bottom: 22px; }
#seal .seal-count em { color: var(--ink); }
#seal .seal-act { width: min(620px,90vw); margin-bottom: 3.5vh; }
body.sealing #seal .seal-act { transition-delay: .15s; }
#seal .seal-line { color: var(--ink); font-size: 12px; margin: 0 auto 22px; }
#seal::before { background: linear-gradient(180deg,rgba(248,239,215,.95),rgba(248,239,215,.50) 60%,transparent); }
#seal::after { height: 49vh; background: linear-gradient(0deg,rgba(248,240,221,.98),rgba(248,240,221,.94) 68%,transparent); }
#seal #claim-form { flex-direction: column; align-items: center; gap: 12px; text-align: center; }
#seal #claim-seal { min-width: 256px; min-height: 54px; padding: 16px 26px; background: var(--ink); border-color: var(--ink); color: #f1f5fa; letter-spacing: .06em; }
#claim-seal span { display: inline-block; margin-left: 24px; transition: transform .3s var(--ease-out); }
#claim-seal:hover span { transform: translate(3px,-3px); }
#seal #claim-seal:disabled { cursor: default; }
#seal #claim-seal.sealed { background: transparent; color: var(--gold); border-color: rgba(130,93,39,.4); }
.interest-note { margin: 0; font-size: 10px; line-height: 1.6; color: var(--slate); }
#claim-standing { margin: 0; max-width: 40ch; font-size: 11px; line-height: 1.8; }
#cta-vaults[hidden], #claim-standing[hidden] { display: none; }
#seal.interest-expressed .seal-head { filter: drop-shadow(0 0 28px rgba(226,201,148,.35)); }
#seal #claim-seal:hover { background: #485664; }
#claim-err { margin: 0; min-height: 0; color: #a42e21; }
#claim-err:empty { display: none; }
.claim-standing { color: var(--ink); }
#seal .cta-vaults { font-size: 9px; letter-spacing: .06em; margin-top: 17px; }
#seal .seal-demo { margin-top: 21px; letter-spacing: .04em; font-size: 9px; }
#seal .seal-legal { margin: 15px 0 0; }
#seal .seal-legal a { display: inline-flex; align-items: center; min-height: 44px; font-size: 9px; letter-spacing: .02em; }
#seal-replay { border: 0; background: none; color: var(--slate); font-size: 9px; padding: 10px; min-height: 44px; cursor: pointer; }

/* Native dialogs preserve focus, Escape, and the place in the film. */
.film-dialog {
  width: min(890px, calc(100vw - 48px)); max-height: calc(100svh - 64px);
  padding: clamp(30px,5vw,60px); border: 0; color: var(--ink);
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
}
.film-dialog::backdrop { background: rgba(43,56,70,.55); backdrop-filter: blur(9px); }
.dialog-close { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.dialog-caption { font-size: 9px; letter-spacing: .12em; margin: 0 0 15px; color: var(--slate); }
.film-dialog h2 { font: 500 clamp(25px,3vw,40px)/1.2 'Cinzel',serif; letter-spacing: -.02em; margin: 0 0 32px; }
.chapter-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 25px 20px; }
.chapter-list button { border: 0; padding: 0; text-align: left; background: none; cursor: pointer; color: var(--ink); }
.chapter-list img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; filter: saturate(.7); transition: filter .3s ease; }
.chapter-list button:hover img { filter: saturate(1); }
.chapter-list span { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; font-size: 10px; }
.chapter-list small { color: var(--gold); font-size: 9px; }
.story-dialog { width: min(640px,calc(100vw - 40px)); }
.story-dialog > p:not(.dialog-caption) { font-size: 12px; line-height: 1.95; margin: 0 0 22px; max-width: 65ch; }
.story-dialog .story-signature { font-family: 'Cinzel',serif; font-size: 22px!important; line-height: 1.5!important; }
.story-more { color: var(--ink); font-size: 11px; text-underline-offset: 6px; }

/* Portrait has its own composition, retaining both figures in the frame. */
@media (max-width: 760px), (max-width: 900px) and (orientation: portrait) {
  :root { --rail: 24px; }
  body.page .hud-top { flex-direction: column; align-items: flex-start; padding-top: 25px; gap: 18px; }
  body.page .hud-nav { width: 100%; justify-content: space-between; gap: 10px; }
  body.page .hud-nav a { font-size: 8px; letter-spacing: .03em; min-height: 44px; display: inline-flex; align-items: center; }
  body.page .room-title { font-size: clamp(27px,7.4vw,43px); }
  body.page .room { padding-top: 70px; padding-bottom: 70px; }
  body.page .doorroom h2 { letter-spacing: .04em; }
  #door { background: #e9eff6; }
  #door .door-mast { top: 30px; font-size: 13px; letter-spacing: .15em; }
  .door-nav { top: 18px; gap: 0; }
  .door-nav a { display: none; }
  .door-nav button { font-size: 10px; }
  .door-landscape {
    inset: 30% 0 auto; height: 36%;
    background-size: auto 100%; background-position: center;
    mask-image: linear-gradient(transparent, #000 16%, #000 77%, transparent);
  }
  .door-landscape::after { background: rgba(224,236,251,.12); }
  #door-ambient { object-position: center; }
  #ambient-toggle { bottom: 8px; font-size: 8px; }
  .door-heading { top: 14%; width: calc(100% - 40px); }
  .door-prologue { font-size: 9px; margin-bottom: 17px; }
  #door-title { font-size: clamp(34px,9.5vw,54px); line-height: 1.08; }
  #door .door-tag { display: block; top: 63%; }
  #door .door-tag i { font-size: 8px; }
  #door .door-tag b { display: none; }
  #door .door-act { bottom: 9%; }
  #door .door-act .door-thesis { font-size: 11px; margin-bottom: 16px; max-width: 33ch; }
  .wide-only { display: none; }
  #door-play .play-copy b { font-size: 11px; }
  #door-play .play-copy i { font-size: 7px; }
  #door-play svg { width: 38px; height: 38px; }
  .story-link { margin-top: 5px; }
  .door-foot { left: auto; right: var(--rail); bottom: 18px; transform: none; flex-direction: row; gap: 9px; font-size: 8px; }
  .scroll-stroke { height: 22px; }
  .door-edition { display: none; }
  #hud .hud-top { padding-top: 18px; }
  #hud .hud-mark { font-size: 11px; }
  #hud .hud-nav a { display: none; }
  #hud-join { font-size: 10px; }
  .transport { left: var(--rail); transform: none; gap: 12px; }
  .transport button { font-size: 9px; }
  .hud-dist { display: none; }
  #hud-sound { font-size: 9px; }
  #film-seek { bottom: 0; }
  .card { left: 26px; right: 26px; bottom: 128px; width: auto; padding: 0; background: none; }
  .card b { font-size: 20px; }
  .card em { font-size: 11px; margin-top: 8px; }
  .card i { margin-bottom: 9px; font-size: 8px; }
  .slip { top: 30vh; width: calc(100% - 40px); }
  .slip b { font-size: 14px; }
  .slip i, .slip em { font-size: 8px; line-height: 1.65; letter-spacing: .07em; }
  #seal .seal-head { margin-top: 13vh; }
  #seal .seal-landscape img { position: absolute; top: 30%; left: 0; height: 38%; object-position: center; mask-image: linear-gradient(transparent, #000 16%, #000 77%, transparent); }
  #seal .seal-count { font-size: 38px; }
  #seal .seal-kicker { font-size: 8px; margin-bottom: 16px; }
  #seal .seal-act { margin-bottom: max(16px,env(safe-area-inset-bottom)); }
  #seal .seal-line { font-size: 11px; margin-bottom: 16px; }
  #seal .seal-tag { display: none; }
  #claim-form { gap: 10px; }
  #seal #claim-seal { min-height: 46px; font-size: 10px; }
  #seal .seal-demo { margin-top: 16px; font-size: 8px; }
  #seal .seal-legal { margin-top: 10px; }
  .film-dialog { padding: 44px 24px 28px; }
  .chapter-list { grid-template-columns: repeat(2,1fr); gap: 20px 14px; }
  .chapter-list span { font-size: 9px; gap: 5px; }
}
@media (max-height: 650px) and (min-width: 761px) {
  .door-heading { top: 18%; }
  #door-title { font-size: 46px; }
  .door-prologue { margin-bottom: 12px; }
  #door .door-act { bottom: 7%; }
  #door .door-act .door-thesis { margin-bottom: 12px; }
  .door-foot { bottom: 20px; }
  #seal { overflow-y: auto; }
  #seal .seal-head { margin-top: 100px; }
  #seal .seal-act { margin-top: 34px; margin-bottom: 22px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .door-prologue { display: none; }
  #door .door-act .door-thesis { font-size: 10px; max-width: 36ch; }
  #door .door-act { bottom: 7%; }
  #door .story-link { display: none; }
  #seal { overflow-y: auto; }
  #seal .seal-head { margin-top: 90px; }
  #seal .seal-act { margin-top: 130px; padding-bottom: 15px; }
}
@media (min-width: 761px) and (max-height: 500px) {
  .door-prologue { display: none; }
  #door-title { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none!important; transition: none!important; }
  .door-life, .door-snow { display: none; }
  .door-landscape { transform: none; }
  .scroll-stroke::after { transform: none; }
}
/* The optional film always has a visible route back to the company. */
@media(max-width:760px),(max-width:900px) and (orientation:portrait){#hud .hud-nav{gap:18px}#hud .hud-nav a{display:inline-flex;align-items:center;font-size:9px;min-height:44px}}
