/* ============================================================
   Neil Todkar — site styles
   Theme via CSS custom properties; toggled with [data-theme].
   ============================================================ */

:root {
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* light (default) */
  --bg: #f6f5f2;
  --bg-elev: #ffffff;
  --bg-sunk: #eeece7;
  --fg: #16161a;
  --fg-2: #4b4b55;
  --fg-3: #7a7a86;
  --line: rgba(22, 22, 26, .10);
  --line-strong: rgba(22, 22, 26, .18);
  --accent: #d0242a;
  --accent-2: #b41d22;
  --accent-soft: rgba(208, 36, 42, .10);
  --accent-line: rgba(208, 36, 42, .32);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.12);
  --glow: rgba(208, 36, 42, .14);
  --dot: rgba(208, 36, 42, 1);
  --nav-bg: rgba(246, 245, 242, .72);
  --selection: #d0242a;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-elev: #131316;
  --bg-sunk: #08080a;
  --fg: #f2f2f4;
  --fg-2: #b0b0b8;
  --fg-3: #7c7c88;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --accent: #ff3b3b;
  --accent-2: #ff5a5a;
  --accent-soft: rgba(255, 59, 59, .10);
  --accent-line: rgba(255, 59, 59, .36);
  --on-accent: #0b0b0d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --glow: rgba(255, 59, 59, .18);
  --dot: rgba(255, 59, 59, 1);
  --nav-bg: rgba(11, 11, 13, .66);
  --selection: #ff3b3b;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--selection); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
.display { font-family: var(--font-display); line-height: 1; letter-spacing: -0.02em; }
.display em, .display .accent { font-style: italic; color: var(--accent); }
p { margin: 0; }
.muted { color: var(--fg-2); }
.small { font-size: 13.5px; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.section-head h2 { font-size: clamp(30px, 4.6vw, 48px); }
.eyebrow { display: block; margin-bottom: 14px; color: var(--accent); }
.text-link {
  font-weight: 500; font-size: 14.5px; color: var(--fg-2);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
  transition: color .25s, border-color .25s;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.arrow::after { content: " \2192"; }
.ext::after { content: " \2197"; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px; font-weight: 600; font-size: 15px;
  line-height: 1; white-space: nowrap;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s, border-color .3s, color .3s;
  will-change: transform;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px var(--glow); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 14px 40px var(--glow); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.btn-sm { padding: 10px 16px; font-size: 13.5px; border-radius: 10px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg); border-bottom: 1px solid var(--line);
  transition: background-color .35s var(--ease);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; letter-spacing: -0.01em; }
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--fg-2);
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--fg); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-links .btn { margin-left: 8px; }
.nav-actions { display: flex; align-items: center; gap: 6px; }

.theme-toggle {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: var(--fg-2);
  border: 1px solid var(--line); transition: color .2s, border-color .2s, background-color .2s;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-strong); background: var(--accent-soft); }
.theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: transform .45s var(--ease), opacity .3s; }
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.6); }
.theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(.6); }

.menu-btn { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); place-items: center; }
.menu-btn svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 18px; background: var(--bg-elev); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 10px; font-size: 15px; }
  .nav-links .btn { margin: 8px 0 0; justify-content: center; }
  .menu-btn { display: grid; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: min(100svh, 900px); display: flex; align-items: center;
  padding: 140px 0 96px; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-glow {
  position: absolute; width: 720px; height: 720px; left: -260px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 62%); filter: blur(10px);
  pointer-events: none; z-index: 1; transition: transform .25s ease-out;
}
.hero-fade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, var(--bg) 100%); }
.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero-kicker .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-soft); animation: pulse 2s infinite; }
.hero h1 { font-size: clamp(40px, 7.2vw, 96px); max-width: 21ch; }
.hero-kicker .kicker-text { font-size: 13.5px; color: var(--fg-2); letter-spacing: 0; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; animation: riseIn 1s var(--ease) both; }
.hero p.lede { max-width: 58ch; margin-top: 30px; font-size: clamp(16px, 1.9vw, 19px); color: var(--fg-2); animation: fadeUp .9s .5s var(--ease) both; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; animation: fadeUp .9s .62s var(--ease) both; }
.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--fg-3);
}
.hero-scroll .mono { font-size: 10.5px; }
.hero-scroll span:last-child { animation: nudge 1.8s infinite; }

/* Now strip */
.now-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.now-inner { display: flex; align-items: center; gap: 28px; padding: 16px var(--gutter); max-width: var(--max); margin: 0 auto; flex-wrap: wrap; }
.now-inner .mono { color: var(--accent); }
.now-list { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--fg-2); }
.now-list li { list-style: none; position: relative; }
.now-list { margin: 0; padding: 0; }
.now-list li + li::before { content: ""; position: absolute; left: -13px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--fg-3); transform: translateY(-50%); }

/* ---------- cards / lists ---------- */
.card {
  position: relative; display: block; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--bg-elev);
  transition: border-color .35s, transform .35s var(--ease), box-shadow .35s;
}
a.card:hover, .card.hoverable:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.work-list { display: flex; flex-direction: column; gap: 18px; }
.work-card { padding: clamp(24px, 3.4vw, 40px); display: grid; grid-template-columns: 64px 1fr; gap: clamp(18px, 3vw, 44px); align-items: start; }
.work-card .num { font-family: var(--font-display); font-size: clamp(30px, 4.5vw, 54px); line-height: 1; color: var(--accent); }
.work-card h3 { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 40px); line-height: 1.05; margin: 8px 0 12px; }
.work-card .sub { font-size: 15px; color: var(--fg-2); }
.work-card p.summary { margin: 0 0 18px; max-width: 70ch; color: var(--fg-2); font-size: 15.5px; }
.work-card ul.bullets { margin: 0 0 18px; padding-left: 18px; color: var(--fg-2); font-size: 14.5px; }
.work-card ul.bullets li { margin: 4px 0; }
.work-card .corner { position: absolute; top: clamp(24px, 3.4vw, 40px); right: clamp(24px, 3.4vw, 40px); color: var(--accent); font-size: 20px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent-line); color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 12.5px; color: var(--fg-2); background: var(--bg-sunk); border: 1px solid var(--line); padding: 5px 11px; border-radius: 100px; }
.link-row { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) { .work-card { grid-template-columns: 1fr; } .work-card .num { font-size: 26px; } .work-card .corner { display: none; } }

/* Writing */
.pub-list { display: grid; gap: 16px; }
.pub { padding: clamp(22px, 3vw, 34px); }
.pub .top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pub h3 { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 30px); line-height: 1.15; margin-bottom: 10px; }
.pub p { color: var(--fg-2); font-size: 15px; max-width: 74ch; }
.pub .cta { display: inline-block; margin-top: 16px; font-weight: 600; font-size: 14px; color: var(--accent); }

/* Timeline (About) */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 150px 1fr; gap: clamp(16px, 3vw, 40px); padding: 22px 0; border-top: 1px solid var(--line); transition: padding-left .3s var(--ease), border-color .3s; }
.tl-item:hover { padding-left: 8px; border-color: var(--accent-line); }
.tl-item .when { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--fg-3); padding-top: 5px; }
.tl-item h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.005em; }
.tl-item .org { color: var(--fg-2); font-size: 14.5px; margin: 2px 0 8px; }
.tl-item p { color: var(--fg-2); font-size: 14.5px; max-width: 70ch; }
@media (max-width: 640px) { .tl-item { grid-template-columns: 1fr; gap: 6px; } }

/* Award rows */
.award { display: grid; grid-template-columns: 72px 1fr; gap: clamp(16px, 3vw, 40px); padding: 22px 0; border-top: 1px solid var(--line); }
.award .year { font-family: var(--font-mono); font-size: 13px; color: var(--accent); padding-top: 4px; }
.award h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.award p { color: var(--fg-2); font-size: 14.5px; max-width: 70ch; }

/* Info grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.info { padding: 24px; }
.info .mono { margin-bottom: 12px; color: var(--accent); }
.info .big { font-size: 18px; font-weight: 600; margin-bottom: 4px; }

/* Portrait */
.portrait { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--bg-sunk); box-shadow: var(--shadow); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.65)); }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; border-radius: 24px; border: 1px solid var(--accent-line);
  padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px);
  background: radial-gradient(120% 140% at 0% 0%, var(--glow), transparent 55%), var(--bg-elev);
}
.cta-band h2 { font-family: var(--font-display); font-size: clamp(30px, 4.2vw, 46px); max-width: 24ch; margin-bottom: 16px; }
.cta-band p { max-width: 54ch; color: var(--fg-2); margin-bottom: 28px; }

/* Contact rows */
.contact-list { display: grid; gap: 14px; }
.contact-row { display: grid; grid-template-columns: 52px 1fr auto; gap: clamp(14px, 3vw, 26px); align-items: center; padding: clamp(18px, 2.4vw, 26px); }
.contact-row .icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); }
.contact-row .icon svg { width: 22px; height: 22px; }
.contact-row .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; }
.contact-row .value { font-family: var(--font-display); font-size: clamp(18px, 2.4vw, 26px); word-break: break-word; }
.contact-row .go { color: var(--accent); font-size: 20px; }
@media (max-width: 480px) { .contact-row { grid-template-columns: 44px 1fr; } .contact-row .go, .contact-row .btn { grid-column: 2; justify-self: start; } }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 44px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--fg-3); }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner nav a { color: var(--fg-2); transition: color .2s; }
.footer-inner nav a:hover { color: var(--accent); }

/* ---------- motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
@keyframes riseIn { from { opacity: 0; transform: translateY(110%); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(6px); opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* page header (inner pages) */
.page-head { position: relative; padding: clamp(130px, 16vw, 180px) 0 clamp(36px, 5vw, 60px); overflow: hidden; }
.page-head .glow { position: absolute; width: 560px; height: 560px; right: -160px; top: 20px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 62%); filter: blur(12px); pointer-events: none; }
.page-head h1 { position: relative; font-size: clamp(40px, 7.5vw, 84px); animation: fadeUp .8s .08s var(--ease) both; }
.page-head .eyebrow { animation: fadeUp .7s var(--ease) both; }
.page-head p { position: relative; max-width: 60ch; margin-top: 26px; font-size: clamp(16px, 1.9vw, 18px); color: var(--fg-2); animation: fadeUp .9s .18s var(--ease) both; }

/* two-column */
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } .two-col .portrait { max-width: 420px; } }
