/* One More Minute · page styles (stations). Only inside <main class="omm-page">; head, foot and tokens come
   from the frame. Design rules of the game: bone white #cfc6b4, never pure white; titles stand in the dark, never on the
   island of light; world black is tinted, never flat #000 for surfaces (the very first frame is the hand-off black).
   Every station is one screen in the cinematic version; in the calm version the page scrolls natively. */

:root {
  --omm-rail-w: 0px;
  --omm-ink: var(--omm-bone);
  --omm-ink-dim: rgba(207, 198, 180, .82);
  --omm-ink-faint: rgba(207, 198, 180, .8);
  --omm-ease: var(--ease-out);
  --omm-pad: clamp(18px, 4.2vw, 72px);
}

html[data-world="omm"], html[data-world="omm"] body { background: var(--omm-handoff); }
html[data-world="omm"] body { margin: 0; }
/* very large screens (a 4K monitor at 100 %): the whole page grows with the width instead of floating small in the middle */
@media (min-width: 2200px) { html[data-world="omm"] { font-size: calc(100vw / 137.5); } }
.omm-page { position: relative; color: var(--omm-ink); font: 400 1rem/1.6 var(--font-omm-text); }
.omm-page h1, .omm-page h2, .omm-page h3, .omm-page p, .omm-page ol, .omm-page ul, .omm-page dl, .omm-page dd, .omm-page figure { margin: 0; padding: 0; }
.omm-page img { display: block; max-width: 100%; height: auto; }
.omm-page a { color: inherit; }
.omm-page .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- type */
.omm-label { display: block; font: 500 .72rem/1.2 var(--font-brand); letter-spacing: .32em; text-transform: uppercase; color: var(--omm-ink-faint); }
.omm-big { font: 300 clamp(2.1rem, 4.6vw, 4.6rem)/1.05 var(--font-omm-title); letter-spacing: .01em; color: var(--omm-ink); text-wrap: balance; }
.omm-big--quiet { font-style: italic; font-size: clamp(1.7rem, 3.4vw, 3.2rem); }
.omm-head { font: 500 clamp(1.7rem, 3.1vw, 2.9rem)/1.1 var(--font-omm-title); color: var(--omm-ink); }
.omm-head--italic { font-style: italic; font-weight: 400; }
.omm-body { font: 400 clamp(1rem, 1.12vw, 1.12rem)/1.6 var(--font-omm-text); color: var(--omm-ink-dim); max-width: 34rem; }
.omm-body--italic { font-family: var(--font-omm-title); font-style: italic; font-size: clamp(1.1rem, 1.35vw, 1.3rem); }
.omm-sub { font: italic 400 clamp(1.25rem, 2vw, 1.85rem)/1.4 var(--font-omm-title); color: var(--omm-ink); max-width: 46rem; text-align: center; text-wrap: balance; }
.omm-status { font: 500 .74rem/1.5 var(--font-brand); letter-spacing: .24em; text-transform: uppercase; color: var(--omm-ink-faint); }
.omm-chapter { display: flex; flex-direction: column; gap: .7rem; }
.omm-chapter__name { font: 300 clamp(2.4rem, 5.6vw, 5.4rem)/1 var(--font-omm-title); letter-spacing: .12em; text-transform: uppercase; color: var(--omm-ink); }
.omm-h2 { font: 400 clamp(2rem, 3.4vw, 3.2rem)/1.1 var(--font-omm-title); letter-spacing: .06em; color: var(--omm-ink); }
.omm-h2--small { font-size: clamp(1.4rem, 2.2vw, 2.1rem); letter-spacing: .14em; }

/* ---------------------------------------------------------------- skip link, chapter rail */
.omm-skip { position: fixed; left: 16px; top: -80px; z-index: calc(var(--z-head) + 11); padding: 14px 16px; background: var(--omm-ink); color: #111; text-decoration: none;
  font: 600 12px/1 var(--font-brand); letter-spacing: .16em; text-transform: uppercase; }
.omm-skip:focus { top: 60px; }
.omm-rail { position: fixed; z-index: 6; right: clamp(8px, 1.2vw, 20px); top: 50%; transform: translateY(-50%);
  padding: 8px 12px 8px 16px; border-radius: 3px; background: rgba(4, 4, 3, .96); box-shadow: 0 0 30px 14px rgba(4, 4, 3, .6); }
.omm-rail ol { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.omm-rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 30px; padding: 0; text-decoration: none;
  font: 500 .78rem/1 var(--font-brand); letter-spacing: .2em; text-transform: uppercase; color: rgba(207, 198, 180, .96); text-shadow: 0 0 6px rgba(0, 0, 0, .9); }
.omm-rail a::after { content: ""; width: 14px; height: 1px; background: currentColor; }
.omm-rail a:hover, .omm-rail a:focus-visible, .omm-rail a[aria-current] { color: #d8cfc0; }
.omm-rail a[aria-current]::after { width: 26px; }
@media (max-width: 900px) { .omm-rail { display: none; } }
@media (pointer: coarse) { .omm-rail a { min-height: 44px; } }   /* a tablet sees the rail: finger-sized rows */
@media (min-width: 901px) { :root { --omm-rail-w: 9.4rem; } }   /* text on the right keeps clear of the rail */

/* ---------------------------------------------------------------- shared pieces */
.omm-back { display: inline-flex; align-items: center; gap: .9em; min-height: 44px; padding: 0; text-decoration: none;
  font: 600 .78rem/1 var(--font-brand); letter-spacing: .26em; text-transform: uppercase; color: var(--omm-ink); }
.omm-back::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .7; transition: width .5s var(--omm-ease); }
.omm-back:hover::before, .omm-back:focus-visible::before { width: 56px; }
.omm-ways { display: flex; flex-direction: column; align-items: flex-start; }

.omm-lead { margin-top: 1rem; max-width: 46rem; font: italic 400 clamp(1.15rem, 1.6vw, 1.55rem)/1.45 var(--font-omm-title); color: var(--omm-ink-dim); margin-left: auto; margin-right: auto; text-align: center; }
.omm-game .omm-h2, .omm-gallery .omm-h2, .omm-gallery .omm-note { text-align: center; }
.omm-features { list-style: none; margin-top: clamp(28px, 4.5vh, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3.5vh, 48px) clamp(36px, 6vw, 96px); counter-reset: f; }
.omm-feature { counter-increment: f; padding-top: 1.1rem; border-top: 1px solid rgba(207, 198, 180, .16); }
.omm-feature::before { content: counter(f, decimal-leading-zero); display: block; margin-bottom: .7rem; font: 500 .7rem/1 var(--font-brand); letter-spacing: .3em; color: var(--omm-ink-faint); }
.omm-feature h3 { font: 500 clamp(1.3rem, 1.8vw, 1.75rem)/1.2 var(--font-omm-title); color: var(--omm-ink); }
.omm-feature p { margin-top: .5rem; color: var(--omm-ink-dim); max-width: 36rem; }

.omm-gallery { text-align: center; background: radial-gradient(70% 55% at 50% 45%, #15130d, var(--omm-world) 72%); }
.omm-note { margin-top: .5rem; font: 500 .74rem/1.4 var(--font-brand); letter-spacing: .26em; text-transform: uppercase; color: var(--omm-ink-faint); }
.omm-page .omm-thumbs { list-style: none; margin: clamp(18px, 3vh, 40px) auto 0; text-align: left; display: grid; gap: clamp(10px, 1.2vw, 16px); }
/* the house: 8 pictures, 4 x 2; the ship: 6 pictures, 3 x 2. Both always fit one screen (width follows the height) */
.omm-page .omm-thumbs--house { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 97.5rem, calc((100vh - 18.75rem) * 3.4)); width: min(100%, 97.5rem, calc((100svh - 18.75rem) * 3.4)); }
.omm-page .omm-thumbs--ship { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 87.5rem, calc((100vh - 18.75rem) * 2.5)); width: min(100%, 87.5rem, calc((100svh - 18.75rem) * 2.5)); }
.omm-thumb__link { position: relative; display: block; overflow: hidden; text-decoration: none; background: #000; }
.omm-thumb__link img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .88; transition: opacity .5s ease, transform 1.2s var(--omm-ease); }
.omm-thumb__link:hover img, .omm-thumb__link:focus-visible img { opacity: 1; transform: scale(1.03); }
.omm-thumb__cap { display: block; padding: .5rem 0 .15rem; background: var(--omm-world); font: 500 .64rem/1.3 var(--font-brand); letter-spacing: .2em; text-transform: uppercase; color: var(--omm-ink-faint); }

.omm-lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(2, 2, 1, .96); color: var(--omm-ink); }
.omm-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.omm-lightbox[open] { display: grid; place-items: center; }
.omm-lightbox__fig { width: min(92vw, 160vh); }
.omm-lightbox__img { width: 100%; height: auto; }
.omm-lightbox__cap { padding: .8rem 0; font: 500 .7rem/1.4 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; color: var(--omm-ink-dim); }
.omm-lightbox__btn { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: var(--omm-ink);
  border: 1px solid rgba(207, 198, 180, .25); border-radius: 50%; font: 300 1.5rem/1 var(--font-omm-title); cursor: pointer; }
.omm-lightbox__prev { left: 2vw; }
.omm-lightbox__next { right: 2vw; }
.omm-lightbox__close { top: 28px; right: 2vw; margin-top: 0; }
.omm-lightbox__btn:hover { background: rgba(207, 198, 180, .14); }

.omm-factcols { margin-top: clamp(20px, 3.5vh, 44px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(28px, 5vw, 80px); align-items: start; }
.omm-fact { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid rgba(207, 198, 180, .13); }
.omm-fact dt { font: 500 .7rem/1.6 var(--font-brand); letter-spacing: .22em; text-transform: uppercase; color: var(--omm-ink-faint); padding-top: .2rem; }
.omm-fact dd { color: var(--omm-ink-dim); }

/* ================================================================ calm version (default: reduced motion, no WebGL, no JS)
   a still-image essay, scrolled natively */
.omm-stage { display: none; }
.omm-curtain { position: fixed; inset: 0; z-index: 7; background: var(--omm-handoff); pointer-events: none; animation: omm-lift 1.1s ease .25s forwards; }
@keyframes omm-lift { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .omm-curtain { display: none; } }

.omm-st { position: relative; background: var(--omm-world); }
.omm-still img { width: 100%; height: auto; max-height: 88vh; object-fit: cover; }
.omm-still--hero img { width: 100%; height: 100vh; height: 100svh; max-height: none; object-fit: cover; object-position: 46% 40%; }
.omm-text { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1rem; margin: 0 auto; max-width: 52rem;
  padding: clamp(24px, 4vw, 52px) var(--omm-pad) clamp(56px, 8vw, 110px); text-align: center; }
.omm-st--card .omm-text { padding-top: clamp(80px, 12vw, 160px); }
.omm-knocks { display: flex; flex-wrap: wrap; gap: .4em .9em; justify-content: center; margin: 0 auto; padding: 1.4rem var(--omm-pad) 0; max-width: 52rem;
  font: 400 clamp(1.1rem, 2.4vw, 2.2rem)/1 var(--font-omm-title); letter-spacing: .3em; color: var(--omm-ink-faint); }
.omm-hero { position: absolute; z-index: 2; right: var(--omm-pad); bottom: clamp(56px, 12vh, 140px); width: min(34vw, 560px); padding: 0; margin: 0; max-width: none;
  align-items: flex-start; text-align: left; gap: .9rem; text-shadow: 0 0 22px rgba(0, 0, 0, .7); }
.omm-hero__title { width: 100%; }
.omm-hero__logo { width: 100%; height: auto; }
.omm-hero__tag { font: italic 400 clamp(1.25rem, 1.9vw, 1.8rem)/1.3 var(--font-omm-title); color: var(--omm-ink); margin-top: .5rem; }
.omm-cue { display: none; }
.omm-plain { position: relative; z-index: 3; background: var(--omm-world); padding: clamp(64px, 9vw, 130px) var(--omm-pad); }
.omm-plain__in { max-width: 97.5rem; margin: 0 auto; }
.omm-outro .omm-ways { align-items: center; }

@media (max-width: 700px) {
  .omm-features, .omm-factcols { grid-template-columns: 1fr; }
  .omm-page .omm-thumbs--house, .omm-page .omm-thumbs--ship { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .omm-fact { grid-template-columns: minmax(6.5rem, 34%) 1fr; gap: .8rem; padding: .45rem 0; font-size: .9rem; line-height: 1.35; }
  .omm-fact dt { font-size: .62rem; letter-spacing: .16em; }
  .omm-hero { left: var(--omm-pad); right: var(--omm-pad); width: auto; bottom: 9svh; align-items: center; text-align: center; }
  .omm-hero__logo { width: min(78vw, 360px); margin: 0 auto; }
  .omm-lightbox__btn { top: auto; bottom: 24px; margin-top: 0; }
  .omm-lightbox__close { top: 18px; bottom: auto; }
  .omm-feature p { font-size: .94rem; line-height: 1.5; }
  .omm-thumb__cap { font-size: .66rem; letter-spacing: .1em; }
}
@media (max-aspect-ratio: 4/5) { .omm-still--hero img { object-position: 50% 40%; } }

/* ================================================================ cinematic version: one screen per station */
html.omm-cine .omm-stage { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
html.omm-cine .omm-curtain { animation: none; transition: opacity .6s ease; z-index: 0; }
html.omm-cine.omm-stage-on .omm-curtain { opacity: 0; }
html.omm-cine .omm-st { box-sizing: border-box; height: 100vh; height: 100svh; overflow: hidden; }
html.omm-cine .omm-film { background: transparent; z-index: 1; }
html.omm-cine .omm-still { display: none; }
html.omm-cine .omm-plain { display: flex; align-items: center; padding: calc(var(--head-h) + 2vh) var(--omm-pad) 3vh; }
html.omm-cine .omm-plain__in { width: 100%; }

/* text of a film station: placed in the dark part of its shot; it moves with its station and fades by distance */
html.omm-cine .omm-text { position: absolute; padding: 0; margin: 0; max-width: none; gap: 1rem; opacity: 0; will-change: opacity;
  text-shadow: 0 0 24px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .6); }
html.omm-cine .omm-text::before { content: ""; position: absolute; z-index: -1; inset: -22% -14%; pointer-events: none; opacity: var(--omm-ground, 0);
  background: radial-gradient(closest-side, rgba(3, 3, 2, .74), rgba(3, 3, 2, .5) 55%, rgba(3, 3, 2, 0)); }
html.omm-cine .omm-text:focus-within { opacity: 1 !important; }   /* a hidden block never hides keyboard focus */
html.omm-cine .omm-text .omm-status, html.omm-cine .omm-text .omm-label { color: rgba(207, 198, 180, .94); }
html.omm-cine .omm-text--right, html.omm-cine .omm-text--left, html.omm-cine .omm-text--topright, html.omm-cine .omm-text--clock { align-items: flex-start; text-align: left; }
html.omm-cine .omm-text--right { right: calc(var(--omm-pad) + var(--omm-rail-w)); bottom: 17vh; width: min(36rem, 38vw); }
html.omm-cine .omm-text--left { left: var(--omm-pad); bottom: 16vh; width: min(36rem, 40vw); }
html.omm-cine .omm-text--topright { right: calc(var(--omm-pad) + var(--omm-rail-w)); top: 18vh; width: min(36rem, 38vw); }
/* the LED sits in the left half of its picture: the words start right of it */
html.omm-cine .omm-text--clock { left: 54vw; right: calc(var(--omm-pad) + var(--omm-rail-w)); top: 30vh; width: auto; }
html.omm-cine .omm-text--low { left: 50%; bottom: 11vh; width: min(52rem, 86vw); transform: translateX(-50%); }
html.omm-cine .omm-text--center { left: 50%; top: 50%; width: min(52rem, 86vw); transform: translate(-50%, -50%); }
html.omm-cine .omm-outro .omm-text { opacity: 1; }
html.omm-cine .omm-outro .omm-text::before { opacity: 1; }
html.omm-cine .omm-outro .omm-ways { align-items: flex-start; }

/* KNOCK: hard on, quick decay, two soft echoes; no filters (a blur on huge type at DPR 2 costs a frame) */
html.omm-cine .omm-knocks { position: absolute; inset: 0; display: block; max-width: none; margin: 0; padding: 0; pointer-events: none; z-index: 2; }
html.omm-cine .omm-knock { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); opacity: .002; will-change: transform, opacity;
  font: 500 clamp(3.4rem, 10vw, 9.5rem)/1 var(--font-omm-title); letter-spacing: .32em; padding-left: .32em; color: var(--omm-ink); text-shadow: 0 0 12px rgba(0, 0, 0, .8); }
html.omm-cine .omm-knock::before, html.omm-cine .omm-knock::after { content: attr(data-t); position: absolute; inset: 0; padding-left: .32em; opacity: .16; }
html.omm-cine .omm-knock::before { transform: translate(-2%, 1%) scale(1.04); }
html.omm-cine .omm-knock::after { transform: translate(2%, -1%) scale(1.08); opacity: .09; }
html.omm-cine .omm-knock.is-hit { animation: omm-knock 1.1s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes omm-knock { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 18% { opacity: .95; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.985); } }

/* hero: appears after the bulb; it moves away with its station */
html.omm-cine .omm-text--hero { right: calc(var(--omm-pad) + var(--omm-rail-w)); bottom: 16vh; left: auto; width: min(32vw, 35rem); }
/* starts at a trace of opacity, not 0: the title is painted with the first frame (in the dark, under the curtain),
   so the browser counts it as the largest content right away, then it rises with the bulb */
html.omm-cine .omm-hero > * { opacity: .01; transform: translateY(10px); transition: opacity 1.4s ease, transform 1.8s var(--omm-ease); }
html.omm-cine.omm-ready .omm-hero > *, html.omm-cine.omm-copy-on .omm-hero > * { opacity: 1; transform: none; }
html.omm-cine.omm-ready .omm-hero > :nth-child(2), html.omm-cine.omm-copy-on .omm-hero > :nth-child(2) { transition-delay: .2s; }
html.omm-cine.omm-ready .omm-hero > :nth-child(3), html.omm-cine.omm-copy-on .omm-hero > :nth-child(3) { transition-delay: .4s; }
html.omm-cine .omm-cue { display: flex; position: absolute; z-index: 2; left: 50%; bottom: max(3.5vh, env(safe-area-inset-bottom)); transform: translateX(-50%); flex-direction: column; align-items: center; gap: 12px;
  font: 500 .66rem/1 var(--font-brand); letter-spacing: .32em; text-transform: uppercase; color: var(--omm-ink-faint); opacity: 0; }
html.omm-cine .omm-cue::after { content: ""; width: 1px; height: 40px; background: linear-gradient(rgba(207, 198, 180, .5), rgba(207, 198, 180, 0)); }
html.omm-cine.omm-ready .omm-cue span { animation: omm-in 1.4s ease 1.6s both; }
@keyframes omm-in { from { opacity: 0; } to { opacity: 1; } }
html.omm-cine.omm-ready .omm-cue { opacity: 1; }
html.omm-cine .omm-cue span { opacity: 0; }

/* WebGL lost while stepping: every station shows its still, the words stay */
html.omm-cine.omm-stills .omm-stage { display: none; }
html.omm-cine.omm-stills .omm-still { display: block; position: absolute; inset: 0; z-index: -2; }
html.omm-cine.omm-stills .omm-still img, html.omm-cine.omm-stills .omm-still picture { width: 100%; height: 100%; max-height: none; object-fit: cover; }
html.omm-cine.omm-stills .omm-text { opacity: 1; }
html.omm-cine.omm-stills .omm-text::before { opacity: 1; }

@media (max-width: 700px), (max-aspect-ratio: 4/5) {
  html.omm-cine .omm-film::after { content: ""; position: absolute; inset: 42% 0 0 0; z-index: -1; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .78)); }
  html.omm-cine .omm-st--card::after { display: none; }
  html.omm-cine .omm-text--right, html.omm-cine .omm-text--left, html.omm-cine .omm-text--topright, html.omm-cine .omm-text--clock, html.omm-cine .omm-text--hero {
    left: var(--omm-pad); right: var(--omm-pad); width: auto; top: auto; bottom: 12svh; align-items: center; text-align: center; }
  html.omm-cine .omm-text--low { bottom: 12svh; }
  html.omm-cine .omm-text--hero { bottom: 15svh; }
  html.omm-cine .omm-body { margin: 0 auto; }
  html.omm-cine .omm-outro .omm-ways { align-items: center; }
  .omm-chapter { align-items: center; }
  html.omm-cine .omm-plain { padding: calc(var(--head-h) + 12px) var(--omm-pad) 12px; }
  html.omm-cine .omm-features { gap: 14px; margin-top: 16px; }
  html.omm-cine .omm-feature { padding-top: .7rem; }
  html.omm-cine .omm-feature::before { margin-bottom: .4rem; }
  html.omm-cine .omm-feature h3 { font-size: 1.2rem; }
  html.omm-cine .omm-feature p { font-size: .9rem; line-height: 1.42; margin-top: .3rem; }
  html.omm-cine .omm-lead { font-size: 1.08rem; margin-top: .6rem; }
  html.omm-cine .omm-h2 { font-size: 1.9rem; }
  html.omm-cine .omm-fact { padding: .38rem 0; font-size: .86rem; line-height: 1.3; }
}
