/* ============================================================
   onkar muḷē — v2
   A mathematically-set personal site.
   tokens · scale · grid · components
   ============================================================ */

/* ---- 1. tokens ----------------------------------------------- */
:root {
  /* color — sampled & harmonized from the reference sky */
  --ink-deep:   #0a1834;
  --ink:        #142447;
  --ink-soft:   #4a5876;
  --ink-mute:   #8693b1;

  --blue-night: #0f2557;
  --blue-deep:  #1a3a7c;
  --blue:       #2e5aa8;
  --blue-mid:   #4d76b8;
  --blue-soft:  #7d9ed1;
  --blue-pale:  #c5d3ea;
  --blue-tint:  #e8eef8;

  --paper:      #f8f6f0;   /* warm ivory ground */
  --paper-2:    #f1ede0;
  --rule:       rgba(20, 36, 71, 0.10);
  --rule-soft:  rgba(20, 36, 71, 0.05);

  /* type — modular scale, ratio 1.333 (perfect fourth) */
  --t-mono:    11px;
  --t-micro:   12px;
  --t-small:   14px;
  --t-body:    17px;
  --t-lede:    21px;
  --t-h4:      24px;
  --t-h3:      32px;
  --t-h2:      48px;
  --t-h1:      72px;
  --t-display: clamp(72px, 13vw, 184px);

  /* baseline (8px grid) */
  --u: 8px;

  /* layout */
  --gutter: clamp(24px, 5vw, 88px);
  --measure: 36rem;            /* ~640px reading column */
  --container: 1280px;
  --marker-col: 144px;

  /* fonts */
  --f-display: var(--tw-f-display, 'Instrument Serif'), Georgia, serif;
  --f-body:    var(--tw-f-body, 'Newsreader'), Georgia, serif;
  --f-mono:    'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* easings */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- 2. reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--blue-deep); color: var(--paper); }

/* ---- 3. base ------------------------------------------------- */
body {
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: calc(28 / 17);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

/* numerals: tabular, lining */
.tnum, time, .num { font-variant-numeric: tabular-nums lining-nums; }

/* ---- 4. links ------------------------------------------------ */
a {
  color: var(--blue-deep);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 200ms var(--ease), color 200ms var(--ease);
  padding-bottom: 1px;
}
a:hover { color: var(--blue); background-size: 100% 2px; }
a.plain { background-image: none; padding-bottom: 0; }
a.plain:hover { color: var(--blue); }

/* ---- 5. type --------------------------------------------------*/
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-deep);
  margin: 0;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 { font-size: var(--t-h1);  line-height: 1.04; }
h2 { font-size: var(--t-h2);  line-height: 1.05; }
h3 { font-size: var(--t-h3);  line-height: 1.12; }
h4 { font-size: var(--t-h4);  line-height: 1.25; }

p { margin: 0 0 calc(var(--u) * 3); text-wrap: pretty; }

.lede {
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-lede);
  line-height: calc(32 / 21);
  color: var(--ink);
  letter-spacing: -0.005em;
}

em, i { font-style: italic; }

.mono, .meta {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.meta a { color: inherit; }

/* ---- 6. layout primitives -----------------------------------*/
.shell {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- 7. nav (sticky, transparent over hero) -----------------*/
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: calc(var(--u) * 3) 0;
  mix-blend-mode: normal;
  color: var(--paper);
  transition: color 300ms var(--ease), background 300ms var(--ease);
}
.nav.is-light {
  color: var(--ink-soft);
  background: rgba(248, 246, 240, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--u) * 4);
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-mark { display: inline-flex; align-items: center; gap: 10px; }
.nav-mark .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.nav-links { display: flex; gap: calc(var(--u) * 4); }
.nav-links a { color: inherit; opacity: 0.75; background: none; padding: 0; }
.nav-links a:hover { opacity: 1; }

/* ---- 8. hero (the sky) --------------------------------------*/
.hero {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
  display: grid;
  grid-template-rows: 1fr auto;
}

.hero-sky {
  position: absolute;
  inset: -10% -5% -5%;
  z-index: -1;
  background:
    radial-gradient(120% 65% at 72% 18%, rgba(255, 248, 225, 0.18) 0%, rgba(255, 248, 225, 0) 38%),
    radial-gradient(80% 50% at 20% 110%, rgba(168, 190, 219, 0.35) 0%, rgba(168, 190, 219, 0) 60%),
    linear-gradient(
      180deg,
      #0c1e4a 0%,
      #14306b 18%,
      #1d4189 38%,
      #2e5aa8 58%,
      #5380c0 78%,
      #8caed8 94%,
      #b8cce5 100%
    );
  background-size: 100% 100%, 100% 100%, 100% 110%;
  animation: drift 38s ease-in-out infinite alternate;
  filter: saturate(108%);
}

/* a very faint warm sun-haze */
.hero-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(220px 220px at 72% 22%, rgba(255, 243, 215, 0.42) 0%, rgba(255, 243, 215, 0) 70%);
  mix-blend-mode: screen;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes drift {
  0%   { background-position: 0% 0%, 0% 0%, 50% 30%; transform: translate3d(0, 0, 0) scale(1.02); }
  100% { background-position: 0% 0%, 0% 0%, 50% 65%; transform: translate3d(0, 0, 0) scale(1.06); }
}

/* subtle film grain */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* hero content */
.hero-content {
  align-self: end;
  padding: 0 var(--gutter) calc(var(--u) * 16);
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.hero-meta-top {
  position: absolute;
  top: calc(var(--u) * 9);
  left: var(--gutter); right: var(--gutter);
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 246, 240, 0.65);
  pointer-events: none;
}
.hero-meta-top > div { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.hero-meta-top > div:first-child { text-align: left; }

.hero-display {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
  margin: 0;
}

.hero-display .roman { font-style: normal; }

.hero-tagline {
  margin-top: calc(var(--u) * 4);
  max-width: 30rem;
  color: rgba(248, 246, 240, 0.85);
  font-size: var(--t-body);
  line-height: 1.55;
}

.hero-scroll {
  position: absolute;
  bottom: calc(var(--u) * 4);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(248, 246, 240, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.hero-scroll::after {
  content: "";
  width: 1px;
  height: 28px;
  background: currentColor;
  animation: scrollPulse 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.2); opacity: 0.3; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* horizon rule between hero and body */
.horizon {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-deep) 50%, transparent);
  opacity: 0.4;
}

/* ---- 9. section system --------------------------------------*/
.section {
  display: grid;
  grid-template-columns: var(--marker-col) minmax(0, 1fr);
  gap: calc(var(--u) * 8);
  padding: calc(var(--u) * 24) 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.section:first-of-type { border-top: 0; }

.sec-marker {
  position: sticky;
  top: calc(var(--u) * 12);
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1);
}
.sec-marker .num { color: var(--blue-deep); }
.sec-marker .coord { color: var(--ink-mute); margin-top: calc(var(--u) * 2); font-size: 10px; }

.sec-body { max-width: var(--measure); }

.sec-eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: calc(var(--u) * 2);
}

.sec-title {
  margin-bottom: calc(var(--u) * 6);
  font-style: italic;
}

/* ---- 10. about ---------------------------------------------*/
.about p {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--ink);
}
.about p.kicker { font-size: var(--t-mono); line-height: 1; }
.dropcap {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 4.6em;
  line-height: 0.86;
  float: left;
  padding: 6px 12px 0 0;
  margin-top: 4px;
  color: var(--blue-deep);
}

/* ---- 11. dated lists (writing, projects, books) -----------*/
.year {
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-h3);
  color: var(--blue-deep);
  margin: calc(var(--u) * 6) 0 calc(var(--u) * 2);
  letter-spacing: -0.01em;
}
.year:first-child { margin-top: 0; }

.list { list-style: none; padding: 0; margin: 0; }

.row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: calc(var(--u) * 3);
  padding: calc(var(--u) * 2) 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 200ms var(--ease);
  align-items: baseline;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(46, 90, 168, 0.035); }

.row .when {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  white-space: nowrap;
}

.row .what {
  display: block;
}
.row .what .title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--t-lede);
  line-height: 1.25;
  color: var(--ink-deep);
}
.row .what a.title {
  background: none; padding: 0;
}
.row .what a.title:hover { color: var(--blue); }
.row .what .note {
  display: block;
  margin-top: 4px;
  font-size: var(--t-small);
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---- 12. inline things --------------------------------------*/
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-deep);
}
.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: calc(var(--u) * 2); }
.tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 3px 8px;
  border: 1px solid var(--blue-pale);
  background: rgba(46, 90, 168, 0.04);
  border-radius: 999px;
}

/* ---- 13. now (paragraphs grouped) ---------------------------*/
.now-group + .now-group { margin-top: calc(var(--u) * 5); }
.now-group h4 {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: calc(var(--u) * 2);
}

/* ---- 14. elsewhere -----------------------------------------*/
.elsewhere {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--u) * 3) calc(var(--u) * 6);
}
.elsewhere .pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: calc(var(--u) * 1.5) 0;
  border-top: 1px solid var(--rule-soft);
}
.elsewhere .pair .k {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.elsewhere .pair .v { font-size: var(--t-body); }

/* ---- 15. colophon footer -----------------------------------*/
.colophon {
  background: var(--ink-deep);
  color: var(--blue-pale);
  padding: 0;
  margin-top: calc(var(--u) * 16);
  position: relative;
  overflow: hidden;
}
.colophon .stripe {
  height: 4px;
  background: linear-gradient(90deg,
    #0c1e4a 0%, #1d4189 30%, #2e5aa8 55%, #6486c4 80%, #b8cce5 100%);
  margin: 0;
}
.colo-bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.colo-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 230, 250, 0.55);
}
.colo-copy {
  display: flex;
  align-items: center;
  padding: calc(var(--u) * 1.5) 0;
}
.colo-socials {
  display: flex;
  align-items: stretch;
}
.colo-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(220, 230, 250, 0.45);
  background: none;
  padding: 0;
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
.colo-socials a:last-child { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.colo-socials a:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}
.colo-socials svg { width: 15px; height: 15px; display: block; }

/* the monumental wordmark — full name, centered, generous breathing room */
.wordmark {
  position: relative;
  width: 100%;
  height: clamp(120px, 20vw, 280px);
  overflow: hidden;
  padding: calc(var(--u) * 5) var(--gutter) calc(var(--u) * 3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wordmark span {
  font-family: var(--f-display);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(56px, 13vw, 184px);
  line-height: 1;
  letter-spacing: -0.018em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  color: transparent;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.32) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---- 16. responsive ---------------------------------------*/
@media (max-width: 800px) {
  :root {
    --t-h1: 44px;
    --t-h2: 36px;
    --t-h3: 26px;
    --t-lede: 19px;
    --marker-col: 0px;
  }
  .section {
    grid-template-columns: 1fr;
    gap: calc(var(--u) * 4);
    padding: calc(var(--u) * 16) 0;
  }
  .sec-marker { position: static; flex-direction: row; gap: 16px; align-items: baseline; }
  .sec-marker .coord { margin: 0; }
  .nav-links { gap: calc(var(--u) * 2.5); }
  .nav-links .hide-sm { display: none; }
  .row { grid-template-columns: 4.5rem 1fr; gap: calc(var(--u) * 2); }
  .elsewhere { grid-template-columns: 1fr; }
  .hero-content { padding-bottom: calc(var(--u) * 12); }
  .colo-bar-inner { flex-direction: column; gap: 0; }
  .colo-copy { font-size: 10px; padding: 14px 0; }
  .colo-socials { border-top: 1px solid rgba(255,255,255,0.08); }
  .colo-socials a { flex: 1; height: 44px; border-left: 1px solid rgba(255,255,255,0.08); }
  .colo-socials a:first-child { border-left: 0; }
  .colo-socials a:last-child { border-right: 0; }
}

@media (max-width: 480px) {
  .hero-meta-top { flex-direction: column; gap: calc(var(--u) * 1.5); }
  .hero-meta-top > div { text-align: left; }
}

/* ---- 17. theme variants (via tweaks) ----------------------*/
[data-mood="twilight"] .hero-sky {
  background:
    radial-gradient(120% 60% at 80% 22%, rgba(255, 200, 160, 0.30) 0%, rgba(255, 200, 160, 0) 40%),
    linear-gradient(180deg, #0a0f3a 0%, #1a1f5e 25%, #3b2e7e 50%, #6b3a86 72%, #c4708e 92%, #ecc7a8 100%);
}
[data-mood="dawn"] .hero-sky {
  background:
    radial-gradient(120% 60% at 28% 24%, rgba(255, 220, 200, 0.40) 0%, rgba(255, 220, 200, 0) 45%),
    linear-gradient(180deg, #1e2a6b 0%, #3046a0 25%, #5773bf 50%, #8b9bd0 72%, #d4c4b8 92%, #f0d4c0 100%);
}
[data-mood="midnight"] .hero-sky {
  background:
    radial-gradient(50% 30% at 50% 20%, rgba(180, 200, 240, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #02061f 0%, #050e3a 30%, #0a1a5c 60%, #1a2f7c 85%, #2a4598 100%);
}

[data-ground="white"] { --paper: #ffffff; --paper-2: #f6f7fb; --rule: rgba(20,36,71,0.08); --rule-soft: rgba(20,36,71,0.04); }

/* ---- 18. utility ------------------------------------------*/
.reveal { /* no-op: content is visible by default. JS may still animate but never hide. */ }

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