/* Direction 4 — GRADIENT (token-stream, themeable) */

/* THEME: NOIR — warm-black, chartreuse (kept for reference) */
.gr-theme-noir {
  --bg: #11100d;
  --bg-2: #181613;
  --ink: #ece8df;
  --ink-2: #b3aea0;
  --ink-dim: #6b6557;
  --ink-faint: #2c2924;
  --rule: #25221c;
  --acc: #a8ff60;
  --acc-2: #ff9966;
  --acc-3: #ffd166;
  --noise-a: rgba(168, 255, 96, 0.05);
  --noise-b: rgba(255, 153, 102, 0.04);
}

/* THEME: BONE — bone-white paper, deep slate ink, oxidized-orange accent.
   Daylit cousin of Noir. Reads as a research notebook page. */
.gr-theme-bone {
  --bg: #f4ede0;
  --bg-2: #ebe2cf;
  --ink: #1a1a17;
  --ink-2: #4a4943;
  --ink-dim: #847f70;
  --ink-faint: #c2bba7;
  --rule: #d8cfb8;
  --acc: #c44a1a;        /* burnt orange — high-contrast on bone */
  --acc-2: #2540a8;      /* deep ink blue */
  --acc-3: #6b7a1e;      /* olive */
  --noise-a: rgba(196, 74, 26, 0.07);
  --noise-b: rgba(37, 64, 168, 0.05);
}

/* THEME: SAGE — soft eucalyptus paper, deep forest ink, terracotta accent.
   Calmer, more organic. Less "screen", more printed. */
.gr-theme-sage {
  --bg: #e7e8dc;
  --bg-2: #dde0cf;
  --ink: #15201a;
  --ink-2: #3b463e;
  --ink-dim: #6b746a;
  --ink-faint: #b6bcae;
  --rule: #c8ceba;
  --acc: #b54a2a;        /* terracotta */
  --acc-2: #2d5a3d;      /* forest */
  --acc-3: #6e3a2b;      /* umber */
  --noise-a: rgba(181, 74, 42, 0.07);
  --noise-b: rgba(45, 90, 61, 0.05);
}

/* THEME: GLACIER — pale blue-grey paper, ink, electric magenta + cobalt.
   Coolest of the three; closest in tonal contrast to Noir without being dark. */
.gr-theme-glacier {
  --bg: #eaecef;
  --bg-2: #dee1e7;
  --ink: #0e1116;
  --ink-2: #353a44;
  --ink-dim: #6a7180;
  --ink-faint: #b6bcc8;
  --rule: #c7ccd6;
  --acc: #d11a6b;        /* electric magenta */
  --acc-2: #1d4ed8;      /* cobalt */
  --acc-3: #047857;      /* emerald */
  --noise-a: rgba(209, 26, 107, 0.07);
  --noise-b: rgba(29, 78, 216, 0.05);
}

.gr-root {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  padding: 0 56px;
  min-height: 100%;
  position: relative;
}
.gr-root a { color: inherit; }
.gr-noise {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 80% 0%, var(--noise-a), transparent 70%),
    radial-gradient(ellipse 800px 600px at 20% 30%, var(--noise-b), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.gr-root > *:not(.gr-noise) { position: relative; z-index: 1; }

/* HEADER */
.gr-header {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.gr-mark { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.gr-mark-glyph { color: var(--acc); font-size: 18px; }
.gr-nav { display: flex; justify-content: center; gap: 28px; color: var(--ink-2); }
.gr-nav a:hover { color: var(--acc); }
.gr-status {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  color: var(--ink-2); font-size: 12px;
}
.gr-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc); display: inline-block;
  box-shadow: 0 0 12px var(--acc);
  animation: gr-pulse 1.6s ease-in-out infinite;
}
@keyframes gr-pulse { 50% { opacity: 0.4; transform: scale(0.85); } }

/* HERO */
.gr-hero {
  padding: 80px 0 96px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
}
.gr-hero-meta { color: var(--acc); font-size: 12px; letter-spacing: 0.04em; grid-column: 1 / -1; margin-bottom: 32px; }
.gr-headline {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(48px, 6.4vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  grid-column: 1;
  text-wrap: balance;
  min-height: 2.6em;
}
.gr-stream { display: inline; }
.gr-tok {
  background: linear-gradient(transparent 75%, color-mix(in srgb, var(--acc) calc(var(--p, 0.5) * 22%), transparent) 75%);
  animation: gr-tok-in 0.32s ease-out both;
  display: inline;
}
@keyframes gr-tok-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(0.1em); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
.gr-cursor {
  display: inline-block;
  width: 0.42em;
  height: 0.86em;
  background: var(--acc);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: gr-blink 0.85s steps(2) infinite;
  box-shadow: 0 0 12px color-mix(in srgb, var(--acc) 60%, transparent);
}
@keyframes gr-blink { to { opacity: 0; } }

/* PROBABILITY GUTTER */
.gr-gutter {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 14px 16px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 240px;
}
.gr-gutter-h {
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule);
}
.gr-gutter-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  transition: opacity 0.4s;
}
.gr-gutter-p { color: var(--acc); font-variant-numeric: tabular-nums; }
.gr-gutter-bar {
  height: 4px; background: var(--rule); position: relative; border-radius: 1px; overflow: hidden;
}
.gr-gutter-bar > span {
  position: absolute; inset: 0 auto 0 0;
  background: var(--acc);
  display: block;
}
.gr-gutter-tok { color: var(--ink-2); }

/* BIO */
.gr-bio-grid {
  grid-column: 1 / -1;
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
}
.gr-bio {
  display: flex; flex-direction: column; gap: 18px;
  font-size: 16px; line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
  font-family: 'Inter', system-ui, sans-serif;
}
.gr-bio p { font-family: inherit; }
.gr-acc { color: var(--ink); font-weight: 500; }
.gr-em { color: var(--acc-3); }
.gr-link {
  color: var(--ink); border-bottom: 1px solid var(--acc); padding-bottom: 1px;
  transition: color 0.2s;
}
.gr-link:hover { color: var(--acc); }
.gr-id {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 16px 18px;
  font-size: 12px;
  align-self: start;
}
.gr-id-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
  gap: 12px;
}
.gr-id-row:last-child { border-bottom: 0; }
.gr-id-row > span:first-child { color: var(--ink-dim); letter-spacing: 0.08em; }
.gr-id-row > span:last-child { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }

/* SECTIONS */
.gr-section { padding: 88px 0; border-bottom: 1px solid var(--rule); }
.gr-section-head {
  display: flex; align-items: baseline; gap: 18px; margin-bottom: 48px;
}
.gr-section-num { color: var(--acc); font-size: 13px; letter-spacing: 0.06em; }
.gr-section-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 44px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.gr-section-link { margin-left: auto; color: var(--ink-2); font-size: 12px; }
.gr-section-link:hover { color: var(--acc); }

/* PACKAGES */
.gr-pkg { list-style: none; }
.gr-pkg li { border-top: 1px solid var(--rule); }
.gr-pkg li:last-child { border-bottom: 1px solid var(--rule); }
.gr-pkg a {
  display: grid;
  grid-template-columns: 50px 220px 1fr 24px;
  gap: 24px;
  padding: 20px 4px;
  align-items: center;
  transition: padding-left 0.2s, background 0.2s;
}
.gr-pkg a:hover { background: var(--bg-2); padding-left: 16px; }
.gr-pkg a:hover .gr-pkg-name { color: var(--acc); }
.gr-pkg-i { color: var(--ink-faint); font-size: 12px; }
.gr-pkg-name { font-weight: 500; font-size: 15px; transition: color 0.2s; }
.gr-pkg-desc { color: var(--ink-2); font-size: 13px; }
.gr-pkg-arrow { color: var(--ink-dim); text-align: right; }

/* PUBS */
.gr-pubs { list-style: none; }
.gr-pubs li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.gr-pubs li:last-child { border-bottom: 1px solid var(--rule); }
.gr-pub-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.gr-pub-yr {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--ink);
  line-height: 1;
}
.gr-pub-c { color: var(--acc); font-size: 11px; letter-spacing: 0.06em; }
.gr-pub-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 6px;
  text-wrap: balance;
}
.gr-pub-meta { color: var(--ink-2); font-size: 12px; margin-bottom: 8px; }
.gr-dim { color: var(--ink-dim); }
.gr-pub-links { display: flex; gap: 12px; font-size: 11px; }
.gr-pub-links a { color: var(--acc); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.gr-pub-links a:hover { border-bottom-color: var(--acc); }

.gr-toggle {
  margin-top: 28px; color: var(--acc); font-size: 13px; padding: 8px 0;
}
.gr-toggle:hover { text-decoration: underline; }

/* CONTACT */
.gr-contact { padding: 96px 0; border-bottom: 1px solid var(--rule); }
.gr-elsewhere {
  display: flex; gap: 32px;
  font-size: 13px; letter-spacing: 0.04em;
  color: var(--ink-2);
}
.gr-elsewhere a:hover { color: var(--acc); }

.gr-footer {
  display: flex; justify-content: space-between;
  padding: 24px 0;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}

@media (max-width: 1100px) {
  .gr-hero { grid-template-columns: 1fr; }
  .gr-bio-grid { grid-template-columns: 1fr; }
}
