/* ============================================================
   sreebalakrishnan.in — site-wide design system
   Derived from the Stories page (Spectral / Inter Tight).
   This is the canonical stylesheet. New pages should link it
   and lean on these tokens, primitives, and components rather
   than redefining their own. Page-specific CSS stays in-page.
   ============================================================ */

/* ── design tokens ─────────────────────────────────────────── */
:root {
  --paper:       #111110;
  --paper-deep:  #0D0C0B;
  --paper-card:  #1C1B19;
  --ink:         #E4DDD4;
  --ink-soft:    #9A9188;
  --ink-faint:   #625C55;
  --rust:        #8FA876;          /* sage-green accent in dark */
  --rust-soft:   rgba(143, 168, 118, 0.14);
  --rust-glow:   rgba(143, 168, 118, 0.08);
  --rule:        rgba(228, 221, 212, 0.08);
  --rule-soft:   rgba(228, 221, 212, 0.05);
  --serif: "Spectral", Georgia, serif;
  --sans:  "Inter Tight", system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --paper:      #F4EBDD;
    --paper-card: #F9F5EC;
    --paper-deep: #EADFCC;
    --ink:        #1F1611;
    --ink-soft:   #5C4B3F;
    --ink-faint:  #9A8678;
    --rust:       #9B3A1F;          /* warm rust accent in light */
    --rust-soft:  rgba(155, 58, 31, 0.10);
    --rust-glow:  rgba(155, 58, 31, 0.06);
    --rule:       rgba(31, 22, 17, 0.16);
    --rule-soft:  rgba(31, 22, 17, 0.08);
  }
  img[src*="mandala"] { filter: none !important; }
}

/* ── base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--rust); color: var(--paper); }
a {
  color: var(--rust);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--rust) 35%, transparent);
  transition: border-color .15s, color .15s;
}
a:hover { border-bottom-color: var(--rust); }

/* ── layout containers ─────────────────────────────────────── */
.shell      { max-width: 720px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 32px); }
.shell-wide { max-width: 980px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 32px); }

/* ── topbar ────────────────────────────────────────────────── */
.topbar { padding: 24px 0 0; font-family: var(--sans); font-size: 13px; font-weight: 500; }
.topbar .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.topbar a { color: var(--ink-soft); border-bottom: none; }
.topbar a:hover { color: var(--rust); }
.topbar .mark { width: 24px; height: 24px; object-fit: contain; opacity: 0.85; display: block; filter: invert(1); transition: transform .4s ease; }
.topbar .mark:hover { transform: rotate(15deg); }
@media (prefers-color-scheme: light) { .topbar .mark { filter: none; } }

/* ── masthead / section rhythm ─────────────────────────────── */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--rust);
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin-bottom: 20px;
}
h1 {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.0; letter-spacing: -0.022em;
  color: var(--ink);
}
h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.12; letter-spacing: -0.016em;
  color: var(--ink);
}
h2 em, h1 em { font-style: italic; color: var(--rust); }
h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; color: var(--ink); }
.lede {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.05rem, 2.2vw, 1.24rem); line-height: 1.55;
  color: var(--ink-soft); max-width: 60ch;
}
.lede em { font-style: italic; color: var(--ink); }
.lede strong { font-weight: 500; color: var(--ink); }

/* a thin rule + label used to open a section */
.section { padding: clamp(48px, 8vw, 84px) 0 0; }
.section-eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--rust);
  display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem;
}
.section-eyebrow::before { content: ""; width: 1.8rem; height: 1px; background: var(--rust); }

/* ── card surface (reusable) ───────────────────────────────── */
.card {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.3rem 1.4rem;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink); text-decoration: none;
  transition: border-color .2s, transform .2s, background .2s;
}
a.card { border-bottom: none; }
a.card:hover { border-color: var(--rust); transform: translateY(-2px); }
.card .kind {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.card h3 { font-size: 1.18rem; }
.card p { font-size: 0.98rem; color: var(--ink-soft); line-height: 1.55; }

/* ── footer ────────────────────────────────────────────────── */
footer {
  padding: 40px 0 56px; margin-top: clamp(48px, 7vw, 80px);
  border-top: 1px solid var(--rule-soft);
  font-family: var(--sans); font-size: 13px; color: var(--ink-faint);
}
footer a { color: var(--ink-soft); border-bottom: none; }
footer a:hover { color: var(--rust); }

/* ── progressive enhancements ──────────────────────────────── */
@view-transition { navigation: auto; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
