/* ---------- Fonts (self-hosted, SIL OFL 1.1; licences in /fonts) ---------- */
@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: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* ---------- Tokens (theme colours are set by app.js from themes.js) ---------- */
:root {
  --bg: #0e0e14; --surface: #1a1b26; --raised: #24283b; --line: #292e42;
  --text: #c0caf5; --muted: #abb3d7; --accent: #93b4f9;
  --p0: #f7768e; --p1: #e0af68; --p2: #9ece6a; --p3: #449dab; --p4: #7aa2f7; --p5: #ad8ee6;

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 76rem;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 4.25rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 400 1.0625rem/1.6 var(--sans);
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035; /* no blend mode: it forced a full-screen repaint on every animated frame */
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--bg); }
code { font-family: var(--mono); font-size: .88em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 200; background: var(--accent); color: var(--bg); padding: .6rem .9rem; border-radius: 8px; }
.skip:focus { top: 3rem; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 2.75rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 .75rem;
  font: 500 .8rem/1 var(--mono);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.ws { display: flex; gap: .25rem; }
/* 44px hit area (WCAG 2.5.5 AAA) around a slim Omarchy-style pill */
.ws { gap: 0; }
.ws a { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--muted); text-decoration: none; }
.ws a > span:first-child {
  display: grid; place-items: center; min-width: 1.9rem; height: 1.6rem; border-radius: 6px;
  transition: background .3s var(--ease), color .3s, min-width .4s var(--ease);
}
.ws a:hover > span:first-child { background: var(--surface); color: var(--text); }
.ws a[aria-current="true"] > span:first-child { color: var(--bg); background: var(--accent); min-width: 2.4rem; }
.bar-title { color: var(--text); text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .5rem; }
.dim { color: var(--muted); }
.bar-right { justify-self: end; display: flex; align-items: center; gap: .5rem; }
.bar-link { display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--muted); text-decoration: none; min-height: 2.75rem; min-width: 2.75rem; }
.bar-link:hover { color: var(--text); }
.swatch { width: .7rem; height: .7rem; border-radius: 3px; transition: transform .6s var(--ease); background: conic-gradient(var(--p0), var(--p1), var(--p2), var(--p3), var(--p4), var(--p5), var(--p0)); }
.clock { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 6rem var(--pad) 4rem; isolation: isolate; overflow: hidden; }
.field {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  -webkit-mask-image: linear-gradient(100deg, transparent 38%, #000 78%);
          mask-image: linear-gradient(100deg, transparent 38%, #000 78%);
}
.hero::after { /* second aurora in the theme's magenta */
  content: ""; position: absolute; z-index: -2; left: -15%; bottom: -35%; width: 55vmax; height: 55vmax; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--p5) 16%, transparent), transparent 70%);
  filter: blur(50px); animation: drift 22s var(--ease) infinite alternate-reverse;
}
.hero::before { /* aurora */
  content: ""; position: absolute; z-index: -2; inset: -20% -10% auto auto; width: 70vmax; height: 70vmax; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(40px); animation: drift 18s var(--ease) infinite alternate;
}
@keyframes drift { to { transform: translate(-12vmax, 10vmax) scale(1.15); } }
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.75rem; padding: .4rem .9rem .4rem .7rem;
  font: 500 .8rem/1.2 var(--mono); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent);
  position: relative; overflow: hidden;
}
.eyebrow::after { /* shine sweep */
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text) 18%, transparent) 50%, transparent 70%);
  animation: sweep 5s 1.5s var(--ease) infinite;
}
@keyframes sweep { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
.pulse { width: .5rem; height: .5rem; border-radius: 50%; background: var(--p2); box-shadow: 0 0 0 0 var(--p2); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 .5rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.display {
  margin: 0; font-weight: 560; letter-spacing: -.045em; line-height: .92;
  font-size: clamp(3.1rem, 10.5vw, 9.5rem);
}
.display .line { display: block; }
.display .serif { font-weight: 400; letter-spacing: -.02em; color: var(--accent); padding-right: .12em; }
.display .w { display: inline-block; animation: focus-in 1.1s var(--ease) both; }
/* the headline is the largest paint: it starts visible (blurred) rather than transparent, so it counts at once */
@keyframes focus-in { from { filter: blur(14px); transform: translateY(.2em); opacity: .35; } }
.display .line:first-child .w:nth-child(1) { animation-delay: .05s; }
.display .line:first-child .w:nth-child(2) { animation-delay: .15s; }
.display .line:first-child .w:nth-child(3) { animation-delay: .25s; }
.display .line:last-child .w:nth-child(1) { animation-delay: .4s; }
.display .line:last-child .w:nth-child(2) { animation-delay: .55s; }
@keyframes rise { to { opacity: 1; filter: blur(0); transform: none; } }

.lede { max-width: 38rem; margin: 2rem 0 2.25rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--muted); animation: focus-in 1s .3s var(--ease) both; }
.lede strong { color: var(--text); font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; gap: .75rem; animation: focus-in 1s .45s var(--ease) both; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1.4rem; border-radius: 999px;
  font: 600 .98rem/1 var(--sans); text-decoration: none; transition: transform .25s var(--ease), background .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-shine { color: var(--bg); background: var(--accent); position: relative; overflow: hidden; }
.btn-shine::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  animation: sweep 3.8s 2s var(--ease) infinite;
}
.btn-ghost { color: var(--text); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn-ghost:hover { border-color: var(--accent); }

.term {
  margin: 3.5rem 0 0; max-width: 46rem; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent);
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: focus-in 1s .6s var(--ease) both;
}
.term-head { display: flex; align-items: center; gap: .4rem; padding: .6rem .85rem; border-bottom: 1px solid var(--line); font: .75rem var(--mono); color: var(--muted); }
.term-head i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.term-head span { margin-left: .5rem; }
.term-body { padding: 1rem 1.1rem; font: .9rem/1.6 var(--mono); overflow-wrap: anywhere; display: grid; }
/* Both lines share one grid cell; the invisible ghost holds the longest command, so the box
   is always tall enough and typing never changes the page's layout. */
.term-line { grid-area: 1 / 1; }
.term-line.ghost { visibility: hidden; }
.ps { color: var(--p2); margin-right: .6rem; }
.typed { font-size: inherit; color: var(--text); }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; margin-left: 2px; background: var(--accent); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scroll-hint {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); margin: 0;
  font: .72rem var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint::after { content: ""; display: block; width: 1px; height: 2.5rem; margin: .6rem auto 0; background: linear-gradient(var(--muted), transparent); animation: drop 2s var(--ease) infinite; transform-origin: top; }
@keyframes drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 1.4rem 0; background: var(--surface); }
.track { display: flex; width: max-content; align-items: baseline; animation: marquee 38s linear infinite; }
.track > * { margin-right: 2.5rem; }
.track span { font: italic 400 clamp(2rem, 4.5vw, 3.5rem)/1 var(--serif); color: var(--text); }
.track b { font: 500 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.track b::after { content: "\2726"; margin-left: 2.5rem; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section { padding: clamp(5rem, 11vw, 9rem) var(--pad) 0; }
.sec-head { max-width: var(--max); margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.kicker { margin: 0 0 1rem; font: 500 .78rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.kicker::before { content: ""; display: inline-block; width: 1.75rem; height: 1px; background: var(--accent); vertical-align: middle; margin-right: .75rem; }
.h2 { margin: 0; max-width: 20ch; font-weight: 560; letter-spacing: -.035em; line-height: 1.02; font-size: clamp(2.2rem, 5.6vw, 4.6rem); }
.h2 .serif { color: var(--accent); font-weight: 400; }
.sub { color: var(--muted); margin: 1.25rem 0 0; font-size: 1.1rem; }

/* ---------- Bento ---------- */
.bento { max-width: var(--max); margin: 0 auto; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease), border-color .4s;
}
.card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(520px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%);
}
.card::after { /* spotlight border */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; padding: 1px; opacity: 0; transition: opacity .4s;
  background: radial-gradient(320px circle at var(--mx) var(--my), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover::before, .card:hover::after, .card:focus-within::after { opacity: 1; }
.media { position: relative; overflow: hidden; background: var(--bg); aspect-ratio: 16 / 9; border-bottom: 1px solid var(--line); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.media img.contain { object-fit: contain; padding: 1rem; }
.media img.pixel { image-rendering: pixelated; }
.card:hover .media img { transform: scale(1.04); }
.card-body { position: relative; z-index: 4; padding: clamp(1.25rem, 2.5vw, 2rem); display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.card-body > p { margin: 0; color: var(--muted); max-width: 58ch; }
.meta { margin: 0; font: 500 .75rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.num { color: var(--accent); margin-right: .6rem; }
.h3 { margin: 0; font: italic 400 clamp(2.4rem, 4.2vw, 3.6rem)/.95 var(--serif); letter-spacing: -.015em; color: var(--text); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.chips li { font: 500 .75rem var(--mono); color: var(--text); padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 55%, transparent); }
.install { display: flex; align-items: stretch; margin-top: auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.install code { flex: 1; min-width: 0; padding: .7rem .85rem; font-size: .8rem; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.copy {
  font: 600 .8rem var(--mono); cursor: pointer; color: var(--text); background: var(--surface);
  border: 0; border-left: 1px solid var(--line); padding: 0 1rem; min-width: 5.5rem; min-height: 2.75rem; transition: background .2s, color .2s;
}
.copy:hover { background: var(--raised); }
.copy[data-done] { background: var(--accent); color: var(--bg); }
.links { display: flex; gap: 1.5rem; margin: 0; font: 500 .9rem var(--mono); }
.links a { min-height: 2.75rem; min-width: 2.75rem; display: inline-flex; align-items: center; }

@media (min-width: 60rem) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; }
  .c-tree  { grid-column: span 8; }
  .c-lvl   { grid-column: span 4; grid-row: span 2; }
  .c-cube  { grid-column: span 8; flex-direction: row; }
  .c-tidal { grid-column: span 12; flex-direction: row; }
  .c-lvl .media { aspect-ratio: auto; flex: 1; min-height: 22rem; }
  .c-cube .media, .c-tidal .media { aspect-ratio: auto; flex: 0 0 48%; border-bottom: 0; border-right: 1px solid var(--line); min-height: 24rem; }
  .c-tidal .media { flex-basis: 58%; }
}

/* ---------- Theme picker ---------- */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.stage { max-width: var(--max); margin: 0 auto 2rem; display: grid; gap: .75rem; }
.stage-label { margin: 0; font: 500 .78rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stage-name { margin: 0; font-size: clamp(3rem, 9vw, 7.5rem); line-height: .95; padding-bottom: .08em; }
.stage-strip { display: grid; grid-template-columns: repeat(6, 1fr); height: .65rem; border-radius: 999px; overflow: hidden; }
.stage-strip i { background: var(--p0); transform-origin: left; animation: strip .9s var(--ease) both; }
.stage-strip i:nth-child(2) { background: var(--p1); animation-delay: .05s; }
.stage-strip i:nth-child(3) { background: var(--p2); animation-delay: .1s; }
.stage-strip i:nth-child(4) { background: var(--p3); animation-delay: .15s; }
.stage-strip i:nth-child(5) { background: var(--p4); animation-delay: .2s; }
.stage-strip i:nth-child(6) { background: var(--p5); animation-delay: .25s; }
@keyframes strip { from { transform: scaleX(0); } }

.theme-grid { max-width: var(--max); margin: 0 auto; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.tchip {
  --spin: 0deg;
  position: relative; display: flex; flex-direction: column; gap: .55rem; text-align: left; cursor: pointer;
  padding: .7rem .7rem .85rem; border-radius: 16px; isolation: isolate;
  border: 1px solid var(--tline); background: var(--tsurf); color: var(--ttext); font: 600 .95rem var(--sans);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tchip:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 22px 50px -24px var(--taccent); }
.tchip:active { transform: translateY(-1px) scale(.98); }
.tchip small { font: 500 .72rem var(--mono); color: var(--tmuted); }
/* selected: a ring of the theme's own colours turning slowly (border-box gradient behind a padding-box fill) */
.tchip[aria-pressed="true"] {
  border: 2px solid transparent; padding: calc(.7rem - 1px) calc(.7rem - 1px) calc(.85rem - 1px);
  background:
    linear-gradient(var(--tsurf), var(--tsurf)) padding-box,
    conic-gradient(from var(--spin), var(--tp0), var(--tp1), var(--tp2), var(--tp3), var(--tp4), var(--tp5), var(--tp0)) border-box;
  box-shadow: 0 24px 60px -28px var(--taccent);
  animation: spin 4s linear infinite;
}
.tchip[aria-pressed="true"]::after {
  content: "\2713  wearing"; position: absolute; top: .55rem; right: .55rem; padding: .15rem .5rem; border-radius: 999px;
  font: 600 .66rem var(--mono); color: var(--tbg); background: var(--taccent);
}
@keyframes spin { to { --spin: 360deg; } }

.mini { display: grid; grid-template-rows: auto 1fr; height: 5.6rem; border-radius: 10px; overflow: hidden; background: var(--tbg); border: 1px solid var(--tline); }
.mini-bar { display: flex; gap: 3px; padding: 4px 6px; background: var(--tsurf); }
.mini-bar i { width: 9px; height: 5px; border-radius: 2px; background: var(--tline); }
.mini-bar i.on { background: var(--taccent); width: 14px; }
.mini-win { margin: 7px 9px 9px; padding: 7px 8px; display: grid; align-content: start; gap: 5px; border-radius: 6px; border: 1.5px solid var(--taccent); background: var(--tsurf); }
.mini-win i { height: 4px; width: var(--w); border-radius: 2px; background: var(--c); transition: width .5s var(--ease); }
.tchip:hover .mini-win i:nth-child(odd) { width: calc(var(--w) * .7); }
.tchip:hover .mini-win i:nth-child(even) { width: min(100%, calc(var(--w) * 1.3)); }

/* name roll when the theme changes */
.roll { display: inline-block; animation: roll .6s var(--ease); }
.stage-name.roll { display: block; }
@keyframes roll { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } }

/* gradient words: the theme's own colours, lifted to 4.5:1 for large text */
.grad {
  background: linear-gradient(100deg, var(--l4, var(--accent)), var(--l5, var(--accent)), var(--l0, var(--accent)), var(--l1, var(--accent)), var(--l4, var(--accent)));
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pan 9s linear infinite;
}
.display .w.grad { animation: focus-in 1.1s .55s var(--ease) both, pan 9s 1.6s linear infinite; }
@keyframes pan { to { background-position: 250% 0; } }
@media (forced-colors: active) { .grad { color: CanvasText; background: none; } }

/* ---------- Principles ---------- */
.tenets { list-style: none; margin: 0 auto; padding: 0; max-width: var(--max); display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tenets li { background: var(--surface); padding: clamp(1.5rem, 3vw, 2.5rem); }
.tenets .big { display: block; font-size: 3.5rem; line-height: 1; color: var(--accent); margin-bottom: 1.5rem; }
.tenets h3 { margin: 0 0 .5rem; font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.tenets p { margin: 0; color: var(--muted); }
@media (min-width: 52rem) { .tenets { grid-template-columns: repeat(3, 1fr); } }

.caution { max-width: var(--max); margin: clamp(4rem, 8vw, 6rem) auto 0; padding: 0 var(--pad); }
.caution h2 { font-size: 1.1rem; margin: 0 0 .5rem; font-weight: 600; }
.caution p { margin: 0; max-width: 68ch; color: var(--muted); padding-left: 1.25rem; border-left: 2px solid var(--accent); }
.caution code, .tenets code { color: var(--text); background: var(--bg); padding: .1rem .35rem; border-radius: 5px; }

/* ---------- Footer ---------- */
.foot { margin-top: clamp(5rem, 10vw, 8rem); padding: 0 var(--pad) 2rem; overflow: hidden; }
.wordmark {
  margin: 0; text-align: center; line-height: .8; font-size: clamp(5rem, 24vw, 22rem); letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--text) 10%, transparent 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: .9;
}
.foot-row { max-width: var(--max); margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; font: .8rem/1.6 var(--mono); color: var(--muted); }
.foot-row p { margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Theme switch transition ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  .bar { grid-template-columns: auto 1fr auto; gap: .5rem; padding: 0 .25rem; }
  .bar-title { justify-self: center; }
  .bar .bar-link [data-theme-name] { display: none; }
  .scroll-hint { display: none; }
  .field { opacity: .45; -webkit-mask-image: linear-gradient(180deg, #000 0, transparent 30%, transparent 80%, #000); mask-image: linear-gradient(180deg, #000 0, transparent 30%, transparent 80%, #000); }
}
@media (max-width: 30rem) {
  .bar-title, .clock { display: none; } /* five workspaces + keys + theme fill a phone bar; the name is in the hero */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .display .w, .lede, .cta, .term, .reveal { opacity: 1 !important; filter: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
  .caret { display: none; }
}

/* ---------- Keyboard ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd {
  display: inline-block; min-width: 1.6em; padding: .1em .4em; text-align: center;
  font: 600 .8em/1.4 var(--mono); color: var(--text);
  background: var(--raised); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}
.keys-btn { font: inherit; background: none; border: 0; cursor: pointer; padding: 0 .25rem; }
.keys-btn kbd { font-size: .72rem; }

.keys {
  width: min(36rem, calc(100vw - 2rem)); max-height: calc(100svh - 4rem); padding: 0; overflow: auto;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.6);
}
.keys::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.keys[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.keys-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.keys-head h2 { margin: 0; font: italic 400 2rem/1 var(--serif); }
.keys-close { font: 600 .8rem var(--mono); color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; min-width: 2.75rem; min-height: 2.75rem; cursor: pointer; }
.keys table { width: 100%; border-collapse: collapse; }
.keys th, .keys td { padding: .6rem 1.4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .95rem; }
.keys th { white-space: nowrap; font-weight: 400; width: 1%; }
.keys td { color: var(--muted); }
.keys-toggle { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.4rem 0; min-height: 2.75rem; cursor: pointer; }
.keys-toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.keys-note { margin: .25rem 1.4rem 1.25rem; font-size: .85rem; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 120; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  padding: .7rem 1.1rem; border-radius: 999px; font: 500 .85rem var(--mono);
  color: var(--bg); background: var(--accent); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot-hint { margin: 0; }
@media (max-width: 40rem) { .keys-btn span { display: none; } }
@media (hover: none) and (pointer: coarse) { .keys-btn { display: none; } }

/* ---------- GitHub contributions (always GitHub's own dark black + green) ---------- */
.gh {
  --g0: #161b22; --g1: #0e4429; --g2: #006d32; --g3: #26a641; --g4: #39d353;
  max-width: var(--max); margin: 0 auto; padding: clamp(1.25rem, 3vw, 2rem);
  background: #0d1117; color: #e6edf3; border: 1px solid #30363d; border-radius: var(--radius);
  box-shadow: 0 40px 100px -50px rgba(57, 211, 83, .35);
}
.gh-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1.25rem; }
.gh-total { margin: 0; font-size: 1.05rem; }
.gh-total strong { font: italic 400 2.6rem/1 var(--serif); color: var(--g4); margin-right: .35rem; }
.gh-link { color: #9ecbff; font: 500 .9rem var(--mono); display: inline-flex; align-items: center; min-height: 2.75rem; }
.gh-scroll { overflow-x: auto; padding-bottom: .5rem; }
.gh-months { display: grid; grid-template-columns: repeat(var(--cols, 53), minmax(11px, 1fr)); gap: 3px; height: 1.2rem; font: .7rem var(--mono); color: #c9d1d9; min-width: max-content; }
.gh-grid { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-template-columns: repeat(var(--cols, 53), minmax(11px, 1fr)); gap: 3px; min-width: max-content; }
.gh-grid i { aspect-ratio: 1; }
.gh-grid i, .gh-legend i { display: block; width: 100%; border-radius: 3px; background: var(--g0); outline: 1px solid rgba(240,246,252,.05); outline-offset: -1px; }
.gh i[data-l="1"] { background: var(--g1); }
.gh i[data-l="2"] { background: var(--g2); }
.gh i[data-l="3"] { background: var(--g3); }
.gh i[data-l="4"] { background: var(--g4); }
.gh-grid i { opacity: 0; transform: scale(.4); }
.gh.in .gh-grid i { animation: blip-in .5s var(--ease) forwards; animation-delay: calc(var(--n) * 4ms); }
@keyframes blip-in { to { opacity: 1; transform: none; } }
/* busy days keep pinging, like a radar blip */
.gh-grid i[data-l="3"], .gh-grid i[data-l="4"] { position: relative; }
.gh.in .gh-grid i[data-l="3"]::after, .gh.in .gh-grid i[data-l="4"]::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px; box-shadow: 0 0 0 0 var(--g4);
  animation: ping 3.2s calc(var(--n) * 4ms + 1s) infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(57,211,83,.7); } 60%, 100% { box-shadow: 0 0 0 7px rgba(57,211,83,0); } }
.gh-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 1rem; font: .78rem var(--mono); color: #c9d1d9; }
.gh-legend { display: inline-flex; align-items: center; gap: 3px; }
.gh-legend i { width: 11px; height: 11px; }
.gh-months span { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .gh-grid i { opacity: 1; transform: none; } }
.no-js .gh-grid i { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.lost-main { min-height: 100svh; display: grid; align-content: center; padding: 4rem var(--pad); max-width: var(--max); margin: 0 auto; }
.lost .display .w, .lost .lede, .lost .cta { opacity: 1; animation: none; filter: none; transform: none; }
.lost .display .grad { animation: pan 9s linear infinite; }

/* ---------- Plugin facts ---------- */
.facts { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.2rem 0 0; font: 500 .75rem var(--mono); color: var(--muted); }
.facts:empty { display: none; }
.facts span { padding: .2rem .55rem; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid var(--line); }
.facts b { color: var(--text); font-weight: 600; }

/* Phones: skip the blur on the intro (blur on big text is costly without a fast GPU) */
@media (max-width: 40rem) {
  @keyframes focus-in { from { transform: translateY(.2em); opacity: .35; } }
}

/* ---------- Pixel wordmark: Instrument Serif italic, sampled onto a pixel grid ---------- */
.wordmark-wrap { position: relative; }
.wordmark-px { display: none; margin: 0 auto; cursor: crosshair; }
.px-ready .wordmark { visibility: hidden; position: absolute; inset: 0; } /* keeps the text as the no-JS fallback */
.px-ready .wordmark-px { display: block; }

/* Outside links open in a new tab; a small arrow says so (screen readers get the words) */
a[target="_blank"]:not(.btn)::after { content: "\2197"; display: inline-block; margin-left: .2em; font-size: .85em; text-decoration: none; opacity: .8; }

/* ---------- Live plugin cards and badges ---------- */
.facts .badge { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.facts .badge b { color: var(--bg); }
.media-blank { width: 100%; height: 100%; min-height: 12rem; background:
  repeating-linear-gradient(90deg, color-mix(in srgb, var(--p4) 18%, transparent) 0 10px, transparent 10px 14px),
  repeating-linear-gradient(0deg, color-mix(in srgb, var(--p5) 14%, transparent) 0 10px, transparent 10px 14px); }
@media (min-width: 60rem) {
  .c-new { grid-column: span 6; }
  .odd-new .c-new:last-child { grid-column: span 12; flex-direction: row; }
  .odd-new .c-new:last-child .media { aspect-ratio: auto; flex: 0 0 48%; border-bottom: 0; border-right: 1px solid var(--line); min-height: 20rem; }
}

/* ---------- Hover clips: ~3 s of the plugin in action, then back to the still ---------- */
.hover-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease); background: var(--bg); }
#omalvl .hover-clip { object-fit: contain; padding: 1rem; }
#tidal .hover-clip { image-rendering: pixelated; }
.card.playing .hover-clip { opacity: 1; }
