/* Home: hero (who he is, beside his workroom; the flight into its monitor), the pinned Frame and its ten stops, the villages (full-bleed
   live scenes), contact. Each stop and each village carries its own colours (--fg / --bg / --ac, set once at
   render); the top bar takes the colours of the world on show; the hero is always its own night.
   Scroll only moves things (the page, the 3D scenes, the captions' ride); whatever appears or disappears does so
   with a short timed fade started by a class, never with a scroll-linked opacity. */

#shell { --fg: #16150f; --bg: #f2efe8; --ac: #16150f; --mute: color-mix(in oklab, var(--fg) 70%, var(--bg)); --hair: color-mix(in oklab, var(--fg) 18%, transparent); position: relative; color: var(--fg); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Ground */
body { background: none; }
.amb { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #f2efe8; }
.amb i { position: absolute; inset-block-start: 0; left: 0; width: 40vmax; height: 40vmax; margin: -20vmax 0 0 -20vmax; border-radius: 50%; transform: scale(0); will-change: transform; }
/* No z-index here on purpose: a village's sheet lives inside the list and must stack above the fixed Frame (z 3). */
#home { position: relative; }

/* Top bar */
.top { position: fixed; z-index: 20; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) clamp(14px, 3vw, 30px) 10px; pointer-events: none; }
.top, .hero, .frame { --mute: color-mix(in oklab, var(--fg) 70%, var(--bg)); --hair: color-mix(in oklab, var(--fg) 18%, transparent); color: var(--fg); transition: color 0.45s; }
.top > * { pointer-events: auto; }
/* On paper (hero, contact) content scrolls under the bar, so it gets a solid strip there. */
.top::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bg); opacity: 0; transition: opacity 0.4s, background-color 0.45s; }
#shell[data-zone='hero'] .top::before, #shell[data-zone='contact'] .top::before, #shell[data-zone='cards'] .top::before { opacity: 1; }
/* ...but never while a village's sheet is still under the bar (it is leaving; js/home.js applyTone). */
#shell[data-bar-sheet] .top::before { opacity: 0; }
.top__name { font-size: 1rem; font-weight: 750; letter-spacing: -0.01em; text-decoration: none; padding: 10px 0; transition: opacity 0.3s linear, visibility 0s; }
/* In the hero his name stands beside his portrait, so the bar does not repeat it. */
.top.is-bare .top__name { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s linear, visibility 0s 0.2s; }
html[lang='fa'] .top__name { letter-spacing: 0; font-weight: 800; }
#shell .lang__btn[aria-pressed='true'] { background: var(--fg); color: var(--bg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px; font-size: 1rem; font-weight: 650; line-height: 1.1; text-decoration: none; color: var(--fg); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--fg) 34%, transparent); transition: transform 0.16s var(--ease-out), background-color 0.45s, color 0.45s; }
.btn--solid { background: var(--fg); color: var(--bg); box-shadow: none; }
.btn:active { transform: scale(0.96); }
/* A solid button's text has the ground's colour, so its focus ring is drawn in the ink instead. */
.btn--solid:focus-visible { outline-color: var(--fg); }
.btn svg { flex: none; transition: transform 0.35s var(--ease-out); }
@media (hover: hover) { .btn:hover svg { transform: translate3d(3px, 0, 0); } .hero .btn--solid:hover svg { transform: translate3d(0, 3px, 0); } }
[dir='rtl'] .stop__go svg, [dir='rtl'] .reach svg { transform: scaleX(-1); }
@media (hover: hover) { [dir='rtl'] .stop__go:hover svg { transform: scaleX(-1) translate3d(3px, 0, 0); } }

/* Hero: his workroom at night (js/fx/room.js). A dark sheet over the page, above the Frame: its colour is the room
   video's own black, so the picture has no edge. The section is taller than the screen and its content is pinned:
   a small scroll past the top sends the camera into the room's monitor in one timed flight (not scrubbed), the
   film rests there for the rest of the pin (85svh: enough to absorb the scroll made during the flight and to read
   the play control), and then the whole sheet scrolls away as one piece. Name and role, the headline, the sub line and the two buttons stand around the room: above it
   on a phone (the buttons under it), on the start side on a wide screen. */
.hero { --night: #030304; --fg: #f3f0e9; --bg: var(--night); --mute: color-mix(in oklab, var(--fg) 62%, var(--bg)); position: relative; z-index: 4; height: 185svh; background: var(--night); color: var(--fg); }
.hero__pin { position: sticky; inset-block-start: 0; height: 100svh; overflow: clip; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; row-gap: 2px; padding: calc(64px + env(safe-area-inset-top, 0px)) var(--gutter) calc(16px + env(safe-area-inset-bottom, 0px)); }
/* The room's slot: the frame is sized so that the room itself (the lit part of the picture: --lw / --lh of the
   frame, centred at --lcx / --lcy; set from js/fx/room.js) fills the slot; the black rest of the frame overflows. */
.hero__slot { grid-row: 2; grid-column: 1; position: relative; z-index: 0; min-height: 0; margin-inline: calc(-1 * var(--gutter)); container-type: size; }
.hero__room { --w: min(97cqw / var(--lw, 0.64), 100cqh / var(--lh, 0.94) * var(--rar, 1.583)); position: absolute; left: calc(50cqw - var(--w) * var(--lcx, 0.5)); top: calc(50cqh - var(--w) / var(--rar, 1.583) * var(--lcy, 0.5)); width: var(--w); height: calc(var(--w) / var(--rar, 1.583)); transform-origin: 0 0; will-change: transform; transition: opacity 0.4s linear, visibility 0s; }
.hero__room > * { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; object-fit: cover; }
/* Right-to-left: the picture is drawn mirrored so the room opens toward the copy (FLIP_RTL in js/fx/room.js). */
.hero__room.is-flipped > img, .hero__room.is-flipped > video { transform: scaleX(-1); }
.hero__loop { opacity: 0; }
.hero__room.is-live .hero__loop { opacity: 1; }
/* The frame's edges melt into the ground (the picture's black is not perfectly even at its border). */
.hero__room::after { content: ''; position: absolute; inset: -1px; pointer-events: none; background: linear-gradient(to right, var(--night) 0.5%, transparent 9%, transparent 91%, var(--night) 99.5%), linear-gradient(to bottom, var(--night) 0.4%, transparent 3%, transparent 97%, var(--night) 99.6%); }
/* Deep in the flight the room goes dark, on every screen: enlarged that far it is soft, and nothing soft may be
   left standing around the film. On a tall screen the film is then a sharp band on the night ground (a faint glow
   behind it, the phrase above, the play control below); on a wide one it takes the whole screen. */
.hero.is-deep .hero__room { opacity: 0; visibility: hidden; transition: opacity 0.32s linear, visibility 0s 0.32s; }

.hero__head { grid-row: 1; grid-column: 1; position: relative; z-index: 2; display: grid; gap: 10px; }
.hero__me { margin: 0 0 2px; display: grid; gap: 1px; font-size: 0.875rem; line-height: 1.35; color: var(--mute); }
.hero__me b { font-size: 1.0625rem; font-weight: 750; letter-spacing: -0.01em; color: var(--fg); }
html[lang='fa'] .hero__me b { letter-spacing: 0; font-weight: 800; }
.hero__title { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 9.6vw, 4.2rem); font-weight: 650; letter-spacing: -0.05em; line-height: 1; text-wrap: balance; max-width: 11em; }
html[lang='ru'] .hero__title { font-size: clamp(1.6rem, 7.5vw, 3.4rem); line-height: 1.05; max-width: 13em; }
html[lang='fa'] .hero__title { font-size: clamp(2.1rem, 9.4vw, 4.4rem); font-weight: 900; letter-spacing: 0; line-height: 1.24; max-width: 12em; }
.hero__sub { margin: 0; font-size: clamp(0.9375rem, 0.5vw + 0.86rem, 1.2rem); line-height: 1.4; color: var(--mute); max-width: 34em; text-wrap: pretty; }
html[lang='fa'] .hero__sub { line-height: 1.75; }
/* One way on: the journey (scroll into the work), a filled button whose arrow points down and nudges now and then.
   Talking to him right away is offered beside it as a quiet text link, not a second button. */
.hero__acts { grid-row: 3; grid-column: 1; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.hero__go { min-height: 54px; padding-inline: 24px 20px; font-size: 1.0625rem; }
.hero__go svg { animation: hero-nudge 2.6s var(--ease-out) 1.6s infinite; }
@keyframes hero-nudge { 0%, 62%, 100% { transform: none; } 74% { transform: translate3d(0, 4px, 0); } 86% { transform: translate3d(0, -1px, 0); } }
@media (hover: hover) { .hero__go:hover svg { animation: none; } }
.hero__talk { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; color: var(--mute); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--fg) 30%, transparent); text-decoration-thickness: 1px; text-underline-offset: 0.3em; transition: color 0.2s, text-decoration-color 0.2s; }
@media (hover: hover) { .hero__talk:hover { color: var(--fg); text-decoration-color: currentColor; } }
.hero__talk:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
/* What the scroll does next, said once, under the room. */
.hero__cue { grid-row: 2; grid-column: 1; align-self: end; justify-self: center; position: relative; z-index: 2; margin: 0 0 4px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; line-height: 1.3; color: var(--mute); }
.hero__cue svg { width: 15px; height: 15px; flex: none; }
/* The copy steps aside when the dive begins (a timed fade, class is-diving). */
.hero__head, .hero__acts, .hero__cue { transition: opacity 0.3s linear, transform 0.5s var(--ease-out), visibility 0s; }
.hero.is-diving .hero__head, .hero.is-diving .hero__acts, .hero.is-diving .hero__cue { opacity: 0; visibility: hidden; transform: translate3d(0, -12px, 0); transition: opacity 0.18s linear, transform 0.18s linear, visibility 0s 0.18s; }

/* The film's frame: laid out at its final place and size (the largest 16:9 that fits the screen), shrunk onto the
   room's monitor by js until the dive brings it here. It appears on the monitor part of the way in (class is-in). */
.hero__reel { --fw: min(100cqw, 100cqh * 16 / 9); position: absolute; inset: 0; z-index: 1; pointer-events: none; container-type: size; }
.hero__screen { position: absolute; left: calc(50% - var(--fw) / 2); top: calc(50% - var(--fw) * 9 / 32); width: var(--fw); height: calc(var(--fw) * 9 / 16); overflow: hidden; background: #000; transform-origin: 0 0; will-change: transform; opacity: 0; visibility: hidden; transition: opacity 0.35s linear, visibility 0s 0.35s; }
.hero.is-in .hero__screen { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.28s linear, visibility 0s; }
/* Landed: the screen glows a little on the night ground (a pseudo-element, so the film's own box is not repainted). */
.hero__reel::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--fw) * 1.5); height: calc(var(--fw) * 1.1); margin: calc(var(--fw) * -0.55) 0 0 calc(var(--fw) * -0.75); background: radial-gradient(closest-side, rgb(96 132 255 / 0.16), rgb(96 132 255 / 0.05) 55%, transparent); opacity: 0; transition: opacity 0.6s linear; pointer-events: none; }
.hero.is-set .hero__reel::before { opacity: 1; }
.hero__glass { position: absolute; inset: 0; cursor: pointer; }
.hero__glass > * { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; object-fit: cover; }
.hero__glass video { opacity: 0; }
.hero__glass.is-live video { opacity: 1; }
.hero__glass::after { content: ''; position: absolute; inset: 0; background: var(--night); opacity: 0; transition: opacity 0.4s linear; }
.hero__phrase { position: absolute; inset-inline: var(--gutter); inset-block-end: calc(50% + var(--fw) * 9 / 32 + 22px); margin: 0; text-align: center; text-wrap: balance; font-family: var(--font-display); font-size: clamp(2.2rem, 12.5vw, 4.4rem); font-weight: 650; letter-spacing: -0.055em; line-height: 0.98; }
html[lang='fa'] .hero__phrase { letter-spacing: 0; font-weight: 900; line-height: 1.2; }
/* Tajik: Unbounded has no ғ қ ҳ ҷ ӣ ӯ (a stray fallback letter inside a headline looks wrong), so Tajik headlines
   are set in Golos Text, which has them all. Latin brand names keep Unbounded. */
html[lang='tg'] .hero__title, html[lang='tg'] .hero__phrase { font-family: var(--font); font-weight: 800; letter-spacing: -0.035em; line-height: 1.06; }
html[lang='tg'] .hero__title { max-width: 13em; }
.hero__play { position: absolute; inset-inline: 0; inset-block-start: calc(50% + var(--fw) * 9 / 32 + 22px); margin-inline: auto; width: max-content; max-width: calc(100% - 2 * var(--gutter)); display: grid; grid-template-columns: auto auto; align-items: center; gap: 1px 10px; min-height: 54px; padding: 7px 22px 7px 16px; border: 0; border-radius: 27px; background: var(--fg); color: var(--bg); font-size: 1rem; line-height: 1.15; text-align: start; cursor: pointer; }
[dir='rtl'] .hero__play { padding: 7px 16px 7px 22px; }
.hero__play svg { grid-row: 1 / span 2; }
.hero__play b { grid-column: 2; font-weight: 700; white-space: nowrap; }
.hero__play small { grid-column: 2; font-size: 0.8125rem; opacity: 0.72; white-space: nowrap; }
/* The phrase and the play control come in once the film has landed (class is-set) and leave while it plays. The
   control stays in the Tab order before that (focus brings the film on screen: js/fx/room.js), but a pointer cannot
   hit it. */
.hero__phrase, .hero__play { opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0); transition: opacity 0.18s linear, transform 0.18s linear, visibility 0s 0.18s; }
.hero__play { visibility: visible; pointer-events: none; transition: opacity 0.18s linear, transform 0.18s linear; }
.hero__play:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.hero.is-set .hero__phrase, .hero.is-set .hero__play { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity 0.3s linear, transform 0.55s var(--ease-out), visibility 0s; }
.hero.is-set .hero__play:active { transform: scale(0.96); transition: transform 0.16s var(--ease-out); }
/* The other way on from the landed film: "or keep scrolling", as visible as the play control but secondary (an
   outline, no fill). A link to the first signboard (js/home.js data-go). It comes and goes with the play control. */
.hero__skip { position: absolute; inset-inline: 0; inset-block-start: calc(50% + var(--fw) * 9 / 32 + 22px + 54px + 10px); margin-inline: auto; width: max-content; max-width: calc(100% - 2 * var(--gutter)); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 24px; font-size: 1rem; font-weight: 650; line-height: 1.15; text-decoration: none; color: var(--fg); background: color-mix(in oklab, var(--bg) 55%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--fg) 46%, transparent); opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0); transition: opacity 0.18s linear, transform 0.18s linear, visibility 0s 0.18s; }
.hero__skip svg { width: 18px; height: 18px; flex: none; transition: transform 0.35s var(--ease-out); }
.hero__skip:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.hero.is-set .hero__skip { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity 0.3s linear 0.08s, transform 0.55s var(--ease-out) 0.08s, visibility 0s; }
.hero.is-set .hero__skip:active { transform: scale(0.96); transition: transform 0.16s var(--ease-out); }
.hero.is-playing .hero__skip { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s linear, visibility 0s 0.2s; }
@media (hover: hover) { .hero.is-set .hero__skip:hover svg { transform: translate3d(0, 3px, 0); } }
.hero__film { position: absolute; inset: 0; z-index: 2; background: #000; opacity: 0; visibility: hidden; transition: opacity 0.3s linear, visibility 0s 0.3s; }
.hero.is-playing .hero__film { opacity: 1; visibility: visible; transition: opacity 0.3s linear, visibility 0s; }
.hero.is-playing .hero__phrase, .hero.is-playing .hero__play { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s linear, visibility 0s 0.2s; }
.hero__video { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; background: #000; }
.hero__close { position: absolute; z-index: 1; inset-block-start: 10px; inset-inline-end: 10px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / 0.6); color: #fff; cursor: pointer; }
/* ?monitor: the measured screen box drawn on the room at rest (to check MONITOR in js/fx/room.js). */
.hero.is-debug .hero__screen { outline: 6px solid #ff3bd4; outline-offset: -3px; background: none; }
.hero.is-debug .hero__glass { opacity: 0.25; }
/* A screen wider than it is tall: the film fills it, so the phrase and the control stand on the film. */
@media (min-aspect-ratio: 1/1) {
  .hero.is-set .hero__glass::after { opacity: 0.42; }
  .hero__phrase { inset-block: 0 auto; inset-block-start: calc(50% - 0.62em); font-size: min(clamp(3rem, 10.5vw, 9.5rem), 26svh); }
  html[lang='fa'] .hero__phrase { inset-block-start: calc(50% - 0.8em); }
  .hero__play { inset-block-start: calc(50% + min(9svh, 6vw) + 3.2rem); }
  .hero__skip { inset-block-start: calc(50% + min(9svh, 6vw) + 3.2rem + 54px + 10px); }
}

/* Phones: the two buttons share one row under the room (they only wrap when a language's labels cannot fit). */
@media (max-width: 899px) {
  .hero__acts .btn { flex: 1 1 auto; gap: 6px; padding-inline: clamp(9px, 2.8vw, 18px); font-size: clamp(0.875rem, 3.9vw, 1rem); white-space: nowrap; }
  .hero__acts .btn svg { width: 18px; height: 18px; }
}
@media (max-width: 380px) { html:is([lang='ru'], [lang='tg']) .hero__acts .btn svg { display: none; } }
/* Short phones: set tighter. */
@media (max-width: 899px) and (max-height: 760px) {
  .hero__pin { padding-block: calc(56px + env(safe-area-inset-top, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)); }
  .hero__head { gap: 6px; }
  .hero__me { font-size: 0.8125rem; }
  .hero__title { font-size: clamp(1.7rem, 8.4vw, 3.2rem); }
  html[lang='ru'] .hero__title { font-size: clamp(1.35rem, 6.9vw, 2.8rem); }
  html[lang='fa'] .hero__title { font-size: clamp(1.75rem, 8.2vw, 3.2rem); }
  .hero__sub { font-size: 0.875rem; line-height: 1.34; }
  html[lang='fa'] .hero__sub { line-height: 1.6; }
  .hero__acts .btn { min-height: 46px; }
  .hero__cue { display: none; }
}

/* The Frame (fixed; one 3D slab): the signboard beside each stop. It steps in when the hero is on its way out
   and steps aside for the contact section (a timed fade, class is-in). */
.frame { --frame-top: 8svh; position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.frame__box { position: absolute; inset-inline: 0; inset-block-start: var(--frame-top); height: 42svh; opacity: 0; transform: scale(0.94); transition: opacity 0.22s linear, transform 0.25s var(--ease-out); will-change: transform, opacity; }
.frame.is-in .frame__box { opacity: 1; transform: none; transition: opacity 0.35s linear, transform 0.7s var(--ease-out); }
.frame:not(.is-in) .frame__hit { pointer-events: none; visibility: hidden; }
.frame__stage { position: absolute; inset: 0; }
.frame__stage .gl-canvas, .frame__stage .gl-freeze { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.frame__stage .gl-canvas { opacity: 0; transition: opacity 0.4s linear; }
.frame__stage.is-live .gl-canvas { opacity: 1; }
/* The frame the slab was frozen on is hidden when it is not the world that has the page (js/home.js syncFrame). */
.frame.is-stale .frame__stage .gl-freeze { visibility: hidden; }
.frame__fallback, .frame__hit { position: absolute; inset: 0; margin: auto; width: 150px; height: 320px; }
.frame__fallback { overflow: hidden; background: #111; box-shadow: 0 0 0 5px #15151a, 0 26px 50px -22px rgb(0 0 0 / 0.5); transform: perspective(900px) rotateY(-16deg) rotateX(5deg) rotate(-2deg); transition: opacity 0.4s; }
.frame__fallback img { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame.is-3d .frame__fallback { opacity: 0; }
.frame__hit { padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; }
.frame__label { position: absolute; inset-inline: 0; inset-block-start: calc(var(--frame-top) + 42svh + 2px); margin: 0; display: grid; justify-items: center; gap: 1px; text-align: center; font-size: 0.875rem; line-height: 1.3; will-change: transform, opacity; }
.frame__label b { font-size: 1rem; font-weight: 750; }
.frame__label span { color: var(--mute); }
.frame .frame__label { display: none; }   /* the route map names the world in the hero; every stop has its own copy */

/* Stops */
.stops { list-style: none; margin: 0; padding: 0; }
.stop { --mute: color-mix(in oklab, var(--fg) 70%, var(--bg)); min-height: 88svh; padding: 0 var(--gutter); color: var(--fg); }
.stop--light { min-height: 76svh; }
/* Phones: the copy sticks 54svh down the screen, under the Frame. A sticky box cannot leave its container, so a
   signboard must be at least 54svh taller than its copy, or at its start (top edge at the top of the screen: where
   the page clicks into place, js/fx/snap.js) a long copy on a short phone would be pushed up over the Frame. This
   in-flow block after the copy guarantees that height; a signboard whose copy is shorter is unchanged. */
@media (max-width: 899px) { .stop--village::after { content: ''; display: block; height: 54svh; } }
/* A stop's copy comes in when its world takes the page and leaves when the next one does (class is-shown,
   js/home.js page): a timed fade, the one leaving first. */
.stop__copy { position: sticky; inset-block-start: 54svh; display: grid; justify-items: start; gap: 10px; padding-block: 6px 22px; opacity: 0; visibility: hidden; transform: translate3d(0, 14px, 0); transition: opacity 0.16s linear, transform 0.16s linear, visibility 0s 0.16s; }
.stop.is-shown .stop__copy { opacity: 1; visibility: visible; transform: none; transition: opacity 0.32s linear 0.12s, transform 0.6s var(--ease-out) 0.12s, visibility 0s 0.12s; }
.stop__group { margin: 0 0 4px; padding-block-end: 8px; font-size: 0.8125rem; font-weight: 650; color: var(--mute); border-block-end: 1px solid color-mix(in oklab, var(--fg) 22%, transparent); }
.stop__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.stop__n { font-variant-numeric: tabular-nums; color: var(--mute); }
.stop__title { margin: 0; font-family: var(--font-display); font-size: min(clamp(2rem, 9.4vw, 4.3rem), calc((100vw - 2 * var(--gutter)) / (var(--tl, 8) * 0.7))); font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
html[lang='fa'] .stop__title { font-size: clamp(2.5rem, 11.4vw, 5.2rem); letter-spacing: 0; line-height: 1.2; font-weight: 900; }
/* The title is the link to its world. It stays in the Tab order while its copy is faded out (focus brings the
   stop on screen: js/home.js), but a pointer cannot hit it then. */
.stop__title a { color: inherit; text-decoration: none; visibility: visible; }
.stop:not(.is-shown) .stop__title a { pointer-events: none; }
@media (hover: hover) { .stop__title a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; } }
.stop__line { margin: 2px 0 6px; font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.35rem); line-height: 1.38; max-width: 30em; color: var(--mute); text-wrap: pretty; }
html[lang='fa'] .stop__line { line-height: 1.75; }

/* A village's signpost has no button: its scene follows as the visitor scrolls. (The Frame above it still opens the world.) */
.stop__cue { margin: 6px 0 0; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 650; }
.stop__cue svg { width: 18px; height: 18px; flex: none; }
.vspace { list-style: none; pointer-events: none; display: flow-root; }

/* Villages: each one is a full-bleed sheet (scene, scrim, captions) inside its spacer, above the Frame. It is
   sticky: pulled up by its margin, it holds the screen from the moment the spacer comes near until the spacer's
   bottom edge reaches the bottom of the screen; from there the whole sheet scrolls up with the page as one piece
   (the browser moves it, in step with the scroll) and the next section follows right under it. It crossfades in
   (timed, class is-on) when its spacer crosses the entrance threshold (js/home.js sheet).
   The pull (78dvh) is more than the entrance threshold (72 % of the screen on phones, 50 % wide) and less than the
   height of the signboard above the spacer (88svh / 100svh): so the sheet is always pinned by the time it comes on,
   and it can never be on screen anywhere but over its own signboard and its own spacer, whatever the script does.
   While it fades out at the entrance threshold (scrolling back up) it is fixed to the screen (.is-leaving), so the
   fade happens in place even though the pull would let go of it a moment later. */
.vil { --mute: color-mix(in oklab, var(--fg) 74%, var(--bg)); --hair: color-mix(in oklab, var(--fg) 20%, transparent); --pad: var(--gutter); position: sticky; z-index: 4; inset-block-start: 0; height: 100vh; height: 100dvh; margin-block-start: -78vh; margin-block-start: -78dvh; overflow: hidden; opacity: 0; visibility: hidden; color: var(--fg); background: var(--bg); transition: opacity 0.42s linear, visibility 0s 0.42s; will-change: opacity; }
.vil.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.42s linear, visibility 0s; }
.vil.is-leaving { position: fixed; inset: 0; margin: 0; }
.vil__stage { position: absolute; inset: 0; background: var(--bg); touch-action: pan-y; }
.vil__stage .gl-canvas, .vil__stage .gl-freeze { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* The canvas is shown the moment it has drawn (no fade of its own): the veil above it does the crossfade. */
.vil__stage .gl-canvas { opacity: 0; }
.vil__stage.is-live .gl-canvas { opacity: 1; }
/* The veil: what the sheet shows while its stage has no picture of its own (js/home.js "Stills"): the world's
   ground colour and, where it matches the frame the scene will open with, the poster on it (.is-poster). It is on
   at once and leaves with a timed fade once the first live frame has been drawn: that is the poster -> live crossfade. */
.vil__veil { position: absolute; inset: 0; pointer-events: none; background: var(--bg); opacity: 0; visibility: hidden; transition: opacity 0.4s linear, visibility 0s 0.4s; }
.vil.is-veil .vil__veil { opacity: 1; visibility: visible; transition: none; }
.vil__veil::before { content: ''; position: absolute; inset: 0; background: var(--poster, none) center / cover no-repeat; opacity: 0; transition: opacity 0.3s linear; }
.vil.is-poster .vil__veil::before { opacity: 1; }
.vil__shade { position: absolute; inset: auto 0 0 0; height: 64%; pointer-events: none; will-change: transform; background: linear-gradient(to top, var(--bg) 10%, color-mix(in oklab, var(--bg) 84%, transparent) 46%, transparent); }
.vil__custom { position: absolute; inset: 0; pointer-events: none; }
.vil__beats { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.vil__beat { position: absolute; inset-inline: 0; inset-block-end: 0; display: grid; justify-items: start; gap: 10px; padding: 0 var(--pad) calc(30px + env(safe-area-inset-bottom, 0px)); opacity: 0; visibility: hidden; transform: translate3d(0, 14px, 0); transition: opacity 0.16s linear, transform 0.16s linear, visibility 0s 0.16s; }
/* One caption at a time: the one leaving fades out first, then the next comes in (timed, not scroll-linked). */
.vil__beat.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s linear 0.16s, transform 0.55s var(--ease-out) 0.16s, visibility 0s 0.16s; }
.vil__where { margin: 0; display: flex; align-items: baseline; gap: 12px; font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.vil__where b { font-weight: 760; }
.vil__where span { color: var(--mute); font-variant-numeric: tabular-nums; }
.vil__where i { font-style: normal; opacity: 0.7; }
.vil__beat h3 { margin: 0; font-size: clamp(1.5rem, 6.7vw, 2.6rem); font-weight: 760; letter-spacing: -0.032em; line-height: 1.08; max-width: 17em; text-wrap: balance; }
html:is([lang='ru'], [lang='tg']) .vil__beat h3 { font-size: clamp(1.35rem, 5.9vw, 2.4rem); line-height: 1.12; }
html[lang='fa'] .vil__beat h3 { letter-spacing: 0; line-height: 1.42; font-weight: 800; }
.vil__body { margin: 0; font-size: 1.0625rem; line-height: 1.45; color: var(--mute); max-width: 34em; text-wrap: pretty; }
html[lang='fa'] .vil__body { line-height: 1.8; }
.vil__try { margin: 4px 0 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--ac); font-size: 0.9375rem; font-weight: 650; line-height: 1.4; }
.vil__fork { gap: 12px; padding-block-end: calc(40px + env(safe-area-inset-bottom, 0px)); }
.vil__fork .btn { pointer-events: auto; margin-block-start: 4px; }
[dir='rtl'] .vil__fork .btn svg { transform: scaleX(-1); }
.vil__on { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; line-height: 1.35; color: var(--mute); }
.vil__on svg { width: 16px; height: 16px; flex: none; }
/* Short phones: the captions are set tighter so the scene keeps its share of the screen. */
@media (max-width: 899px) and (max-height: 760px) {
  .vil__beat { gap: 7px; padding-block-end: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .vil__beat h3 { font-size: clamp(1.3rem, 5.8vw, 2rem); }
  html:is([lang='ru'], [lang='tg']) .vil__beat h3 { font-size: clamp(1.2rem, 5.3vw, 1.9rem); }
  .vil__body { font-size: 0.9375rem; line-height: 1.38; }
  html[lang='fa'] .vil__body { line-height: 1.65; }
  .vil__fork { padding-block-end: calc(26px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 900px) {
  /* Wide screens: the captions sit bottom-start, so the ground also comes in from that side. */
  .vils .vil .vil__shade { inset: 0; height: auto; background: linear-gradient(to top, color-mix(in oklab, var(--bg) 92%, transparent), transparent 46%), linear-gradient(90deg, color-mix(in oklab, var(--bg) 94%, transparent) 8%, color-mix(in oklab, var(--bg) 70%, transparent) 30%, transparent 56%); }
  [dir='rtl'] .vils .vil .vil__shade { background: linear-gradient(to top, color-mix(in oklab, var(--bg) 92%, transparent), transparent 46%), linear-gradient(270deg, color-mix(in oklab, var(--bg) 94%, transparent) 8%, color-mix(in oklab, var(--bg) 70%, transparent) 30%, transparent 56%); }
  .vil__beat { padding-block-end: 8svh; max-width: min(50vw, 44rem); }
  .vil__beat h3 { font-size: clamp(2rem, 3vw, 3rem); }
}

/* Contact: a sheet of paper at the end of the page (opaque, so it reads on any world's ground as it scrolls in).
   The sheet begins a little below the section's top edge. */
.contact { --fg: #16150f; --bg: #f2efe8; --mute: color-mix(in oklab, var(--fg) 70%, var(--bg)); --hair: color-mix(in oklab, var(--fg) 18%, transparent); position: relative; padding: 14svh var(--gutter) 5svh; color: var(--fg); background: linear-gradient(to bottom, transparent 9svh, var(--bg) 9svh); }
.contact__top { display: grid; gap: 34px; }
.contact__title { margin: 0; font-size: clamp(2.1rem, 6vw, 4.6rem); font-weight: 800; letter-spacing: -0.036em; line-height: 1; max-width: 14em; text-wrap: balance; }
html[lang='fa'] .contact__title { letter-spacing: 0; line-height: 1.3; font-weight: 900; }
.contact__lede { margin: 20px 0 0; font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.3rem); line-height: 1.5; max-width: 38em; color: var(--mute); text-wrap: pretty; }
html[lang='fa'] .contact__lede { line-height: 1.85; }
.contact__quick { margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 12px; }
.contact__quick .btn { min-height: 52px; gap: 10px; }
@media (max-width: 599px) { .contact__quick .btn { flex: 1 1 100%; justify-content: space-between; } }
/* The owner's portrait. The panel carries his initials as a mark only when no photograph is set. */
.me { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: end; gap: 16px; }
.me__pic { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 14px; background: var(--fg); color: var(--bg); }
.me__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; display: block; }
.me__mono { position: absolute; inset-inline-start: 9%; inset-block-end: 6%; font-family: var(--font-display); font-size: 2.6rem; font-weight: 650; letter-spacing: -0.06em; line-height: 0.82; }
html[lang='fa'] .me__mono { letter-spacing: 0; font-weight: 900; line-height: 1.1; inset-block-end: 4%; }
.me figcaption { display: grid; gap: 2px; padding-block-end: 4px; font-size: 0.9375rem; line-height: 1.4; color: var(--mute); }
.me figcaption b { font-size: 1.0625rem; font-weight: 720; color: var(--fg); }
.contact__cols { margin-block-start: clamp(44px, 9vh, 96px); display: grid; gap: 52px; }
.contact__h { margin: 0 0 14px; font-size: 0.9375rem; font-weight: 650; color: var(--mute); }
.ways, .reach { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid var(--hair); }
.ways li { display: grid; gap: 6px; padding: 20px 0; border-block-end: 1px solid var(--hair); }
.ways b { font-size: clamp(1.2rem, 0.9vw + 1rem, 1.6rem); font-weight: 720; letter-spacing: -0.018em; line-height: 1.18; }
html[lang='fa'] .ways b { letter-spacing: 0; line-height: 1.5; }
.ways span { font-size: 1.0625rem; line-height: 1.5; color: var(--mute); max-width: 34em; }
html[lang='fa'] .ways span { line-height: 1.8; }
.reach li { border-block-end: 1px solid var(--hair); }
.reach a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; min-height: 72px; padding: 12px 0; text-decoration: none; }
.reach__k { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 0.9375rem; color: var(--mute); }
.reach__k em { font-style: normal; font-size: 0.8125rem; font-weight: 700; color: var(--fg); }
.reach__v { grid-column: 1; font-size: clamp(1.15rem, 0.8vw + 1rem, 1.5rem); font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; text-align: start; unicode-bidi: plaintext; }
[dir='rtl'] .reach__v { text-align: end; font-family: var(--font); }
.reach svg { grid-column: 2; grid-row: 1 / span 2; transition: transform 0.35s var(--ease-out); }
@media (hover: hover) { .reach a:hover svg { transform: translate3d(4px, 0, 0); } [dir='rtl'] .reach a:hover svg { transform: scaleX(-1) translate3d(4px, 0, 0); } }
.foot { margin-block-start: clamp(56px, 10vh, 110px); padding-block-start: 22px; border-block-start: 1px solid var(--hair); display: grid; gap: 14px; font-size: 0.9375rem; color: var(--mute); }
.foot__credits summary { cursor: pointer; font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; color: var(--fg); }
.foot__credits p { margin: 4px 0 8px; max-width: 62em; line-height: 1.6; }
.foot__made { margin: 0; }

/* Wide screens: copy on the start side, the Frame on the end side */
@media (min-width: 900px) {
  /* The copy on the start side, the room on the end side, as tall as the screen allows. */
  .hero__pin { grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1.08fr); gap: 0 clamp(16px, 2.4vw, 44px); padding-block: 0; }
  .hero__head { grid-column: 1; grid-row: 2; gap: 20px; }
  .hero__acts { grid-column: 1; grid-row: 3; margin-block-start: 34px; }
  .hero__slot { grid-column: 2; grid-row: 1 / -1; margin-inline: 0 calc(-1 * var(--gutter)); margin-block: 5svh; }
  .hero__cue { grid-column: 2; grid-row: 1 / -1; margin-block-end: 3.2svh; font-size: 0.875rem; }
  .hero__me { font-size: 1rem; }
  .hero__me b { font-size: 1.25rem; }
  .hero__title { font-size: clamp(2.4rem, 4.15vw, 4.8rem); max-width: none; }
  html[lang='ru'] .hero__title { font-size: clamp(1.8rem, 3.05vw, 3.6rem); max-width: none; }
  html[lang='fa'] .hero__title { font-size: clamp(2.5rem, 4.3vw, 4.9rem); max-width: none; }
  .hero__sub { max-width: 28em; }
  .frame__box { inset-inline: auto 1vw; inset-block-start: 0; width: 48vw; height: 100svh; }
  .frame__label { inset-inline: auto 1vw; width: 48vw; inset-block-start: auto; inset-block-end: 7svh; }
  .stop, .stop--light { min-height: 100svh; display: grid; align-content: center; padding-inline: var(--gutter) 50vw; }
  .stop__copy { position: static; gap: 14px; }
  .stop__title { font-size: min(clamp(2.4rem, 4.6vw, 4.6rem), calc((50vw - var(--gutter)) / (var(--tl, 8) * 0.7))); }
  html[lang='fa'] .stop__title { font-size: clamp(2.8rem, 5.4vw, 5.5rem); }
  .stop__go { margin-block-start: 8px; }
  .contact { padding-block-start: 18svh; }
  .contact__top { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 56px; }
  .me { grid-template-columns: 148px; gap: 14px; }
  .me__mono { font-size: 4rem; }
  .contact__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .top, .btn, .btn svg, .stop__copy, .vil__beat, .vil, .vil__veil, .vil__veil::before, .frame__box { transition: none !important; }
  /* The hero does not fly: at the same threshold the room and the copy crossfade to the film. */
  .hero.is-diving .hero__head, .hero.is-diving .hero__acts, .hero.is-diving .hero__cue, .hero__phrase, .hero__play, .hero__skip { transform: none !important; }
  .hero__go svg { animation: none; }
}


/* Tall phones (taller than about 19:10): the Frame and the copy share the extra height, so the page does not end in
   an empty band under the copy. */
@media (max-width: 899px) and (max-aspect-ratio: 10/19) {
  .frame__box { height: 50svh; }
  .stop__copy { inset-block-start: 61svh; }
  .stop--village::after { height: 61svh; }
}
