/* Layout: one pinned thermodynamic scene, type laid over it, a quiet close underneath. */
:root {
  color-scheme: dark;
  --void: #060910;
  --ink: #e9eef8;
  --muted: #929db2;
  --line: #222a3a;
  --ice: #9dc2ff;
  --ember: #ff8a4c;
  --display: "Geologica", "Segoe UI", system-ui, sans-serif;
  --body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter-l: max(clamp(16px, 5vw, 72px), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(16px, 5vw, 72px), env(safe-area-inset-right, 0px));
}

@font-face { font-family: "Geologica"; src: url("/assets/fonts/geologica-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Geologica"; src: url("/assets/fonts/geologica-cyrillic.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-text-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Golos Text"; src: url("/assets/fonts/golos-text-cyrillic.woff2") format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0400-04FF, U+2116; }

* { box-sizing: border-box; }
html { background: var(--void); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 400 clamp(1rem, .95rem + .25vw, 1.2rem) / 1.55 var(--body);
  overflow-x: clip;
}
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 2px; }
h1, h2, p, dl, dd { margin: 0; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--ink); color: var(--void); padding: .5em .9em; }
.skip:focus { top: 12px; }

.mono { font: 400 .75rem / 1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* Header */
.bar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) var(--gutter-r) 1.6rem var(--gutter-l);
  background: linear-gradient(var(--void) 45%, transparent);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font: 400 1.15rem / 1 var(--display);
  letter-spacing: -.02em;
  text-decoration: none;
}
.mark svg { width: 20px; height: 20px; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; color: var(--muted); }
.langs { display: flex; gap: .65rem; }
.langs a { text-decoration: none; padding: .35em .1em; }
.langs a:hover, .langs a[aria-current] { color: var(--ink); }
.langs a[aria-current] { border-bottom: 1px solid var(--ember); }

/* Stage */
.stage { position: relative; }
.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: hidden;
  background: radial-gradient(60% 55% at 72% 50%, #3a1a10 0%, transparent 70%), var(--void);
}
.gl .pin { background: var(--void); }
#scene { display: block; width: 100%; height: 100%; background: var(--void); }
.no-gl #scene { display: none; }
.pin::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, var(--void) 4%, transparent 34%),
    linear-gradient(90deg, rgb(6 9 16 / .78) 0%, rgb(6 9 16 / .35) 42%, transparent 62%);
}

/* The readout names the three states of the animation; it is not a product metric. */
.readout {
  position: absolute;
  z-index: 2;
  right: var(--gutter-r);
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  display: flex;
  align-items: flex-end;
  gap: .9rem;
  color: var(--muted);
}
.readout ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; text-align: right; }
.readout li { transition: color .4s; }
.readout li.on { color: var(--ink); }
.track { width: 2px; height: 4.6rem; background: var(--line); position: relative; }
#gauge {
  position: absolute;
  inset: 0;
  background: var(--ember);
  transform-origin: bottom;
}

.beat {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: 6rem var(--gutter-r) 6rem var(--gutter-l);
}
.beat > * { max-width: min(36rem, 100%); }
.beat .mono { color: var(--ember); }
.beat p:not(.mono) { color: #c3ccdc; max-width: 30rem; }

h1, h2 { font-family: var(--display); font-weight: 300; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(3rem, 1.4rem + 6.4vw, 7.2rem); line-height: .98; max-width: 11.5em; }
h2 { font-size: clamp(2.3rem, 1.3rem + 3.8vw, 4.6rem); line-height: 1.02; }
.hero { justify-content: flex-end; padding-bottom: clamp(5rem, 14vh, 9rem); }
.hero > h1 { max-width: min(11.5em, 100%); }
.hero p { font-size: 1.08em; }
h1 span { display: block; }
html[lang="ru"] h1 { font-size: clamp(2.5rem, 1rem + 4.6vw, 5.4rem); line-height: 1.04; }
html[lang="ru"] .hero > h1 { max-width: 100%; }

/* Close */
.close { position: relative; z-index: 3; background: var(--void); padding: clamp(4.5rem, 12vh, 9rem) var(--gutter-r) 3rem var(--gutter-l); display: grid; gap: clamp(4rem, 10vh, 7rem); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 4vw, 4rem); }
.facts dt { color: var(--muted); margin-bottom: .75rem; }
.facts dd { font: 300 clamp(1.2rem, 1rem + .7vw, 1.65rem) / 1.25 var(--display); letter-spacing: -.015em; }
.status { display: grid; gap: .6rem; }
.status h2 { font-size: clamp(2.8rem, 1rem + 8vw, 9rem); line-height: 1; }
.status p { color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1.5rem; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.foot p { min-width: 0; overflow-wrap: anywhere; }

/* 404 */
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding-block: 4rem; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

@media (max-width: 760px) {
  .bar-end .mono-status { display: none; }
  .pin::after { background: linear-gradient(180deg, transparent 30%, rgb(6 9 16 / .82) 72%, var(--void) 100%); }
  .beat { justify-content: flex-end; padding-bottom: 3.5rem; }
  .hero { padding-bottom: 3.5rem; }
  .readout { bottom: auto; top: calc(4rem + env(safe-area-inset-top, 0px)); }
  .readout ol { display: flex; gap: .8rem; }
  .readout li:not(.on) { display: none; }
  .track { height: 1rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .readout li { transition: none; }
}
