/* lab.yehor.ai v5.2 — paper and ink, one burgundy thread, gold where threads meet.
   Paper/ink names from traditional Japanese colours (kinari, sumi); the thread is burgundy (owner, 2026-10-07); joins are deep kintsugi gold. */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans Runic"; src: url("../fonts/noto-sans-runic.woff2") format("woff2"); font-weight: 400; font-display: block; }   /* SIL OFL, see fonts/OFL-noto-sans-runic.txt */
@font-face { font-family: "Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #fbfaf5;         /* kinari */
  --paper-2: #f2efe6;
  --ink: #1d1a1f;           /* body text, 16.9:1 on paper */
  --sumi: #595857;          /* secondary, 6.8:1 */
  --thread: #7b1e2c;        /* burgundy, 9.7:1 on paper */
  --gold: #9c7414;          /* joins, 4.1:1 (graphics only, and large text) */
  --line: rgba(29, 26, 31, .14);
  --serif: "Instrument Serif";
  --sans: "Inter";
  --mono: "Plex Mono";
  --runic: "Noto Sans Runic", "Segoe UI Historic";
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--ink); background-color: var(--paper); font: 17px/1.62 var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--thread); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--sumi); }

/* the thread: one SVG over the whole page */
#thread { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 1; overflow: visible; }
#thread-path { stroke: var(--thread); }

/* ---------- 1. the long road: a story in ink, pinned while the page scrolls under it ---------- */
:root { --kraft: #cdb68b; --kraft-ink: #2e261d; }
.story { position: relative; background: var(--kraft); }
.stage { position: relative; }
#scene { display: none; }
.ep { padding: 28px var(--gutter); max-width: 40rem; }
.ep .say, .ep h1 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; }
.ep h1 { font-style: italic; font-size: clamp(38px, 5vw, 68px); line-height: 1.04; letter-spacing: -.01em; }
.ep p.say { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.28; }
.ep .src { font-family: var(--mono); font-size: 12.5px; letter-spacing: .03em; color: var(--kraft-ink); margin: 10px 0 0; line-height: 1.55; }
.ep .credit { margin-top: 12px; }
.runic { font-family: var(--runic); letter-spacing: .06em; font-size: 15px; }
/* with JavaScript: the stage is pinned for seven screens of scrolling and the episodes take turns */
.story-on .story { height: 800svh; }
.story-on .stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.story-on #scene { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.story-on .ep { position: absolute; z-index: 2; opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.story-on .ep.on { opacity: 1; transform: none; }
.story-on .ep0 { left: 0; top: 13svh; max-width: 44vw; padding: 0 0 0 var(--gutter); }
.story-on .ep0 .src { max-width: 30em; }
.story-on .cart { left: var(--gutter); top: 6svh; max-width: min(27rem, calc(100vw - 2 * var(--gutter))); padding: 16px 20px 15px; background: rgba(241, 231, 206, .9); border: 1px solid rgba(29, 26, 31, .55); box-shadow: 3px 3px 0 rgba(29, 26, 31, .12); }
/* the voice lights each word as it is said */
.w { transition: opacity .35s ease; }
.ep.speaking .w { opacity: .42; } .ep.speaking .w.lit { opacity: 1; }
@media (max-width: 700px) {
  .story-on .ep0 { top: auto; bottom: 19svh; max-width: calc(100vw - 2 * var(--gutter)); padding-right: var(--gutter); }
  .story-on .cart { top: 3svh; left: 12px; right: 12px; max-width: none; padding: 12px 14px; }
  .ep p.say { font-size: 20px; }
}
.enter { position: fixed; inset: 0; z-index: 40; border: 0; padding: 0; background: transparent; cursor: pointer; }
.enter[hidden] { display: none; }
.enter:focus-visible { outline: 2px solid var(--thread); outline-offset: -8px; border-radius: 0; }
.sound { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(29,26,31,.3); background: rgba(241,231,206,.9); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: opacity .6s; }
.sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound .spk { fill: currentColor; stroke: none; }
.sound .on { display: none; } .sound[aria-pressed="true"] .on { display: block; } .sound[aria-pressed="true"] .off { display: none; }
body.intro .sound { opacity: .4; }

/* ---------- 2. films ---------- */
.films { position: relative; z-index: 2; padding: clamp(72px, 10vw, 140px) 0 120px; }
.films header { max-width: 60ch; margin-bottom: 48px; padding-left: clamp(28px, 4vw, 56px); }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--thread); }
.films h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 66px); line-height: 1.04; margin: 10px 0 16px; }
.films header p { color: var(--sumi); margin: 0; }
.grid { list-style: none; margin: 0; padding: 0 0 0 clamp(28px, 4vw, 56px); display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px 28px; }
.film { position: relative; }
.film .frame { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: #0b1220; box-shadow: 0 1px 0 rgba(29,26,31,.06), 0 18px 40px -22px rgba(29,26,31,.45); }
.film video { width: 100%; height: 100%; object-fit: cover; display: block; }
.film .play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(to top, rgba(11,18,32,.55), transparent 55%); color: #fff; cursor: pointer; }
.film .play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(251,250,245,.92); color: var(--ink); display: grid; place-items: center; font-size: 20px; padding-left: 4px; }
.film .play[hidden] { display: none; }
.film h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; margin: 16px 0 2px; }
.film .series { margin: 0 0 10px; }
.chip { display: inline-block; font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; border: 1px solid currentColor; }
.chip.posted { color: var(--thread); }
.chip.draft, .chip.ready { color: var(--sumi); }
.stats { margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.stats div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stats div:nth-child(odd) { padding-right: 12px; }
.stats div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.stats dt { color: var(--sumi); }
.stats dd { margin: 0; font-family: var(--mono); font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.stats dd.na { color: var(--sumi); }
.film .aud, .film .asof, .film .quality, .film .made { margin: 8px 0 0; font-size: 13px; color: var(--sumi); line-height: 1.5; }
.film .asof { font-family: var(--mono); font-size: 11.5px; }
.footnote { margin: 56px 0 0; padding-left: clamp(28px, 4vw, 56px); max-width: 70ch; color: var(--sumi); font-size: 14px; }

/* ---------- 3. join ---------- */
.join { position: relative; z-index: 2; padding: 40px 0 160px; }
.join .wrap > * { margin-left: clamp(28px, 4vw, 56px); max-width: 56ch; }
.join h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6vw, 84px); line-height: 1; margin: 10px 0 18px; }
.join p { color: var(--ink); }
.join .cta { margin: 28px 0 10px; }
.btn { font: 500 16px/1 var(--sans); min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; text-decoration: none; }
.btn[aria-disabled="true"] { background: transparent; color: var(--ink); border-style: dashed; cursor: default; }
.join .fine { margin: 0; }
/* kraft fades into the page paper where the story ends (bokashi) */
.story-on .story::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 140px; background: linear-gradient(to bottom, rgba(205,182,139,0), var(--paper)); pointer-events: none; }

/* the opening line is two sentences now (owner, 2026-10-13): a quieter size so it never crowds the ink */
.story-on .ep0 h1 { font-size: clamp(26px, 2.9vw, 44px); line-height: 1.12; }
.story-on .ep0 { max-width: min(36rem, 46vw); }
@media (max-width: 700px) { .story-on .ep0 { max-width: calc(100vw - 2 * var(--gutter)); } .story-on .ep0 h1 { font-size: 23px; } }
/* join: text beside the poster; the next gathering is a button only when an event exists */
.join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 360px); gap: clamp(28px, 5vw, 72px); align-items: start; margin-left: clamp(28px, 4vw, 56px); }
.join .join-grid .join-text > * { margin-left: 0; }
.join .soon { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink); }
.poster { margin: 0; }
.poster img { display: block; width: 100%; height: auto; border: 1px solid rgba(29,26,31,.18); }
@media (max-width: 760px) { .join-grid { grid-template-columns: 1fr; } .poster { max-width: 420px; } }

/* film figures: three numbers, quiet labels (2026-10-14: "only what really matters") */
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 14px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figs div { display: flex; flex-direction: column; padding: 10px 0 9px; }
.figs dd { order: -1; }
.figs div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.figs dd { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--ink); }
.figs dt { margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--sumi); line-height: 1.3; white-space: nowrap; }
.film .asof a { color: var(--thread); }

/* the join grid is wider than a paragraph: lift the 56ch text cap from it (2026-10-14) */
.join .wrap > .join-grid { max-width: 960px; }
.join .btn { white-space: nowrap; }
