/* ============================================================
   Bhargav Vivekanandan — personal site
   Art direction: "Signal & Pigment"
   Ink-olive ground, vermilion accent from his acrylic palette,
   cool cyan reserved for the technical half.
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=zodiak@400,700,701,301,300,401&f[]=satoshi@400,500,700,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Type scale ---------- */
:root {
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6.5vw, 7rem);

  --space-1: .25rem;  --space-2: .5rem;   --space-3: .75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;

  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --measure: 62ch;
  --gutter: clamp(var(--space-5), 5vw, var(--space-20));
  --maxw: 1280px;
  --radius: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Colour: dark is the primary mood ---------- */
:root,
[data-theme='dark'] {
  --bg:          oklch(0.155 0.012 145);
  --bg-deep:     oklch(0.115 0.010 145);
  --surface:     oklch(0.205 0.014 145);
  --surface-2:   oklch(0.255 0.016 145);
  --line:        oklch(0.32 0.014 145);
  --line-soft:   oklch(0.26 0.012 145);
  --text:        oklch(0.945 0.008 90);
  --text-muted:  oklch(0.705 0.014 100);
  --text-faint:  oklch(0.545 0.014 110);
  --accent:      oklch(0.655 0.175 38);   /* vermilion */
  --accent-soft: oklch(0.655 0.175 38 / .14);
  --tech:        oklch(0.795 0.095 205);  /* cyan — technical half only */
  --ochre:       oklch(0.775 0.115 78);
  --shadow: 0 1px 2px oklch(0 0 0 / .5), 0 12px 32px -12px oklch(0 0 0 / .6);
}

[data-theme='light'] {
  --bg:          oklch(0.972 0.010 88);
  --bg-deep:     oklch(0.945 0.014 86);
  --surface:     oklch(0.995 0.004 88);
  --surface-2:   oklch(0.935 0.014 86);
  --line:        oklch(0.845 0.016 86);
  --line-soft:   oklch(0.895 0.012 86);
  --text:        oklch(0.205 0.020 140);
  --text-muted:  oklch(0.435 0.020 130);
  --text-faint:  oklch(0.575 0.018 125);
  --accent:      oklch(0.525 0.175 36);
  --accent-soft: oklch(0.525 0.175 36 / .10);
  --tech:        oklch(0.475 0.095 220);
  --ochre:       oklch(0.585 0.115 72);
  --shadow: 0 1px 2px oklch(0.2 0.02 130 / .07), 0 12px 28px -14px oklch(0.2 0.02 130 / .18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: oklch(0.98 0 0); }

.skip {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--accent); color: #fff; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius); font-size: var(--text-sm); font-weight: 700;
  transition: top .2s var(--ease);
}
.skip:focus { top: var(--space-4); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }

/* ---------- Typography helpers ---------- */
h1, h2, h3, h4 { font-weight: 400; line-height: 1.08; text-wrap: balance; }
p { text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: '';
  width: var(--space-8);
  height: 1px;
  background: var(--accent);
  flex: none;
}
.eyebrow--tech::before { background: var(--tech); }

.h-section {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  margin-top: var(--space-5);
  letter-spacing: -.015em;
}
.h-sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.lede {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 56ch;
  font-weight: 400;
}
.prose { max-width: var(--measure); color: var(--text-muted); }
.prose p + p { margin-top: var(--space-4); }
.prose strong { color: var(--text); font-weight: 700; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .04em;
  color: var(--text-faint);
}

.link {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.link:hover { color: var(--accent); }

.link-out {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-1);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link-out:hover { color: var(--accent); border-color: var(--accent); }
.link-out svg { transition: transform .25s var(--ease); }
.link-out:hover svg { transform: translate(2px, -2px); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
