/* Grimm OS website. The palette is the 2017 eclipse: ink black, the bone-white corona, and the small red
   prominence on the moon's edge, used once or twice and never as a gradient. Type: Instrument Serif for the
   voice, Inter Tight for reading, JetBrains Mono for facts. */
:root {
  --ink: #0a0a0b; --ink2: #111113; --ink3: #18181b;
  --bone: #ece6da; --bone2: #c9c2b4; --ash: #8a847a; --smoke: #57534c;
  --line: rgba(236, 230, 218, .12); --line2: rgba(236, 230, 218, .22);
  --corona: #f1dfb8; --flare: #ff5b4a;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --gut: clamp(20px, 5vw, 72px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--bone); font: 400 18px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::after { /* film grain: one static tile, no animation */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font: 400 .86em var(--mono); color: var(--corona); }
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.01em; }
em { font-style: italic; }
::selection { background: var(--corona); color: var(--ink); }

/* ---------- header: a wordmark and words, nothing floating */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--gut); mix-blend-mode: difference; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 16px var(--sans); letter-spacing: .01em; }
.mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mark .flare { fill: currentColor; stroke: none; }
.top nav { display: flex; gap: 30px; font-size: 15px; }
.top nav a { text-decoration: none; opacity: .75; transition: opacity .2s; }
.top nav a:hover { opacity: 1; }
.top nav .dl { opacity: 1; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- I. the eclipse */
.eclipse { height: 260vh; position: relative; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #000; }
.stage .sky { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50.1% 51.3%;
  transform: scale(calc(1 + var(--p, 0) * 2.4)); opacity: calc(1 - var(--p, 0) * 1.1); will-change: transform; }
.reveal-shot { position: absolute; inset: 0; display: grid; place-items: center; clip-path: circle(var(--r, 0px) at 50% 51.3%); will-change: clip-path; }
.reveal-shot img { width: min(88vw, calc(88vh * 16 / 9)); border-radius: 10px; box-shadow: 0 0 0 1px var(--line2), 0 40px 120px rgba(0,0,0,.8);
  transform: scale(calc(.92 + var(--p, 0) * .08)); }
.intro { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(36px, 8vh, 90px); max-width: 760px;
  opacity: calc(1 - var(--p, 0) * 7); transform: translateY(calc(var(--p, 0) * -120px)); }
.meta { font: 400 13px var(--mono); color: var(--bone2); letter-spacing: .02em; margin: 0 0 26px; display: flex; align-items: center; gap: 10px; }
.flare-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 10px var(--flare); }
h1 { font-size: clamp(56px, 9.6vw, 150px); line-height: .9; }
h1 em { color: var(--corona); }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--bone2); max-width: 560px; margin: 28px 0 0; }
.cta { display: flex; align-items: center; gap: 28px; margin: 34px 0 0; flex-wrap: wrap; }
.btn { display: inline-block; padding: 15px 30px; background: var(--bone); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px;
  border-radius: 2px; transition: background .2s, transform .3s var(--ease); }
.btn:hover { background: #fff; transform: translateY(-2px); }
.btn.off { background: transparent; color: var(--bone2); box-shadow: inset 0 0 0 1px var(--line2); cursor: default; transform: none; }
.link { text-decoration: none; font-size: 16px; border-bottom: 1px solid var(--line2); padding-bottom: 3px; transition: border-color .2s; }
.link:hover { border-color: var(--bone); }
.scroll-hint { position: absolute; right: var(--gut); bottom: clamp(36px, 8vh, 90px); margin: 0; font: 400 12px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ash); writing-mode: vertical-rl; opacity: calc(1 - var(--p, 0) * 4); }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 60px; margin: 14px auto 0; background: linear-gradient(var(--ash), transparent); }

/* ---------- the thesis */
section:not(.eclipse) { padding: clamp(90px, 14vh, 170px) var(--gut) 0; max-width: 1400px; margin: 0 auto; }
.thesis .big { font: 400 clamp(30px, 3.7vw, 54px)/1.18 var(--serif); margin: 0; max-width: 1100px; color: var(--bone); }
.thesis .big em { color: var(--corona); }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin: 80px 0 0; border-top: 1px solid var(--line); }
.figures div { padding: 26px 24px 0 0; }
.figures dt { font: 400 clamp(44px, 5vw, 72px)/1 var(--serif); }
.figures dd { margin: 10px 0 0; color: var(--ash); font-size: 15px; max-width: 200px; }

/* ---------- chapters */
.ch-head { display: grid; grid-template-columns: 90px minmax(0, 1fr); column-gap: 20px; max-width: 900px; margin-bottom: 50px; }
.ch-head .num { grid-row: span 2; font: 400 22px var(--serif); color: var(--flare); padding-top: 14px; }
.ch-head h2 { font-size: clamp(40px, 5.4vw, 78px); line-height: 1; }
.ch-head p { color: var(--bone2); margin: 20px 0 0; max-width: 640px; }
.flip .ch-head { margin-left: auto; }
.plate { margin: 0; }
.plate img { border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.6); }
.plate.bleed { margin-right: calc(var(--gut) * -1 - max(0px, (100vw - 1400px) / 2)); }
.plate.bleed img { border-radius: 8px 0 0 8px; }
.flip .plate.bleed { margin-right: 0; margin-left: calc(var(--gut) * -1 - max(0px, (100vw - 1400px) / 2)); }
.flip .plate.bleed img { border-radius: 0 8px 8px 0; }

.annotated { position: relative; }
.pin { position: absolute; left: var(--x); top: var(--y); width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; display: grid; place-items: center;
  font: 500 13px var(--mono); font-style: normal; background: var(--bone); color: var(--ink); box-shadow: 0 0 0 5px rgba(236,230,218,.18); transform: translateY(26px); }
.pin::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--bone); opacity: 0; }
.in .pin::before { animation: ping 1.6s var(--ease) both; }
@keyframes ping { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
.legend { list-style: none; counter-reset: l; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.legend li { counter-increment: l; color: var(--ash); font-size: 15px; border-top: 1px solid var(--line); padding-top: 16px; }
.legend li::before { content: counter(l); font: 500 12px var(--mono); color: var(--flare); display: block; margin-bottom: 8px; }
.legend b { color: var(--bone); font-weight: 500; }

/* the theme comparison */
.compare { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.6); cursor: ew-resize; }
.compare img { border-radius: 0; box-shadow: none; }
.compare .over { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--cut)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 1px; background: var(--bone); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bone); color: var(--ink); font-size: 18px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare .tag { position: absolute; bottom: 16px; font: 400 12px var(--mono); padding: 6px 10px; background: rgba(10,10,11,.75); color: var(--bone); pointer-events: none; }
.compare .tag.l { left: 16px; } .compare .tag.r { right: 16px; background: rgba(236,230,218,.85); color: var(--ink); }

/* the living island: the three states, each on its own strip of night */
.island-demo { display: grid; gap: 14px; max-width: 760px; }
.island-demo figure { margin: 0; display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); align-items: center; gap: 26px;
  padding: 18px 22px; background: #020306; border: 1px solid var(--line); border-radius: 8px; }
.island-demo img { width: auto; max-width: 100%; border-radius: 999px; }
.island-demo figcaption { color: var(--ash); font-size: 15px; }
.island-demo figcaption::before { content: "— "; color: var(--flare); }
@media (max-width: 760px) { .island-demo figure { grid-template-columns: 1fr; gap: 12px; } }

/* Rune */
.rune { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 60px; align-items: start; }
.rune .ch-head { margin-bottom: 0; }
.term { background: #050607; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; margin-top: 10px; }
.term-bar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar .tab { font: 400 12.5px var(--sans); padding: 4px 12px; border-radius: 999px; background: var(--ink3); color: var(--ash); }
.term-bar .tab em { font-style: normal; opacity: .8; margin-left: 3px; }
.term-bar .tab.on { background: var(--bone); color: var(--ink); }
.term-bar .ok, .term .ok { color: #7fd6a4; }
.term pre { margin: 0; padding: 22px; font: 400 14px/1.75 var(--mono); color: var(--bone); white-space: pre-wrap; min-height: 340px; }
.term .dim { color: var(--smoke); } .term .br { color: var(--corona); } .term .pr { color: var(--flare); }
.term .typed { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; width: 0; border-right: 2px solid var(--bone); }
.term .out { visibility: hidden; }
.term.play .t1 { animation: type 1.1s steps(30) .4s forwards, caret 0s 1.5s forwards; }
.term.play .o1 { animation: show 0s 1.8s forwards; }
.term.play .t2 { animation: type 1.2s steps(33) 2.4s forwards, caret 0s 3.6s forwards; }
.term.play .o2 { animation: show 0s 3.9s forwards; }
.term.play .t3 { animation: type .5s steps(9) 4.5s forwards; }
.term.play .o3 { animation: show 0s 5.3s forwards; }
.t1 { --w: 30ch; } .t2 { --w: 33ch; } .t3 { --w: 9ch; }
@keyframes type { to { width: calc(var(--w) + 2px); } }
@keyframes caret { to { border-color: transparent; } }
@keyframes show { to { visibility: visible; } }

/* the spec sheet */
.spec table { width: 100%; border-collapse: collapse; font-size: 16px; }
.spec tr { border-top: 1px solid var(--line); }
.spec tr:last-child { border-bottom: 1px solid var(--line); }
.spec th { text-align: left; font: 400 13px var(--mono); color: var(--ash); text-transform: uppercase; letter-spacing: .08em; padding: 18px 20px 18px 0; width: 200px; vertical-align: baseline; }
.spec td { padding: 18px 20px 18px 0; vertical-align: baseline; }
.spec td:nth-child(2) { font: 400 17px var(--mono); color: var(--bone); width: 34%; }
.spec td:nth-child(3) { color: var(--ash); }
.spec tr { transition: background .2s; } .spec tr:hover { background: rgba(236,230,218,.03); }

/* versions */
.versions { list-style: none; padding: 0; margin: 0; }
.versions li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); align-items: baseline; }
.versions li:last-child { border-bottom: 1px solid var(--line); }
.versions b { font: 400 40px/1 var(--serif); }
.versions li:last-child b { color: var(--corona); }
.versions span { color: var(--bone2); }

/* install */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.steps li { counter-increment: s; border-top: 1px solid var(--line2); padding-top: 22px; }
.steps li::before { content: "0" counter(s); display: block; font: 400 13px var(--mono); color: var(--flare); margin-bottom: 18px; }
.steps b { display: block; font: 400 28px/1.1 var(--serif); margin-bottom: 10px; }
.steps span { color: var(--ash); font-size: 16px; }
.reqs { display: flex; flex-wrap: wrap; gap: 10px 40px; margin: 60px 0 0; font: 400 13.5px var(--mono); color: var(--bone2); }
.reqs span::before { content: "— "; color: var(--smoke); }

/* questions */
.qs { max-width: 900px; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 24px 50px 24px 0; font: 400 clamp(24px, 2.4vw, 32px)/1.2 var(--serif); position: relative; transition: color .2s; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 300 28px var(--sans); color: var(--ash); transition: transform .3s var(--ease); }
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
summary:hover { color: var(--corona); }
details p { margin: 0; padding: 0 0 26px; color: var(--bone2); max-width: 720px; }

/* download: the eclipse returns, small */
.download { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-bottom: 40px !important; }
.sky-small { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.ticket h2 { font-size: clamp(54px, 6vw, 92px); line-height: 1; }
.ticket h2 em { color: var(--corona); }
.ticket dl { margin: 36px 0 0; border-top: 1px solid var(--line); }
.ticket dl div { display: grid; grid-template-columns: 130px minmax(0, 1fr); padding: 14px 0; border-bottom: 1px solid var(--line); }
.ticket dt { font: 400 12.5px var(--mono); color: var(--ash); text-transform: uppercase; letter-spacing: .08em; }
.ticket dd { margin: 0; font: 400 15px var(--mono); overflow-wrap: anywhere; }

/* footer */
.foot { max-width: 1400px; margin: 80px auto 0; padding: 30px var(--gut) 50px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 40px; color: var(--smoke); font-size: 13.5px; }
.foot p { margin: 0; max-width: 820px; }
.foot nav { display: flex; gap: 22px; } .foot a { color: var(--ash); text-decoration: none; } .foot a:hover { color: var(--bone); }

/* reveal on scroll */
.js .fade { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .fade.in { opacity: 1; transform: none; }
.js .plate.fade { transform: translateY(50px) scale(.985); }
.js .plate.fade.in { transform: none; }

/* smaller screens */
@media (max-width: 1000px) {
  .top nav a:not(.dl) { display: none; }
  .figures { grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
  .legend { grid-template-columns: repeat(2, 1fr); }
  .rune, .download { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .sky-small { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .ch-head { grid-template-columns: 1fr; } .ch-head .num { padding: 0 0 8px; }
  .legend, .steps { grid-template-columns: 1fr; }
  .spec th { display: block; width: auto; padding-bottom: 4px; } .spec td { display: block; width: auto !important; padding: 0 0 6px; }
  .spec td:last-child { padding-bottom: 18px; }
  .versions li { grid-template-columns: 80px minmax(0, 1fr); } .versions b { font-size: 30px; }
  .term pre { font-size: 12px; min-height: 300px; padding: 16px; }
  .pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; transform: translateY(16px); }
  .foot { flex-direction: column; }
  .scroll-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .eclipse { height: auto; } .stage { position: relative; }
  .js .fade { opacity: 1; transform: none; }
  .term .typed { width: auto; border: 0; } .term .out { visibility: visible; }
}
