/* yantrik.si — one stylesheet, no build step. Tokens first; dark is the default and the brand
   ground, light is a warm paper so the gold still reads. */

@font-face { font-family: "Marcellus"; src: url("assets/fonts/Marcellus-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }

:root {
  --ground: #05070d;
  --surface: #0b1018;
  --surface-2: #10161f;
  --line: #1c2430;
  --ink: #e6eaf2;
  --ink-2: #aeb8c8;
  --mute: #7f8a9b;
  --gold: #e4b368;
  --gold-2: #f0c674;
  --gold-ink: #e4b368;
  --blue: #168cff;
  --blue-soft: rgba(22, 140, 255, .14);
  --focus: #a0e6ff;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  --display: "Marcellus", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: "Barlow", -apple-system, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --body: -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #f6f4ee;
    --surface: #ffffff;
    --surface-2: #efece4;
    --line: #dcd7cb;
    --ink: #151a22;
    --ink-2: #3e4653;
    --mute: #6a7382;
    --gold: #c08a3a;
    --gold-2: #a96e28;
    --gold-ink: #8e5a1c;
    --blue: #0f6fd6;
    --blue-soft: rgba(15, 111, 214, .10);
    --focus: #0f6fd6;
    --shadow: 0 30px 60px -30px rgba(40, 30, 10, .35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece4;
  --line: #dcd7cb;
  --ink: #151a22;
  --ink-2: #3e4653;
  --mute: #6a7382;
  --gold: #c08a3a;
  --gold-2: #a96e28;
  --gold-ink: #8e5a1c;
  --blue: #0f6fd6;
  --blue-soft: rgba(15, 111, 214, .10);
  --focus: #0f6fd6;
  --shadow: 0 30px 60px -30px rgba(40, 30, 10, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 17px/1.6 var(--body); overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--gold) 55%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .4em; border-radius: 4px; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .005em; margin: 0; color: var(--ink); text-wrap: balance; }
h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 4px; z-index: 100; }
.skip:focus { left: 8px; }

/* ── Top bar ─────────────────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--ui); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; gap: clamp(12px, 2vw, 26px); font-family: var(--ui); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.theme { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.theme:hover { color: var(--ink); border-color: var(--mute); }
:root[data-theme="light"] .theme .disc, :root:not([data-theme="dark"]) .theme .disc { fill: none; }
@media (max-width: 720px) { .nav { gap: 12px; font-size: 13px; } .nav a:nth-child(4) { display: none; } }
@media (max-width: 420px) { .nav a:nth-child(2) { display: none; } }

/* ── The story: hero + walk on the left, the instrument pinned on the right ─────────── */
.story { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); }
.walk { display: flex; flex-direction: column; }

.hero { padding: clamp(40px, 7vw, 96px) 0 24px; }
.eyebrow { font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 18px; }
.eyebrow em { font-style: italic; text-transform: none; letter-spacing: .04em; font-family: var(--display); font-size: 16px; }
h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.08; }
.lede { font-size: clamp(17px, 1.45vw, 20px); line-height: 1.55; color: var(--ink-2); margin: 26px 0 0; max-width: 56ch; }
.lede a { color: var(--ink); font-weight: 500; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.btn {
  font-family: var(--ui); font-weight: 600; font-size: 15px; letter-spacing: .02em; text-decoration: none;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--mute); }
.btn.primary { background: var(--gold); color: #1a1206; border-color: transparent; }
.btn.primary:hover { background: var(--gold-2); }
.btn.quiet { background: transparent; }
.standing { margin: 22px 0 0; font-size: 15px; color: var(--mute); max-width: 60ch; }

/* the instrument */
.instrument { margin: 40px 0 8px; display: grid; gap: 18px; }
.yantra { width: min(100%, 520px); margin: 0 auto; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); }
.yantra svg { width: 100%; height: auto; display: block; }
.layer { transition: opacity .4s ease, filter .4s ease; }
.instrument:not([data-layer=""]) .layer { opacity: .13; }
.instrument:not([data-layer=""]) #l-y { opacity: .42; }
.instrument[data-layer="you"] #l-you,
.instrument[data-layer="minds"] #l-minds,
.instrument[data-layer="memory"] #l-memory,
.instrument[data-layer="desktop"] #l-desktop,
.instrument[data-layer="gates"] #l-gates { opacity: 1; }
.instrument[data-layer="you"] #l-you { filter: drop-shadow(0 0 10px rgba(22, 140, 255, .9)) drop-shadow(0 0 26px rgba(22, 140, 255, .5)); }
.instrument[data-layer="minds"] #l-minds g { opacity: 1; }
.instrument[data-layer="minds"] #l-minds { filter: drop-shadow(0 0 6px rgba(240, 198, 116, .8)); }
.instrument[data-layer="memory"] #l-memory { filter: drop-shadow(0 0 12px rgba(22, 140, 255, .55)); }
.instrument[data-layer="desktop"] #l-desktop { filter: drop-shadow(0 0 10px rgba(228, 179, 104, .7)); }
.instrument[data-layer="gates"] #l-gates { filter: drop-shadow(0 0 8px rgba(228, 179, 104, .8)); }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legend button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-items: baseline;
  width: 100%; padding: 8px 12px 8px 10px; border-radius: 8px; cursor: pointer; border-left: 2px solid transparent;
  font-family: var(--ui); color: var(--ink-2); line-height: 1.3;
}
.legend button::before { content: counter(legend); counter-increment: legend; font-family: var(--display); font-size: 15px; color: var(--mute); }
.legend { counter-reset: legend; }
.legend b { font-weight: 600; font-size: 16px; color: var(--ink); letter-spacing: .01em; }
.legend span { display: block; grid-column: 2; font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--mute); }
.legend button:hover { background: var(--surface); }
.legend li.active button { border-left-color: var(--gold); background: var(--surface); }
.legend li.active button::before, .legend li.active b { color: var(--gold-ink); }
.legend-note { margin: 10px 0 0 10px; font-size: 13px; color: var(--mute); }

/* the walk */
.layer-section { padding: clamp(40px, 6vw, 88px) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.layer-section:first-of-type { border-top: 0; }
.num { font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 12px; }
.layer-section h2 + p, .layer-section p { max-width: 62ch; }
.layer-section h2 { margin-bottom: 18px; }
.layer-section p { margin: 0 0 16px; color: var(--ink-2); }
.links { font-family: var(--ui); font-weight: 600; font-size: 15px; }
.links a { color: var(--ink); }
.fine { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--mute); }

.shot { margin: 26px 0; }
.shot img { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #0b1018; }
.shot.strip img { border-radius: 8px; }
.shot figcaption { font-size: 14px; color: var(--mute); margin-top: 10px; max-width: 70ch; }

.code { margin: 20px 0; padding: 16px 18px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font: 14px/1.6 var(--mono); color: var(--ink); overflow-x: auto; }
.code code { background: none; padding: 0; font-size: inherit; }
.code .c { color: var(--mute); }

.repos { list-style: none; margin: 10px 0 18px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.repos li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name stars" "desc stars"; column-gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; }
.repos li:first-child { border-top: 0; }
.repos a { grid-area: name; font-family: var(--mono); font-size: 14px; text-decoration: none; color: var(--ink); }
.repos a:hover { text-decoration: underline; }
.repos span { grid-area: desc; font-size: 13px; color: var(--mute); }
.repos b { grid-area: stars; font-family: var(--ui); font-weight: 600; font-size: 16px; color: var(--gold-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.repos i { font-style: normal; font-size: 13px; margin-left: 4px; color: var(--mute); }

/* wide: two columns, the instrument pinned */
@media (min-width: 980px) {
  .story { grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr); column-gap: clamp(32px, 5vw, 80px); align-items: start; }
  .hero { grid-column: 1; grid-row: 1; }
  .walk { grid-column: 1; grid-row: 2; }
  .instrument { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; align-self: start; margin: clamp(32px, 5vw, 72px) 0 0; }
  .yantra { width: min(100%, 52vh); }
  .legend-wrap { padding: 0 6px; }
}

/* ── Flow ────────────────────────────────────────────────────────────────────────────── */
.flow { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 100px) var(--gutter); border-top: 1px solid var(--line); }
.flow h2 { margin-bottom: 30px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.steps li { position: relative; padding: 46px 18px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.steps li::before { counter-increment: step; content: "0" counter(step); position: absolute; top: 14px; left: 18px; font-family: var(--display); font-size: 15px; color: var(--gold-ink); letter-spacing: .06em; }
.steps li::after { content: ""; position: absolute; top: 24px; left: 54px; right: 18px; height: 1px; background: var(--line); }
.steps b { display: block; font-family: var(--ui); font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.steps span { font-size: 14px; color: var(--mute); line-height: 1.5; }
.steps li:nth-child(5) { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); background: var(--blue-soft); }

/* ── Tier ────────────────────────────────────────────────────────────────────────────── */
.tier { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 100px) var(--gutter); border-top: 1px solid var(--line); display: grid; gap: 36px; grid-template-columns: 1fr; align-items: start; }
.tier p { color: var(--ink-2); max-width: 62ch; }
.tier h2 { margin-bottom: 16px; }
.figures { border-collapse: collapse; width: 100%; max-width: 560px; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.figures th, .figures td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); }
.figures thead th { border-top: 0; font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: .04em; color: var(--mute); background: var(--surface-2); }
.figures tbody th { font-family: var(--mono); font-weight: 500; font-size: 14px; }
.figures td { font-size: 18px; }
.figures td:last-child { color: var(--gold-ink); font-weight: 600; }
.figures-note { font-size: 13px; color: var(--mute); margin: 10px 0 0; }
@media (min-width: 900px) { .tier { grid-template-columns: 3fr 2fr; gap: 56px; } }

/* ── Standing ────────────────────────────────────────────────────────────────────────── */
.standing-table { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 100px) var(--gutter); border-top: 1px solid var(--line); }
.standing-table .sub { color: var(--mute); margin: 8px 0 24px; }
.standing-table table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.standing-table th, .standing-table td { text-align: left; padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.standing-table thead th { border-top: 0; font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: .04em; color: var(--mute); background: var(--surface-2); }
.standing-table tbody th { font-family: var(--ui); font-weight: 600; white-space: nowrap; }
.standing-table td { color: var(--ink-2); }
@media (max-width: 640px) {
  .standing-table table, .standing-table thead, .standing-table tbody, .standing-table tr, .standing-table th, .standing-table td { display: block; }
  .standing-table thead { position: absolute; left: -9999px; }
  .standing-table tr { border-top: 1px solid var(--line); padding: 10px 0; }
  .standing-table tr:first-child { border-top: 0; }
  .standing-table th, .standing-table td { border: 0; padding: 4px 16px; }
  .standing-table tbody th { padding-top: 10px; color: var(--gold-ink); }
}

/* ── Footer ──────────────────────────────────────────────────────────────────────────── */
.foot { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) 60px; border-top: 1px solid var(--line); color: var(--mute); font-size: 15px; }
.foot p { max-width: 70ch; }
.foot-marks { display: flex; gap: 18px; margin-bottom: 18px; }
.foot a { color: var(--ink-2); }
