/* ============================================================
   ANMOL YADAV — Portfolio
   Warm editorial theme · Cormorant Garamond (name) + Fraunces + Space Grotesk
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg:        #ecdcc4;   /* warm cream */
  --bg-2:      #f4e7d4;   /* lighter cream */
  --bg-3:      #f5dfc4;   /* apricot lower */
  --ink:       #191411;   /* near-black warm */
  --ink-soft:  #6d5f50;   /* muted brown for labels/body */
  --line:      rgba(25, 20, 17, 0.16);
  --line-soft: rgba(25, 20, 17, 0.10);
  --pill:      #1a1512;   /* dark pill */
  --pill-ink:  #f2e7d6;
  --accent:    #b4552f;   /* restrained terracotta */

  /* theme-aware extras */
  --glass:     rgba(245, 233, 215, 0.55);
  --glass-brd: rgba(255, 255, 255, 0.4);
  --card-hover:#fbf0de;
  --glow:      rgba(224, 152, 63, 0.35);
  --sun-color: #e0983f;
  --moon-color:#e9dcc4;
  --underline: #d9a400;   /* email hover underline */
  --grain-blend: multiply;
  --grain-op: 0.55;

  --maxw: 1280px;
  --gut: clamp(20px, 5vw, 80px);

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Space Grotesk", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

/* ---------- Custom cursor ---------- */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  border-radius: 50%; transform: translate(-50%, -50%);
  mix-blend-mode: difference; opacity: 0;
}
.cursor {
  width: 22px; height: 22px; border: 1.5px solid #ffffff;
  transition: width .3s var(--ease), height .3s var(--ease), background .3s var(--ease);
}
.cursor-dot { width: 4px; height: 4px; background: #ffffff; }
.cursor.is-hover { width: 40px; height: 40px; background: rgba(255,255,255,.12); }
body.cursor-ready { cursor: none; }
body.cursor-ready a, body.cursor-ready button { cursor: none; }
@media (hover: none), (max-width: 900px) {
  .cursor, .cursor-dot { display: none; }
  body.cursor-ready { cursor: auto; }
}

/* ============================================================
   PRELOADER
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 10000;
  background: #14100d; color: #efe3d1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
}
.loader__count {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 400; line-height: 1; letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.loader__pct { font-size: .55em; color: #a2917b; margin-left: 3px; }
.loader__bar { width: min(260px, 60vw); height: 1px; background: rgba(239,227,209,.2); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0%; background: #efe3d1; }
#loader.is-done { transform: translateY(-100%); transition: transform 1s var(--ease); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 2.4vw, 30px) var(--gut);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.nav__logo {
  font-family: var(--serif); font-weight: 500; font-size: 26px;
  letter-spacing: -.02em; line-height: .8; display: flex; flex-direction: column;
  mix-blend-mode: difference; color: #efe3d1;
}
.nav__logo span:last-child { padding-left: .35em; }

.nav__pill {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 30px);
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-brd);
  border-radius: 100px; padding: 10px 12px 10px 26px;
  box-shadow: 0 18px 40px -24px rgba(25,20,17,.5);
}
.nav__pill a {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink); position: relative; padding: 4px 2px; transition: opacity .3s;
}
.nav__pill a:not(.nav__resume)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--ink); transition: width .35s var(--ease);
}
.nav__pill a:not(.nav__resume):hover::after { width: 100%; }
.nav__pill a.nav__resume {
  background: var(--pill); color: var(--pill-ink);
  padding: 12px 24px !important; border-radius: 100px;
  transition: transform .35s var(--ease), opacity .35s;
}
.nav__pill a.nav__resume:hover { transform: translateY(-1px); opacity: .88; }

.nav__menu {
  display: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--pill); border: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav__menu span { width: 18px; height: 1.5px; background: var(--pill-ink); transition: transform .3s, opacity .3s; }
.nav__menu.is-open span:nth-child(1) { transform: translateY(3.2px) rotate(45deg); }
.nav__menu.is-open span:nth-child(2) { transform: translateY(-3.2px) rotate(-45deg); }

/* mobile menu */
.mobilemenu {
  position: fixed; inset: 0; z-index: 890;
  background: rgba(20,16,13,.97); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.mobilemenu.is-open { opacity: 1; visibility: visible; }
.mobilemenu a {
  font-family: var(--serif); font-size: clamp(30px, 9vw, 52px); color: #efe3d1;
  font-weight: 300; opacity: .85; transition: opacity .3s, transform .3s;
}
.mobilemenu a:hover { opacity: 1; }

/* Persistent CTA + scroll cue */
.lets-talk {
  position: fixed; right: var(--gut); bottom: clamp(20px, 3vw, 36px); z-index: 880;
  background: var(--pill); color: var(--pill-ink);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  padding: 16px 26px; border-radius: 100px;
  box-shadow: 0 20px 45px -22px rgba(25,20,17,.7);
  transition: transform .4s var(--ease);
}
.lets-talk:hover { transform: translateY(-3px) scale(1.03); }

.scroll-cue {
  position: fixed; left: var(--gut); bottom: clamp(20px, 3vw, 36px); z-index: 880;
  display: flex; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: .3em; color: var(--ink-soft);
}
.scroll-cue__line { width: 1px; height: 46px; background: var(--line); overflow: hidden; position: relative; }
.scroll-cue__line i { position: absolute; top: -46px; left: 0; width: 100%; height: 46px; background: var(--ink);
  animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { top: -46px; } 60%,100% { top: 46px; } }

/* ============================================================
   LAYOUT / SECTIONS
   ============================================================ */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(80px, 12vh, 160px) var(--gut);
}
.section__head { margin-bottom: clamp(40px, 6vw, 80px); }
.section__num {
  display: inline-block; font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .22em; color: var(--ink-soft);
  margin-bottom: 22px;
}
.section__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 8vw, 104px); line-height: .95; letter-spacing: -.02em;
  position: relative; display: inline-block; padding-bottom: 14px;
}
.section__title::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease);
}
.section__title.is-in::after { transform: scaleX(1); }
.section__lead {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft);
  margin-top: 22px; max-width: 52ch; line-height: 2;
}
.amp { font-style: italic; font-family: var(--serif); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh; position: relative;
  padding: clamp(120px, 16vh, 200px) var(--gut) clamp(90px, 12vh, 130px);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1600px; margin: 0 auto;
}
.hero__eyebrow {
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: .28em; color: var(--ink-soft);
  padding-bottom: clamp(20px, 5vh, 60px);
}
.hero__name {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.hero__line {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 20vw, 320px); line-height: .82; letter-spacing: -.03em;
  text-align: center; white-space: nowrap;
}
.hero__line--2 { margin-top: clamp(-10px, -1vw, -6px); }

.hero__portrait {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(150px, 22vw, 300px); aspect-ratio: 3 / 4; z-index: -1;
  border-radius: 200px 200px 8px 8px; overflow: hidden;
  background: linear-gradient(160deg, #d9c4a6 0%, #b9986f 55%, #8f6f4c 100%);
  box-shadow: 0 40px 90px -40px rgba(25,20,17,.6);
  display: flex; align-items: center; justify-content: center;
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero__mono {
  font-family: var(--serif); font-size: clamp(40px, 7vw, 90px); font-weight: 300;
  color: rgba(255,246,233,.55); letter-spacing: .05em;
}
.hero__foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: clamp(30px, 6vh, 70px); flex-wrap: wrap; gap: 16px;
}
.hero__role { font-family: var(--serif); font-size: clamp(16px, 2vw, 24px); font-style: italic; }
.hero__avail { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(180,85,47,.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180,85,47,.5);} 70%{ box-shadow: 0 0 0 10px rgba(180,85,47,0);} 100%{ box-shadow:0 0 0 0 rgba(180,85,47,0);} }

/* ============================================================
   TAGLINE
   ============================================================ */
.tagline {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) var(--gut);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.tagline__text {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(34px, 6.5vw, 96px); line-height: 1.02; letter-spacing: -.02em;
  max-width: 18ch;
}
.tagline__text em { font-style: italic; }

/* ============================================================
   01 · INTRODUCTION
   ============================================================ */
.intro__grid {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(40px, 6vw, 100px);
}
.intro__headline {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.02em;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.intro__subline {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(24px, 3vw, 40px); color: var(--ink-soft); margin-top: 22px;
}
.intro__statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3vw, 42px); line-height: 1.28; letter-spacing: -.01em;
  padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line);
}
.intro__statement em { font-style: italic; }
.intro__body { display: grid; gap: 22px; max-width: 62ch; }
.intro__body p {
  font-size: 13px; letter-spacing: .1em; line-height: 2; text-transform: uppercase; color: var(--ink-soft);
}

/* ============================================================
   02 · TOOLBOX
   ============================================================ */
.toolbox__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 48px);
}
.tool-col { border-top: 1px solid var(--line); padding-top: 20px; }
.tool-col__label {
  display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 20px;
}
.tool-col ul { list-style: none; display: grid; gap: 12px; }
.tool-col li {
  font-family: var(--serif); font-size: clamp(18px, 1.6vw, 24px); font-weight: 400;
  position: relative; padding-left: 0; transition: padding .3s var(--ease), color .3s;
}
.tool-col li:hover { padding-left: 14px; color: var(--accent); }
.tool-col li::before {
  content: "→"; position: absolute; left: -18px; opacity: 0; transition: opacity .3s, left .3s;
  font-size: .7em;
}
.tool-col li:hover::before { opacity: 1; left: -2px; }

/* ============================================================
   03 · WORK
   ============================================================ */
.work__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border: 1px solid var(--line); }
.card {
  background: var(--bg-2); padding: clamp(30px, 3.4vw, 56px);
  display: flex; flex-direction: column; min-height: 340px;
  transition: background .4s var(--ease);
}
.card:hover { background: #fbf0de; }
.card__top { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: auto; }
.card__idx { font-size: 12px; letter-spacing: .2em; color: var(--ink-soft); }
.card__tags { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
  text-align: right; max-width: 55%; line-height: 1.7; }
.card__title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 58px);
  line-height: 1; letter-spacing: -.02em; margin-top: 36px;
}
.card__sub { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
  margin-top: 12px; }
.card__desc { font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); margin-top: 20px;
  max-width: 52ch; }
.card__links { display: flex; gap: 22px; margin-top: 28px; }
.card__links a {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; position: relative; padding-bottom: 4px;
}
.card__links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--ink); transform: scaleX(1); transform-origin: right; transition: transform .4s var(--ease); }
.card__links a:hover::after { transform: scaleX(0); }

/* ============================================================
   04 · JOURNEY / TIMELINE
   ============================================================ */
.timeline { border-top: 1px solid var(--line); }
.tl-row {
  display: grid; grid-template-columns: 0.7fr 1.5fr 1fr; gap: clamp(20px, 4vw, 60px);
  align-items: center; padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line);
  transition: background .4s, padding-left .4s var(--ease); padding-left: 0;
}
.tl-row:hover { padding-left: 18px; }
.tl-period { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); line-height: 2; }
.tl-period i { font-style: normal; opacity: .7; font-size: 11px; }
.tl-role { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 3vw, 42px); line-height: 1.1; letter-spacing: -.01em; }
.tl-place { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  line-height: 1.8; text-align: right; }

/* ============================================================
   05 · MILESTONES
   ============================================================ */
.mile__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; background: transparent;
  border: none; }
.mile {
  position: relative; box-shadow: inset 0 0 0 1px var(--line);
  background: var(--bg-2); padding: clamp(28px, 3vw, 48px);
  min-height: 260px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 26px 26px; transition: background-color .4s;
}
.mile:hover { background-color: #fbf0de; }
.mile__tag { font-size: 11px; letter-spacing: .24em; color: var(--ink-soft); }
.mile__title { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 40px);
  line-height: 1.05; letter-spacing: -.01em; margin-top: 40px; }
.mile__sub { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  margin-top: 14px; line-height: 1.7; }
/* Longer, sentence-case blurb — the uppercase/tracked label style is built for
   short tags like "IIT HYDERABAD" and turns long copy into an unreadable wall. */
.mile__sub--long {
  text-transform: none; letter-spacing: .005em; font-size: 12.5px;
  line-height: 1.85; max-width: 48ch;
}
.mile--ghost { background: transparent; grid-column: 1 / -1; align-items: flex-start; }
.mile--ghost .mile__title { color: var(--ink-soft); }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.contact { text-align: left; padding-top: clamp(90px, 14vh, 200px); }
.contact .section__num { color: var(--ink-soft); }
.contact__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(44px, 9vw, 140px); line-height: .98; letter-spacing: -.03em; margin: 10px 0 30px;
}
.contact__title em { font-style: italic; }
.contact__lead { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  max-width: 46ch; line-height: 2; }
.contact__email {
  display: inline-block; font-family: var(--serif); font-size: clamp(24px, 4vw, 54px);
  margin: 44px 0; position: relative; padding-bottom: 8px; font-style: italic; font-weight: 300;
}
.contact__email::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--underline); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); }
.contact__email.is-in::after { transform: scaleX(1); }
.contact__socials { display: flex; gap: clamp(20px, 4vw, 48px); flex-wrap: wrap; }
.contact__socials a {
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; position: relative; padding-bottom: 4px;
}
.contact__socials a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--ink); transition: width .4s var(--ease); }
.contact__socials a:hover::after { width: 100%; }

.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 40px var(--gut) 120px; display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
}
.footer__top { transition: color .3s; }
.footer__top:hover { color: var(--ink); }

/* ============================================================
   REVEAL (base states; JS adds .is-in)
   ============================================================ */
[data-reveal], [data-reveal-lines] .line-inner { will-change: transform, opacity; }
html.anim [data-reveal] { opacity: 0; transform: translateY(28px); }
html.anim [data-reveal].is-in { opacity: 1; transform: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease); }
.line-mask { display: block; overflow: hidden; }
.line-inner { display: block; }
html.anim [data-reveal-lines] .line-inner { transform: translateY(105%); }
html.anim [data-reveal-lines].is-in .line-inner { transform: none;
  transition: transform 1s var(--ease); }
html.anim [data-reveal-lines].is-in .line-inner:nth-child(2) { transition-delay: .08s; }
html.anim [data-reveal-lines].is-in .line-inner:nth-child(3) { transition-delay: .16s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .intro__grid { grid-template-columns: 1fr; }
  .toolbox__grid { grid-template-columns: repeat(2, 1fr); }
  .mile__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav__pill { display: none; }
  .nav__menu { display: flex; }
  .scroll-cue { display: none; }
  .lets-talk { left: 50%; right: auto; transform: translateX(-50%); }
  .lets-talk:hover { transform: translateX(-50%) translateY(-3px); }

  .hero__line { font-size: clamp(52px, 19vw, 120px); }
  .hero__portrait { width: clamp(120px, 40vw, 200px); }
  .hero__foot { flex-direction: column; align-items: flex-start; }

  .work__grid { grid-template-columns: 1fr; }
  .toolbox__grid { grid-template-columns: 1fr; }
  .mile__grid { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 1fr; gap: 10px; text-align: left; }
  .tl-place { text-align: left; }
  .card { min-height: auto; }
}

@media (max-width: 420px) {
  .hero__eyebrow { flex-direction: column; gap: 6px; }
  .card__tags { max-width: 100%; }
}

/* (Reduced-motion suppression is intentionally not applied — the site is designed
   to always play its full animation set. See note in README.) */

/* ============================================================
   DARK THEME
   ============================================================ */
:root[data-theme="dark"] {
  --bg:        #0a0a0c;
  --bg-2:      #101013;
  --bg-3:      #050506;
  --ink:       #f2f0ea;
  --ink-soft:  #8f8b83;
  --line:      rgba(242, 240, 234, 0.15);
  --line-soft: rgba(242, 240, 234, 0.06);
  --pill:      #f2f0ea;
  --pill-ink:  #0a0a0c;
  --accent:    #d9a24a;
  --glass:     rgba(18, 18, 22, 0.55);
  --glass-brd: rgba(242, 240, 234, 0.10);
  --card-hover:#16161a;
  --glow:      rgba(233, 226, 210, 0.16);
  --sun-color: #e0983f;
  --moon-color:#eef1f5;
  --underline: #ffd75e;   /* brighter yellow so it reads on near-black */
  --grain-blend: overlay;
  --grain-op: 0.32;
  color-scheme: dark;
}

/* Smooth cross-fade only while toggling */
html.theme-anim, html.theme-anim * {
  transition: background-color .6s ease, color .6s ease, border-color .6s ease,
              fill .6s ease, box-shadow .6s ease !important;
}
body { transition: background-color .6s ease, color .6s ease; }
.card:hover { background: var(--card-hover); }
.mile:hover { background-color: var(--card-hover); }

/* ============================================================
   HERO — new name font + layout
   ============================================================ */
.hero__name { position: relative; gap: clamp(0px, 0.4vw, 6px); }
.hero__line {
  font-family: "Cormorant Garamond", var(--serif); font-weight: 600; letter-spacing: .015em;
  font-size: clamp(72px, 21vw, 340px); line-height: .9;
  position: relative; z-index: 2; pointer-events: none;
}
.hero__line--2 { margin-top: 0; }
@media (max-width: 760px) {
  .hero__line { font-size: clamp(58px, 20vw, 140px); }
  .hero__name { gap: 0; }
}
/* per-letter reveal */
.hero__line .ch { display: inline-block; overflow: hidden; vertical-align: top; }
.hero__line .ch > i { display: inline-block; font-style: normal; transform: translateY(115%); }
html.loaded .hero__line .ch > i { transform: none; transition: transform .95s var(--ease); }

.hero__role {
  text-align: center; margin-top: clamp(22px, 4vh, 46px);
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(16px, 2.2vw, 28px); color: var(--ink); letter-spacing: .01em;
}

/* ============================================================
   SUN / MOON THEME TOGGLE
   ============================================================ */
.theme-toggle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: clamp(104px, 14vw, 180px); height: clamp(104px, 14vw, 180px);
  z-index: 1; background: none; border: 0; padding: 0; cursor: pointer;
  transition: transform .5s var(--ease);
}
.theme-toggle:hover { transform: translate(-50%, -50%) scale(1.08); }
.theme-toggle:active { transform: translate(-50%, -50%) scale(.96); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 50%; }

.tt-glow {
  position: absolute; inset: -28%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  animation: ttpulse 4s ease-in-out infinite;
}
@keyframes ttpulse { 0%,100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }

.tt-sun, .tt-moon {
  position: absolute; inset: 12%; width: 76%; height: 76%;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.tt-sun { color: var(--sun-color); }
.tt-moon { color: var(--moon-color); opacity: 0; transform: rotate(-70deg) scale(.35); }
.tt-rays { transform-box: fill-box; transform-origin: center; animation: ttspin 24s linear infinite; }
:root[data-theme="dark"] .tt-sun { opacity: 0; transform: rotate(70deg) scale(.35); }
:root[data-theme="dark"] .tt-moon { opacity: 1; transform: none; }
@keyframes ttspin { to { transform: rotate(360deg); } }

.tt-hint {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  white-space: nowrap; font-family: var(--sans); font-size: 10px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--ink-soft); opacity: 0; transition: opacity .35s;
}
.theme-toggle:hover .tt-hint { opacity: .85; }

/* ============================================================
   ANIMATED LOGO
   ============================================================ */
.nav__logo {
  position: relative; width: 46px; height: 46px;
  display: grid; place-items: center; flex-direction: initial;
  color: var(--ink); mix-blend-mode: normal;
}
.logo__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px dashed currentColor; opacity: .45;
  animation: ttspin 10s linear infinite;
}
.logo__mark { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
  overflow: visible; transform-origin: center; transition: transform .5s var(--ease); }
.logo__mark text { font-family: var(--serif); font-weight: 600; font-size: 19px;
  letter-spacing: .5px; fill: var(--ink); }
.nav__logo:hover .logo__mark { transform: scale(1.08); }
.nav__logo:hover .logo__ring { animation-duration: 2s; opacity: .95; }

/* ============================================================
   SCROLL PROGRESS STAR
   ============================================================ */
.scroll-star {
  position: fixed; left: var(--gut); bottom: clamp(20px, 3vw, 36px); z-index: 880;
  display: flex; align-items: center; gap: 12px;
}
.scroll-star svg { width: 30px; height: 30px; overflow: visible; }
.scroll-star .star-track { fill: var(--line-soft); stroke: var(--ink-soft); stroke-width: 1; opacity: .8; }
.scroll-star .star-fill { fill: var(--accent); transition: y .18s linear, height .18s linear; }
.scroll-star__pct {
  font-size: 10px; letter-spacing: .2em; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

/* ============================================================
   PLAYGROUND / DOODLE
   ============================================================ */
.doodle__wrap { border: 1px solid var(--line); background: var(--bg-2); padding: clamp(14px, 2vw, 22px); }
.doodle__tools { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; background: var(--c);
  border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--line) inset; transition: transform .2s var(--ease), border-color .2s;
}
.swatch:hover { transform: scale(1.18); }
.swatch.is-active { border-color: var(--ink); transform: scale(1.18); }
.doodle__clear {
  font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  background: var(--pill); color: var(--pill-ink); border: 0; padding: 11px 20px; border-radius: 100px;
  cursor: pointer; transition: transform .3s var(--ease);
}
.doodle__clear:hover { transform: translateY(-2px); }
.doodle__canvas {
  display: block; width: 100%; height: min(52vw, 420px);
  background: #f4e8d5; border-radius: 6px; touch-action: none; cursor: crosshair;
  box-shadow: inset 0 2px 22px rgba(25, 20, 17, .07);
}

/* ============================================================
   WORK — three-up
   ============================================================ */
.work__grid { grid-template-columns: repeat(3, 1fr); gap: 0; background: transparent; border: none; }
@media (max-width: 980px) { .work__grid { grid-template-columns: 1fr; } }

/* Scroll-drawn card borders: a faint static frame, plus a solid line that grows
   around the box in step with scroll (driven by updateFrames() in script.js). */
.work .card { position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.card__frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 4; overflow: visible; color: var(--ink);
}

/* Footer signature */
.footer__made { max-width: 60ch; }
.footer__made em { font-style: normal; color: var(--accent); }

/* ============================================================
   Reduced-motion for the new pieces
   ============================================================ */
/* Smooth theme cross-fade via the View Transitions API */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .6s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  mix-blend-mode: normal;
}

/* (No reduced-motion overrides — full animation set always plays.) */

/* ============================================================
   LOGO — becomes a full moon in dark mode
   ============================================================ */
.logo__moon {
  position: absolute; inset: 2px; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #fdfdf8 0%, #eceade 55%, #cfccc0 100%);
  transform: scale(.2); opacity: 0;
  box-shadow: 0 0 0 rgba(238, 241, 245, 0);
  transition: transform .6s var(--ease), opacity .45s var(--ease), box-shadow .6s ease;
}
.logo__moon::before, .logo__moon::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(140, 137, 126, .26);
}
.logo__moon::before { width: 9px;  height: 9px;  top: 21%;    left: 19%; }
.logo__moon::after  { width: 5px;  height: 5px;  bottom: 23%; right: 24%; }

.logo__mark text { transition: fill .5s var(--ease); }

:root[data-theme="dark"] .logo__moon {
  transform: scale(1); opacity: 1;
  box-shadow: 0 0 16px rgba(238, 241, 245, .45), 0 0 34px rgba(238, 241, 245, .16);
}
:root[data-theme="dark"] .logo__ring { opacity: 0; }
:root[data-theme="dark"] .logo__mark text { fill: #0e0e12; }

/* the "moon rises" flourish played when you switch to dark */
.logo__moon.bloom { animation: moonBloom .95s var(--ease); }
@keyframes moonBloom {
  0%   { transform: scale(.25) rotate(-25deg); opacity: .15;
         box-shadow: 0 0 0 rgba(238, 241, 245, 0); }
  55%  { transform: scale(1.2) rotate(4deg); opacity: 1;
         box-shadow: 0 0 30px rgba(238, 241, 245, .8), 0 0 62px rgba(238, 241, 245, .32); }
  100% { transform: scale(1) rotate(0); opacity: 1;
         box-shadow: 0 0 16px rgba(238, 241, 245, .45), 0 0 34px rgba(238, 241, 245, .16); }
}

/* ============================================================
   SCROLL STAR — now doubles as "back to top" from anywhere
   ============================================================ */
.scroll-star { background: none; border: 0; padding: 0; cursor: pointer; }
.scroll-star__hint {
  font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .22em;
  color: var(--ink-soft); opacity: 0; transform: translateX(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.scroll-star:hover .scroll-star__hint { opacity: .9; transform: none; }
.scroll-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 6px; }

/* ============================================================
   BACK-TO-TOP — rotating circular badge
   ============================================================ */
.totop {
  position: relative; width: 56px; height: 56px; flex: none;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
}
.totop__arrow { position: absolute; inset: 0; display: grid; place-items: center; }
.totop__arrow svg {
  width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  animation: arrowBob 2.6s ease-in-out infinite;
  transition: transform .35s var(--ease);
}
.totop:hover .totop__arrow svg { animation: none; transform: translateY(-5px) scale(1.14); }
.totop:active .totop__arrow svg { transform: translateY(-9px) scale(1.05); }
.totop:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 50%; }
@keyframes arrowBob { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-2px); } }


/* ============================================================
   THE "O" TOGGLE  (sun in light · moon in dark)
   ============================================================ */
.o-toggle {
  position: relative; display: inline-block; padding: 0; margin: 0; border: 0;
  background: none; font: inherit; line-height: inherit; color: inherit;
  cursor: pointer; pointer-events: auto; vertical-align: baseline;
}
.o-letter { position: relative; z-index: 2; color: var(--ink); transition: opacity .5s var(--ease); }
.o-rays {
  position: absolute; inset: 0; z-index: 3; color: var(--sun-color);
  pointer-events: none; transition: opacity .5s var(--ease);
}
.o-rays .ray { position: absolute; top: 50%; left: 50%; transform: rotate(var(--a, 0deg)); }
.o-rays .ray::before {
  content: ""; position: absolute; left: -0.008em;
  width: 0.016em; height: 0.075em; border-radius: 0.02em; background: currentColor;
  transform: translateY(calc(-1 * var(--r, 0.42em)));
  animation: emit 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: var(--d, 0s);
}
@keyframes emit {
  0%   { transform: translateY(calc(-1 * var(--r, 0.42em) + 0.02em)) scaleY(.25); opacity: 0; }
  22%  { opacity: 1; }
  100% { transform: translateY(calc(-1 * var(--r, 0.42em) - 0.085em)) scaleY(1); opacity: 0; }
}
.o-glow {
  position: absolute; inset: -46%; z-index: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  animation: ttpulse 4s ease-in-out infinite;
}
.o-moon {
  position: absolute; inset: 7%; z-index: 3; opacity: 0; pointer-events: none;
  color: var(--moon-color); transform: scale(.35) rotate(-60deg);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.o-moon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 12px rgba(238,241,245,.35)); }
.o-toggle:hover { transform: scale(1.05); }
.o-toggle:focus-visible { outline: 2px solid var(--sun-color); outline-offset: 4px; border-radius: 6px; }

:root[data-theme="dark"] .o-letter { opacity: 0; }
:root[data-theme="dark"] .o-rays { opacity: 0; }
:root[data-theme="dark"] .o-moon { opacity: 1; transform: none; }

/* entrance (opacity only, so hover scale still works) */
html.anim .hero__line .o-toggle { opacity: 0; }
html.loaded .hero__line .o-toggle { opacity: 1; transition: opacity 1s var(--ease) .25s; }

/* ============================================================
   RAIN (dark mode only)
   ============================================================ */
main { position: relative; z-index: 1; }
.rain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity .9s ease;
}
:root[data-theme="dark"] .rain { opacity: 1; }

/* ============================================================
   SCROLL STAR — completion glow
   ============================================================ */
.scroll-star svg { transform-origin: center; transition: filter .4s ease;
  animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(calc(1 + var(--breath, 0))); }
}
.scroll-star.is-full svg { filter: drop-shadow(0 0 8px var(--accent)); }
.scroll-star.is-full .star-track { fill: var(--accent); opacity: 1; stroke: var(--accent); }
