/* astansler.dev · spectrum version
   One column of strata, newest on top. Quiet white surfaces, hairlines and Geist, with one italic
   Garamond word per heading; colour comes from the prism (amber oldest, cyan newest).
   A fixed object re-forms itself per stratum; the gauge on the right (bottom on phones) is the scrollbar. */
@font-face { font-family: "Geist"; src: url("fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --accent: #3d30dc;
  --c1: #4fc3e6; --c2: #2f62f0; --c3: #5a2bd6; --c4: #d83a6a; --c5: #f09a2a;
  --pad: clamp(20px, 4vw, 56px);
  --gauge: 120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ui: #171717;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; -webkit-text-size-adjust: 100%; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: #fff; font: 450 1.0625rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body[data-ink="light"] { --ui: #f2f2f4; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd, p, h1, h2 { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.label { font: 450 0.8125rem/1.4 var(--sans); font-variant-numeric: tabular-nums; }

/* header: white, differenced against whatever stratum is under it */
.top { position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px calc(var(--gauge) + 12px) 20px var(--pad); color: #fff; mix-blend-mode: difference; pointer-events: none; }
.top a { pointer-events: auto; }
.top nav { display: flex; gap: clamp(14px, 2vw, 26px); font-size: 0.9375rem; }
.top nav a { padding: 6px 0; transition: opacity 160ms; }
.top nav a:hover { opacity: 0.6; }

/* the logo: nine versions of one mark, one per stratum */
.logo { position: relative; display: block; width: 190px; height: 38px; }
.lv { position: absolute; left: 0; top: 50%; translate: 0 -50%; display: flex; align-items: center; white-space: nowrap; opacity: 0; filter: blur(8px); transition: opacity 500ms var(--ease), filter 500ms var(--ease); }
.lv.is-on { opacity: 1; filter: blur(0); }
.lv .star { height: 1.36em; width: auto; fill: currentColor; rotate: -18deg; flex: none; }
.lv-lockup { font: 550 1.25rem/1 var(--sans); letter-spacing: -0.03em; gap: 0.5em; }
.lv-stack { display: block; font: 600 0.8125rem/1.08 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; }
.lv-route { gap: 5px; }
.lv-route i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font: 500 10px/1 var(--mono); font-style: normal; }
.lv-route b { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.lv-serif { font: italic 400 2.125rem/1 var(--serif); gap: 0.12em; }
.lv-serif .star { height: 0.6em; translate: 0 -0.35em; }
.lv-domain { font: 450 0.75rem/1 var(--mono); padding: 8px 11px; border: 1px solid; border-radius: 99px; }
.lv-mono { font: italic 400 2.5rem/1 var(--serif); gap: 0.04em; }
.lv-mono .star { height: 0.7em; }
.lv-trio { gap: 6px; align-items: flex-end; }
.lv-trio .star:nth-child(1) { height: 36px; }
.lv-trio .star:nth-child(2) { height: 23px; }
.lv-trio .star:nth-child(3) { height: 14px; }
.lv-wide { font: 350 1.125rem/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; }
.lv-star .star { height: 38px; }

/* the object */
#obj { position: fixed; z-index: 1; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; pointer-events: none; }
body.no-gl #obj { display: none; }

/* strata: white paper with a wash of the stratum's prism colour, deeper towards its floor */
.st { --ink: #171717; --soft: #525252; --mute: #6b6b73; --hair: rgb(23 23 23 / 0.12); --dot: rgb(23 23 23 / 0.07); --em: var(--accent);
  min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 20vh calc(var(--gauge) + 12px) 16vh var(--pad); color: var(--ink);
  background: radial-gradient(circle, var(--dot) 1px, transparent 1.5px) 0 0 / 14px 14px,
    #fff; }
/* the first and the last sheet are clean: no dot grid */
.st:first-child { background: #fff; }
.st-foot { background: #fff; align-items: flex-end; padding-top: 14vh; padding-bottom: 7vh; }
.st-foot .in { width: 100%; gap: 28px; }
.title.mega { margin: 0; font-size: clamp(3.5rem, 11.2vw, 13rem); line-height: 0.94; letter-spacing: -0.04em; }
.foot-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(32px, 8vw, 120px); align-items: start; padding-top: 28px; border-top: 1px solid var(--hair); }
.foot-cols .big-links, .foot-cols .kit { margin: 0; padding: 0; border: 0; }
.foot-cols .big-links { gap: 6px; font: 550 1.1875rem/1.3 var(--sans); letter-spacing: -0.01em; }
.st + .st { margin-top: -1px; }   /* neighbours overlap by a pixel: a fractional height can no longer open a seam */
#teratech { min-height: 130vh; min-height: 130svh; }   /* room for the particles to settle into the crystal */
.in { position: relative; z-index: 2; width: min(640px, 42vw); display: grid; gap: 18px; }

/* section head on a hairline, number on the right */
.head { display: flex; align-items: baseline; gap: 14px; font-size: 0.9375rem; color: var(--mute); white-space: nowrap; }
.head b { font-weight: 550; color: var(--ink); }
.head i { flex: 1; min-width: 12px; align-self: center; border-top: 1px solid var(--hair); }
.head .when { font-variant-numeric: tabular-nums; }
.head .n { font: italic 400 1.125rem/1 var(--serif); font-variant-numeric: tabular-nums; }

.title { margin-top: 10px; font: 550 clamp(2.375rem, 4.4vw, 4.25rem)/1.07 var(--sans); letter-spacing: -0.025em; text-wrap: balance; }
.title em { font: italic 400 1.17em/0.9 var(--serif); letter-spacing: 0; color: var(--em); }
h1.title { font-size: clamp(3rem, 6.4vw, 6rem); }
.for { font-size: 0.9375rem; color: var(--mute); }
.for > b { margin-right: 22px; }
.for span { display: inline-block; }
.for b { font-weight: 550; color: var(--ink); }
.lead { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.4; color: var(--soft); text-wrap: pretty; max-width: 30em; }
.body { color: var(--soft); max-width: 34em; text-wrap: pretty; }
.body b { font-weight: 550; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--hair); color: var(--soft); }
.tags li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--mute)); }
.tags li:nth-child(5n + 1) { --k: var(--c1); } .tags li:nth-child(5n + 2) { --k: var(--c2); } .tags li:nth-child(5n + 3) { --k: var(--c3); } .tags li:nth-child(5n + 4) { --k: var(--c4); } .tags li:nth-child(5n) { --k: var(--c5); }
.links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.links a, .foot a, .below a { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 0.3em; transition: text-decoration-color 160ms, color 160ms; }
.links a:hover, .foot a:hover, .below a:hover { color: var(--em); text-decoration-color: currentColor; }
.below { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--hair); color: var(--mute); font-size: 0.9375rem; max-width: 34em; }

/* rows on hairlines */
.rows { margin-top: 6px; border-bottom: 1px solid var(--hair); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--hair); color: var(--soft); text-wrap: pretty; }
.row b { font-weight: 550; color: var(--ink); font-variant-numeric: tabular-nums; }
.row .src { color: var(--mute); white-space: nowrap; transition: color 160ms, translate 160ms var(--ease); }
a.row:hover .src { color: var(--em); translate: 4px 0; }
a.row b { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 0.22em; transition: text-decoration-color 160ms, color 160ms; }
a.row:hover b { color: var(--em); text-decoration-color: currentColor; }

/* zero */
.big-links { display: grid; justify-items: start; gap: 2px; margin-top: 6px; font: 550 clamp(1.5rem, 2.4vw, 2.125rem)/1.25 var(--sans); letter-spacing: -0.02em; }
.big-links a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 520ms var(--ease), color 160ms; }
.big-links a:hover { background-size: 100% 1px; color: var(--em); }
.kit { display: grid; gap: 8px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--hair); }
.kit > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.kit dt { color: var(--ink); font-weight: 550; }
.kit dd { color: var(--soft); font-size: 0.9375rem; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; color: var(--mute); }

/* gauge: the scrollbar. Segments are the strata, as tall as they are on the page; the spectrum means time. */
.gauge { position: fixed; z-index: 50; top: 0; right: 0; width: var(--gauge); height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 72px 22px 24px 0; color: var(--ui); transition: color 400ms; user-select: none; -webkit-user-select: none; }
.g-cap { writing-mode: vertical-rl; rotate: 180deg; font-size: 0.6875rem; opacity: 0.6; margin-bottom: 4px; }
.g-end { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ui); color: #fff; font: 500 9px/1 var(--mono); transition: background 400ms; }
body[data-ink="light"] .g-end { color: #171717; }
.g-bar { position: relative; flex: 1; width: 8px; cursor: grab; touch-action: none; }
.g-bar::before { content: ""; position: absolute; inset: 0 -14px; }     /* a wider place to grab */
.g-bar.is-drag { cursor: grabbing; }
.g-segs, .g-ticks { position: absolute; inset: 0; }
.g-segs { border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgb(127 127 127 / 0.25); }
.g-segs i { position: absolute; left: 0; width: 100%; }
.g-ticks { pointer-events: none; }
.g-ticks span { position: absolute; right: calc(100% + 14px); translate: 0 -50%; font-size: 0.6875rem; line-height: 1; white-space: nowrap; opacity: 0.5; transition: opacity 300ms; }
.g-ticks span.is-on { opacity: 1; font-weight: 600; }
body[data-ink="light"] .g-ticks span.is-on { color: #9d95ff; }
/* the thumb: a pill of clear glass riding on the spectrum */
.g-thumb { position: absolute; left: -9px; right: -9px; top: 0; height: 40px; border-radius: 99px; pointer-events: none; will-change: transform;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.12) 45%, rgb(255 255 255 / 0.3));
  -webkit-backdrop-filter: blur(3px) saturate(1.9) brightness(1.08); backdrop-filter: blur(3px) saturate(1.9) brightness(1.08);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.75), inset 0 1.5px 1px rgb(255 255 255 / 0.95), inset 0 -2px 3px rgb(255 255 255 / 0.35),
    0 0 0 0.5px rgb(23 23 23 / 0.16), 0 2px 5px rgb(23 23 23 / 0.14), 0 8px 20px rgb(23 23 23 / 0.16); }
.g-now { font-size: 0.6875rem; white-space: nowrap; min-height: 1.4em; }


@media (max-width: 860px) {
  :root { --gauge: 0px; }
  .top { padding: 14px var(--pad); }
  .top nav .wide { display: none; }
  .logo { width: 150px; height: 32px; scale: 0.88; transform-origin: 0 50%; }

  /* phones: the object sits in the gap above a heading; .seat is that gap, the canvas is sticky inside it */
  .seat { position: absolute; z-index: 1; left: 0; width: 100%; pointer-events: none; }
  /* Sizes here come from the screen's width, never its height: in-app browsers (Telegram and others) change the
     viewport height as their header slides away on scroll, and anything tied to it would jump. */
  :root { --win: min(54vw, 270px); }
  #obj { position: sticky; top: 64px; display: block; width: 100%; height: var(--win); }
  .st, #teratech { min-height: 0; }
  .st { align-items: flex-start; padding: calc(var(--win) + 32px) var(--pad) 96px; }
  .st:first-child { padding-top: calc(var(--win) + 52px); }
  .st:first-child .in { gap: 10px; }   /* the first screen: figure under the header, then all of the intro */
  .in { width: 100%; gap: 14px; }
  .head { flex-wrap: wrap; gap: 2px 12px; white-space: normal; }
  .head i { display: none; }
  /* the number keeps the top right corner, so a long row wraps under it instead of pushing it onto a line of its own */
  .head { position: relative; padding-right: 36px; }
  .head .n { position: absolute; right: 0; top: 0; line-height: 1.5; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row .src { justify-self: start; }
  .st-foot { align-items: flex-end; padding: var(--win) var(--pad) 56px; }
  .st-foot .in { gap: 20px; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .title.mega { font-size: clamp(3.25rem, 19vw, 6rem); }

  /* phones: a thin spectrum line along the bottom edge with a small marker for where you are. It only shows the
     place and takes no touches, so it cannot fight the system gestures that live on the screen edges. */
  .gauge { top: auto; bottom: 0; left: 0; width: 100%; height: auto; display: block; padding: 0; pointer-events: none; }
  .g-cap, .g-now, .g-ticks, .g-end { display: none; }
  /* On iPhones the band is as tall as a share of the safe area under the page: that area is zero while the browser
     shows its bottom toolbar and opens when the toolbar slides away on scroll, so the band appears with it and is
     never drawn across the toolbar. Elsewhere it is a fixed 12px. */
  .g-bar { width: auto; height: 12px; pointer-events: none; transition: height 220ms var(--ease); }
  :root.inset .g-bar { height: calc(env(safe-area-inset-bottom, 0px) * 0.72); }
  .g-bar::before { display: none; }
  .g-segs { border-radius: 0; box-shadow: none; }
  .g-segs i { top: 0; height: 100%; width: auto; }
  .g-thumb { top: 0; bottom: 0; left: 0; right: auto; height: auto; width: 5.6px; border-radius: 0; background: #fff;
    -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px rgb(23 23 23 / 0.28); }
  }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lv { transition-duration: 1ms; }
}
