/* =====================================================================
   JT | JAYDIP TADVI — MAIN STYLES
   Palette: #171717 (charcoal) · #06110C (forest) · #A31C1B (crimson)
   ===================================================================== */
:root {
  --ink: #171717;
  --forest: #06110C;
  --crimson: #A31C1B;
  --paper: #F1EEE8;
  --mute: #9AA39D;
  --line: rgba(241, 238, 232, .14);
  --line-strong: rgba(241, 238, 232, .28);


  --f-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 3.2vw, 44px);
  --header-h: 72px;
  --radius: 20px;

  /* animation (js/main.js overwrites these from config.js) */
  --dur: 900ms;
  --stagger: 90ms;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--forest);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--crimson); color: var(--paper); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; }
.section { padding: clamp(72px, 10vw, 140px) var(--gutter); position: relative; }
.section--ink { background: var(--ink); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--crimson); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line-strong);
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease), color .35s var(--ease);
}
.btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn-primary:hover { background: #bb2321; border-color: #bb2321; transform: translateY(-2px); }
.btn-ghost { background: rgba(6, 17, 12, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--paper); transform: translateY(-2px); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header::before { /* soft scrim so white text always reads over the hero */
  content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 17, 12, .55), rgba(6, 17, 12, 0));
  transition: opacity .4s;
}
.site-header.is-scrolled, body:not([data-page="home"]) .site-header {
  background: rgba(6, 17, 12, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header.is-scrolled::before, body:not([data-page="home"]) .site-header::before { opacity: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.brand-text { font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; font-weight: 500; }
.mark {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  border: 1px solid var(--crimson); background: var(--ink);
  display: inline-grid; place-items: center;
  font-family: var(--f-display); font-style: italic; font-size: 13px; line-height: 1; letter-spacing: -.02em;
}
.mark span { transform: translateY(-1px); }

.nav { display: flex; gap: clamp(18px, 2.4vw, 36px); }
.nav a, .nav-panel a.nav-link {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(241, 238, 232, .78); position: relative; padding: 6px 0; transition: color .3s;
}
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--crimson); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-action { justify-self: end; display: flex; align-items: center; gap: 10px; }
.header-action .btn { min-height: 38px; padding: 0 18px; font-size: 12px; font-family: var(--f-mono); letter-spacing: .14em; text-transform: uppercase; background: rgba(6, 17, 12, .4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.header-action .btn:hover { border-color: var(--crimson); background: var(--crimson); }

.burger { display: none; width: 44px; height: 44px; border: 0; background: none; position: relative; margin-right: -10px; }
.burger span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--paper); transition: transform .45s var(--ease), opacity .3s; }
.burger span:nth-child(1) { top: 16px; } .burger span:nth-child(2) { top: 22px; } .burger span:nth-child(3) { top: 28px; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-panel {
  position: fixed; inset: 0; z-index: 55; background: var(--forest);
  padding: calc(var(--header-h) + 28px) var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s;
}
.menu-open .nav-panel { opacity: 1; visibility: visible; }
.menu-open { overflow: hidden; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; }
.nav-panel li { border-bottom: 1px solid var(--line); overflow: hidden; }
.nav-panel a.nav-link { display: block; font-family: var(--f-display); font-size: clamp(38px, 11vw, 60px); letter-spacing: -.01em; text-transform: none; padding: 14px 0; color: var(--paper);
  transform: translateY(100%); transition: transform .7s var(--ease); transition-delay: calc(var(--i) * 60ms + 120ms); }
.menu-open .nav-panel a.nav-link { transform: none; }
.nav-panel-foot { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--mute); text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #171717, var(--forest));
  display: flex; flex-direction: column;
}
.hero-type {
  position: absolute; left: 0; right: 0; top: clamp(70px, 11vh, 140px); z-index: 1;
  text-align: center; white-space: nowrap; pointer-events: none; user-select: none;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(120px, 19.5vw, 360px); line-height: .84; letter-spacing: -.035em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .10);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%);
          mask-image: linear-gradient(180deg, #000 0%, #000 42%, transparent 96%);
}
.hero-type span { display: inline-block; }
.hero::after { /* readability scrim: forest at the bottom and left */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(6, 17, 12, .92) 0%, rgba(6, 17, 12, .55) 32%, rgba(6, 17, 12, 0) 62%),
    linear-gradient(90deg, rgba(6, 17, 12, .55) 0%, rgba(6, 17, 12, 0) 55%);
}
.hero-ui {
  position: relative; z-index: 3; flex: 1; width: 100%; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: end; gap: 40px;
  padding: calc(var(--header-h) + 40px) var(--gutter) 28px;
}
.hero-copy { max-width: 620px; }
.hero-copy .eyebrow { color: rgba(241, 238, 232, .75); }
.hero-heading { font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 5.2vw, 84px); line-height: .98; letter-spacing: -.02em; margin: 0 0 18px; }
.hero-tagline { font-family: var(--f-display); font-style: italic; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.2; margin: 0 0 10px; color: var(--paper); }
.hero-support { font-size: 15px; color: rgba(241, 238, 232, .72); margin: 0 0 30px; max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-cards { position: relative; justify-self: end; width: min(100%, 470px); height: clamp(340px, 46vh, 470px); }
.card-slot { position: absolute; }
.card-slot:nth-child(1) { left: 0; top: 0; width: 56%; height: 82%; z-index: 1; }
.card-slot:nth-child(2) { right: 0; bottom: 0; width: 56%; height: 74%; z-index: 2; }
.card {
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden;
  border-radius: var(--radius); background: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .2);
  transition: transform .6s var(--ease), border-color .4s, box-shadow .6s var(--ease);
}
.card:hover { transform: translateY(-8px); border-color: rgba(163, 28, 27, .7); box-shadow: 0 40px 70px -20px rgba(0, 0, 0, .75); }
.card-media { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 1.2s var(--ease); }
.card:hover .card-media { transform: scale(1.05); }
.card-media.is-placeholder {
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(163, 28, 27, .35), transparent 60%),
    linear-gradient(160deg, #1f1f1f, #0b1510);
}
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6, 17, 12, .9), transparent 55%); }
.card-meta { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.card-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; }
.card-caption { display: block; margin-top: 4px; font-size: 13px; color: rgba(241, 238, 232, .75); line-height: 1.35; }
.card-index { font-family: var(--f-display); font-size: 30px; line-height: 1; color: var(--crimson); }
.card-note { position: absolute; top: 14px; left: 16px; z-index: 1; font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(241, 238, 232, .5); }

.hero-strip {
  position: relative; z-index: 3; width: 100%; max-width: 1440px; margin: 0 auto;
  padding: 0 var(--gutter);
}
.hero-strip-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 0 22px; border-top: 1px solid var(--line-strong);
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
}
.hero-strip-inner > :nth-child(2) { color: rgba(241, 238, 232, .85); }
.hero-strip-inner > :nth-child(3) { justify-self: end; }
.strip-link { display: inline-flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--crimson); transition: color .3s, gap .3s; }
.strip-link:hover { color: #fff; gap: 14px; }

/* ---------- Below the fold: editorial ---------- */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; margin-bottom: clamp(40px, 6vw, 80px); align-items: start; }
.section-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(44px, 7vw, 108px); line-height: .95; letter-spacing: -.025em; margin: 0; }
.section-title em { color: var(--crimson); font-style: italic; }

/* Explore title: one phrase at a time (My identity → My interests → My journey) */
.explore-title .rotator, .explore-title .rot-item { display: block; }
.explore-title .rot-item em { color: #C9A66B; }
.explore-title .rot-line { display: block; width: 56px; height: 1px; margin-top: 26px; background: #C9A66B; }
@media (prefers-reduced-motion: no-preference) {
  html.js .explore-title .rotator { display: grid; overflow: hidden; padding: .06em .04em .2em 0; margin-bottom: -.06em; }
  html.js .explore-title .rot-item {
    grid-area: 1 / 1; opacity: 0; transform: translateY(105%);
    transition: transform .95s cubic-bezier(.65, 0, .25, 1), opacity .7s ease;
    will-change: transform, opacity;
  }
  html.js .explore-title .rot-item.is-active { opacity: 1; transform: none; }
  html.js .explore-title .rot-item.is-leaving { opacity: 0; transform: translateY(-105%); }
}
.section-lede { color: var(--mute); max-width: 54ch; margin: 18px 0 0; font-size: 17px; }

.explore-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.explore-row { border-bottom: 1px solid var(--line-strong); }
.explore-row a { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: clamp(20px, 3vw, 36px) 0; position: relative; transition: padding .5s var(--ease), color .3s; }
.explore-row a::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--crimson); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.explore-row a:hover { padding-left: 14px; }
.explore-row a:hover::before { transform: scaleX(1); }
.explore-num { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; color: var(--mute); }
.explore-title { font-family: var(--f-display); font-size: clamp(34px, 5.4vw, 76px); line-height: 1; letter-spacing: -.02em; }
.explore-text { display: block; margin-top: 8px; font-family: var(--f-body); font-size: 14px; color: var(--mute); letter-spacing: 0; }
.explore-arrow { font-size: 26px; color: var(--crimson); transition: transform .5s var(--ease); }
.explore-row a:hover .explore-arrow { transform: translate(6px, -6px); }

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.about-photo { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--ink); border: 1px solid var(--line); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.prose p { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.6; margin: 0 0 1.1em; color: rgba(241, 238, 232, .88); }
.prose p:first-child { font-family: var(--f-display); font-size: clamp(26px, 3vw, 42px); line-height: 1.2; color: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.chips li { padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.text-link { display: inline-flex; gap: 10px; margin-top: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--crimson); font-weight: 600; transition: gap .3s; }
.text-link:hover { gap: 16px; }

/* Social cards */
.social-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.social-card {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 190px; padding: 22px;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .5s var(--ease), border-color .4s, background .4s;
}
.social-card:hover { transform: translateY(-6px); border-color: var(--crimson); }
.social-top { display: flex; justify-content: space-between; align-items: center; }
.social-num { font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; color: var(--mute); }
.social-arrow { color: var(--crimson); font-size: 20px; transition: transform .5s var(--ease); }
.social-card:hover .social-arrow { transform: translate(4px, -4px); }
.social-name { font-family: var(--f-display); font-size: 34px; line-height: 1; }
.social-handle { display: block; margin-top: 8px; font-size: 13px; color: var(--mute); word-break: break-all; }
.social-card[data-needs-fix] { border-style: dashed; }

/* Projects / Memories */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card { display: flex; flex-direction: column; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .5s var(--ease), border-color .4s; }
a.project-card:hover { transform: translateY(-6px); border-color: var(--crimson); }
.project-media { aspect-ratio: 16 / 10; background: linear-gradient(160deg, #202020, #0b1510); overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
a.project-card:hover .project-media img { transform: scale(1.05); }
.project-body { padding: 20px 22px 24px; }
.project-tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--crimson); }
.project-title { font-family: var(--f-display); font-size: 30px; line-height: 1.05; margin: 6px 0 8px; }
.project-desc { margin: 0; color: var(--mute); font-size: 14.5px; }
.project-card.is-placeholder { border-style: dashed; background: transparent; }
.project-card.is-placeholder .project-media { background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px); }

.memory-grid { columns: 3; column-gap: 18px; }
.memory { break-inside: avoid; margin: 0 0 18px; border-radius: var(--radius); overflow: hidden; background: var(--ink); border: 1px solid var(--line); }
.memory img { width: 100%; height: auto; }
.memory figcaption { padding: 16px 20px 20px; }
.memory-date { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--crimson); }
.memory-title { font-family: var(--f-display); font-size: 28px; line-height: 1.05; margin: 6px 0; }
.memory-caption { margin: 0; color: var(--mute); font-size: 14.5px; }

.empty-note { padding: clamp(32px, 6vw, 72px); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--mute); text-align: center; }
.empty-note strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 4vw, 44px); color: var(--paper); margin-bottom: 8px; }
.empty-note code { font-family: var(--f-mono); font-size: .85em; color: var(--paper); }

/* Share */
.share-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line-strong); border-radius: calc(var(--radius) + 6px); background: linear-gradient(135deg, rgba(163, 28, 27, .14), transparent 55%), var(--ink); }
.share-box h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(36px, 5vw, 64px); line-height: 1; margin: 0 0 12px; letter-spacing: -.02em; }
.share-box p { margin: 0 0 22px; color: var(--mute); max-width: 46ch; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.share-status { font-family: var(--f-mono); font-size: 12px; color: var(--mute); min-height: 1.4em; margin-top: 12px; }
.qr-box { width: 176px; padding: 12px; background: #fff; border-radius: 14px; }
.qr-box svg { width: 100%; height: auto; }

/* ---------- Inner pages ---------- */
.page-hero { padding: calc(var(--header-h) + clamp(56px, 9vw, 120px)) var(--gutter) clamp(36px, 5vw, 64px); background: radial-gradient(80% 120% at 85% 0%, rgba(163, 28, 27, .16), transparent 60%), var(--forest); border-bottom: 1px solid var(--line); }
.page-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(64px, 13vw, 200px); line-height: .88; letter-spacing: -.035em; margin: 0; }
.page-sub { font-family: var(--f-display); font-style: italic; font-size: clamp(20px, 2.4vw, 30px); color: var(--mute); margin: 18px 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 88px) var(--gutter) 28px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand .brand-text { font-size: 13px; }
.footer-brand p { margin: 0; color: var(--mute); font-family: var(--f-display); font-style: italic; font-size: 22px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(241, 238, 232, .78); transition: color .3s; }
.footer-links a:hover { color: var(--crimson); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(36px, 5vw, 64px); padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.footer-bottom a:hover { color: var(--paper); }

/* Scroll anchors clear the fixed header */
[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* ---------- theme toggle ---------- */
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; color: var(--paper);
  background: rgba(6, 17, 12, .4); border: 1px solid var(--line-strong); transition: border-color .3s, background .3s; }
.theme-toggle:hover { border-color: var(--crimson); }
.theme-toggle .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mobile-ctl { display: none; }
@media (max-width: 900px) { .mobile-ctl { display: flex; align-items: center; gap: 6px; justify-self: end; } }
