@font-face { font-family: Prata; src: url(fonts/prata-lat.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Prata; src: url(fonts/prata-cyr.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-weight: 400; src: url(fonts/onest-400-lat.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Onest; font-weight: 400; src: url(fonts/onest-400-cyr.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-weight: 600; src: url(fonts/onest-600-lat.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: Onest; font-weight: 600; src: url(fonts/onest-600-cyr.woff2) format("woff2"); font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --canvas: #0e1624;
  --surface: #172235;
  --ink: #f3ede1;
  --ink-soft: #a9b4c6;
  --accent: #ff8a3d;
  --accent-ink: #1a0e05;
  --edge: clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --display: Prata, "Times New Roman", serif;
  --text: Onest, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); scrollbar-color: #33425f var(--canvas); }
body { margin: 0; color: var(--ink); font: 400 clamp(1rem, 0.94rem + 0.3vw, 1.2rem) / 1.55 var(--text); }
h1, h2, p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.top { position: fixed; z-index: 3; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: max(0.9rem, env(safe-area-inset-top)) var(--edge) 2.5rem;
  background: linear-gradient(rgb(8 13 22 / 0.78), rgb(8 13 22 / 0)); pointer-events: none; }
.brand { font: 400 clamp(1.05rem, 1rem + 0.35vw, 1.35rem) / 1.2 var(--display); }
.lang { display: flex; pointer-events: auto; }
.lang button { min-width: 2.75rem; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--ink-soft);
  font: 600 0.875rem var(--text); cursor: pointer; transition: color 150ms var(--ease), transform 120ms var(--ease); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline 2px var(--accent); text-underline-offset: 0.45em; }
.lang button:active { transform: scale(0.95); }

/* ---------- still story (no script, or reduced motion) ---------- */
.stage, .clock { display: none; }
main { padding-top: 5rem; }
.scene { max-width: 70rem; margin: 0 auto clamp(3.5rem, 9vw, 7rem); }
.still { display: block; width: 100%; height: auto; }
.caption { padding: 1.5rem var(--edge) 0; }
.caption h1, .caption h2 { font: 400 clamp(2.1rem, 1.2rem + 3.6vw, 4.25rem) / 1.06 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.caption p { max-width: 30rem; margin-top: 0.75rem; text-wrap: pretty; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.button { min-height: 3rem; padding: 0.7rem 1.35rem; border: 1px solid rgb(243 237 225 / 0.55); border-radius: 2px;
  background: rgb(14 22 36 / 0.72); color: var(--ink); font: 600 1rem var(--text); white-space: nowrap; cursor: pointer;
  transition: transform 120ms var(--ease), background-color 150ms var(--ease), border-color 150ms var(--ease); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .lang button:hover { color: var(--ink); }
  .button:hover { border-color: var(--ink); background: var(--surface); }
  .button.primary:hover { border-color: #ffa261; background: #ffa261; }
}
.caption .reply { min-height: 1.55em; color: var(--accent); }
.caption .note { max-width: 28rem; margin-top: 0.5rem; color: var(--ink-soft); font-size: 0.875rem; }

/* ---------- film ---------- */
.film .stage { display: block; position: fixed; inset: 0; width: 100%; height: 100vh; height: 100lvh; }
.film main { position: relative; padding: 0; }
.film .still { display: none; }
.film .scene { max-width: none; margin: 0; }
.film .caption { position: fixed; z-index: 2; left: 0; bottom: 0; width: min(100%, 38rem); isolation: isolate;
  padding: 3rem var(--edge) max(var(--edge), env(safe-area-inset-bottom)); opacity: 0; visibility: hidden;
  text-shadow: 0 1px 18px rgb(5 9 16 / 0.85); }
/* soft corner shade only where the words are */
.film .caption::before { content: ""; position: absolute; z-index: -1; inset: -25% -35% 0 0; pointer-events: none;
  background: radial-gradient(closest-side at 28% 66%, rgb(7 11 20 / 0.82), rgb(7 11 20 / 0.55) 55%, rgb(7 11 20 / 0)); }
.film .button { text-shadow: none; }

.film .clock { display: flex; position: fixed; z-index: 1; right: var(--edge); bottom: max(var(--edge), env(safe-area-inset-bottom)); margin: 0;
  font: 400 clamp(2.5rem, 1.4rem + 4vw, 5.25rem) / 1 var(--display); text-shadow: 0 0 28px rgb(5 9 16 / 0.95), 0 1px 3px rgb(5 9 16 / 0.8); }
.clock span { display: inline-block; width: 0.66em; text-align: center; }
.clock i { width: 0.34em; color: var(--accent); font-style: normal; text-align: center; }

/* Narrow upright screens: the picture sits high, words get the dark band below it. */
@media (max-aspect-ratio: 4/5) {
  /* left padding keeps words clear of the order banner tab at the screen edge */
  .film .caption { width: 100%; padding-left: max(1.75rem, var(--edge)); }
  .film .caption::before { inset: 0; background: linear-gradient(rgb(7 11 20 / 0), rgb(7 11 20 / 0.62) 35%); }
  .film .clock { top: calc(max(0.9rem, env(safe-area-inset-top)) + 3.5rem); bottom: auto; right: auto; left: var(--edge); font-size: 2.5rem; }
  .button { flex: 1 1 100%; }
}
@media (max-height: 31rem) and (min-aspect-ratio: 4/5) {
  .caption h1, .caption h2 { font-size: 1.9rem; }
  .film .caption { padding-block: 1rem; font-size: 0.95rem; }
  .actions { margin-top: 0.75rem; }
  .button { min-height: 2.75rem; }
  .film .clock { font-size: 2.25rem; }
}
