/* ============================================================
   Srishti Gangolly — base styles
   Warm editorial / diary aesthetic
   ============================================================ */

:root {
  --cream:   #F4EFE4;
  --paper:   #FBF8F1;
  --ink:     #211C18;
  --muted:   #8C8275;
  --border:  #E4DDCE;
  --oxblood: #420001;   /* maroon: borders + solid uses */
  --oxblood-fill: var(--oxblood);   /* maroon backgrounds: cards, tabs, badges */
  --forest:  #1A3A2A;

  /* theme tokens (overridden for dark mode below) */
  --accent:        #420001;   /* maroon text, rules, underlines */
  --on-accent:     #FBF8F1;
  --on-ink:        #FFFFFF;
  --text:          #2E2E2E;   /* body copy */
  --surface:       #FFFFFF;   /* white cards */
  --surface-hover: #FDF9F6;
  --card-neutral:  #E2E3DC;
  --card-foot:     #6E665A;
  --chip-neutral:  rgba(255,255,255,0.72);
  --hero-tags:     #8A9AAA;
  --forest-accent: #1A3A2A;
  --pol-shadow:    #C8C0B4;   /* offset shadow behind polaroids + sticker */
  --pol-shadow-soft: rgba(200,192,180,0.9);
  --footer-bg:     #1C1814;
  --footer-line:   var(--ink);
  --su-track-top:  #ECE5D6;
  --su-track-bot:  #F6F1E6;
  --su-track-hi:   rgba(255,255,255,0.65);
  --su-done-top:   #DFE9D6;
  --su-done-bot:   #EEF4E6;
  --tag-lead-bg:   #D8E7D2;  --tag-lead-fg:  #2E5A3C;
  --tag-teach-bg:  #E6E1D6;  --tag-teach-fg: #6E665A;
  --tag-coop-bg:   #F0D9D9;  --tag-coop-fg:  #7C2A28;
  --logo-filter:   brightness(1);
  --scrim:         rgba(26,22,20,0.28);
  --toggle-edge:         #211C18;   /* near-black ring + moon */
  --toggle-fill:         #000000;
  --toggle-icon-on-fill: #FFFFFF;
  --menu-shadow:   rgba(26,22,20,0.14);

  /* fixed: text on surfaces that stay dark in both themes */
  --light: #FBF8F1;
  --dark:  #211C18;
}

/* ------------------------------------------------------------
   DARK MODE
   ------------------------------------------------------------ */
[data-theme="dark"] {
  color-scheme: dark;
  --cream:   #000000;   /* page background: pure black */
  --paper:   #1F1214;
  --ink:     #EFE8DC;
  --muted:   #AA9597;
  --border:  #3D2629;
  --oxblood: #62100F;
  /* maroon backgrounds: flat red, the middle tone of the hero slider knob */
  --oxblood-fill: #5A0B0D;

  --accent:        #E8A598;
  --on-accent:     #140A0C;
  --on-ink:        #140A0C;
  --text:          #D9D1C4;
  --surface:       #26171A;
  --surface-hover: #301D20;
  --card-neutral:  #2B1B1E;
  --card-foot:     #AD9799;
  --chip-neutral:  rgba(244,239,228,0.09);
  --hero-tags:     #93A3B3;
  --forest-accent: #8DBF9C;
  --pol-shadow:    #45292D;
  --pol-shadow-soft: rgba(69,41,45,0.95);
  --footer-bg:     #14090B;
  --footer-line:   var(--border);
  --su-track-top:  #2B1A1D;
  --su-track-bot:  #221416;
  --su-track-hi:   rgba(255,255,255,0.05);
  --su-done-top:   #1F2E23;
  --su-done-bot:   #26372B;
  --tag-lead-bg:   #22352A;  --tag-lead-fg:  #A9D1AE;
  --tag-teach-bg:  #33211F;  --tag-teach-fg: #C9B3B0;
  --tag-coop-bg:   #3B2323;  --tag-coop-fg:  #EBB0A4;
  --scrim:         rgba(0,0,0,0.55);
  --toggle-edge:         #F4EFE4;   /* near-white ring + sun */
  --toggle-fill:         #FFFFFF;
  --toggle-icon-on-fill: #000000;
  --menu-shadow:   rgba(0,0,0,0.5);
  /* navy line-art logo -> tinted to the accent pink (#E8A598) so it reads on dark */
  --logo-filter:   brightness(0) saturate(100%) invert(86%) sepia(74%) saturate(1421%) hue-rotate(293deg) brightness(96%) contrast(90%);
}

/* subpages: footer matches the header in dark mode (home page keeps the deeper footer) */
[data-theme="dark"] body:not(.home) { --footer-bg: var(--paper); }

/* theme switch: script.js cross-fades a snapshot of the whole page (View Transitions).
   The switch gets its own layer so its knob slides live on top of the fade. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .45s; animation-timing-function: ease; }
.theme-toggle { view-transition-name: theme-toggle; }
::view-transition-old(theme-toggle) { display: none; }
::view-transition-new(theme-toggle) { animation: none; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; }

/* ------------------------------------------------------------
   NAV
   ------------------------------------------------------------ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 5rem;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: padding .45s cubic-bezier(.2,.7,.2,1),
              background .45s ease,
              border-color .45s ease;
}
nav.scrolled {
  padding: 0.55rem 5rem;
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}
.nav-logo { display: block; line-height: 0; }
.nav-logo img { height: 80px; width: auto; display: block; filter: var(--logo-filter); }
.nav-logo img { transition: transform .45s cubic-bezier(.34,1.56,.34,1), filter .35s ease; }
nav.scrolled .nav-logo img { transform: scale(0.84); }
.nav-logo:hover img,
nav.scrolled .nav-logo:hover img {
  transform: scale(1.14) rotate(-3deg);
  filter: var(--logo-filter) drop-shadow(0 7px 14px rgba(26,22,20,0.22));
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.2rem;
  margin-left: auto;
}
.nav-links a {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0;
  transition: color .3s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  position: relative;
  z-index: 2;            /* stays above the open menu so the X can be tapped */
}
.nav-hamburger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink);
  transition: transform .35s ease, opacity .35s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* theme toggle (home page): always in the top bar, after the links */
.nav-links + .theme-toggle { margin-left: 1.8rem; }
.theme-toggle {
  position: relative; z-index: 2;   /* stays tappable above the open mobile menu */
  flex-shrink: 0;
  width: 56px; height: 30px; padding: 0;
  background: transparent; border: 1.5px solid var(--toggle-edge); border-radius: 999px;
  cursor: pointer;
  transition: border-color .3s ease;
}
/* the sliding knob: sits on the sun in light mode, slides onto the moon in dark mode */
.theme-toggle::before {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--toggle-edge);
  transition: transform .35s cubic-bezier(.34,1.56,.34,1), background-color .3s ease, box-shadow .3s ease;
}
[data-theme="dark"] .theme-toggle::before { transform: translateX(26px); }
.theme-toggle svg {
  position: absolute; top: 50%; z-index: 1;
  width: 13px; height: 13px; margin-top: -6.5px;
  pointer-events: none; transition: color .3s ease;
}
.theme-toggle .icon-sun  { left: 7px; }
.theme-toggle .icon-moon { right: 7px; }
/* the icon under the knob takes the knob's contrast colour; the other one is muted */
.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon { color: var(--toggle-icon-on-fill); }
.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun { color: var(--muted); }
@media (hover: hover) {
  .theme-toggle:hover::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--toggle-edge) 14%, transparent); }
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* six nav links: tighten spacing before the hamburger takes over */
@media (max-width: 1100px) {
  nav, nav.scrolled { padding-left: 2.5rem; padding-right: 2.5rem; }
  .nav-links { gap: 1.5rem; }
}
@media (max-width: 900px) {
  nav, nav.scrolled { padding-left: 1.5rem; padding-right: 1.5rem; }
  .nav-links { gap: 1.1rem; }
  .nav-links a { font-size: 0.92rem; }
}

/* dimmed backdrop behind the open mobile menu (tap it to close) */
.nav-scrim {
  position: fixed; inset: 0;
  z-index: 99;           /* just under the nav (100) */
  background: var(--scrim);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.nav-scrim.open { opacity: 1; visibility: visible; transition: opacity .4s ease, visibility 0s; }
html.menu-open { overflow: hidden; }

/* ------------------------------------------------------------
   PAGE CURTAIN  (page-to-page transition)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   SHARED HEADINGS / CONTACT  (used by about + index)
   ------------------------------------------------------------ */
.section-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--ink);
}
.section-heading em { font-style: italic; font-weight: 300; color: var(--accent); }

#contact {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-line);
  padding: 3.4rem 2rem 2.8rem;
  text-align: center;
}
#contact .section-heading {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  color: var(--light);
}
#contact .section-heading em { color: #E8A598; }
.contact-sub {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(244,239,228,0.6);
  margin: 1rem 0 1.8rem;
}
.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}
.contact-link {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  transition: transform .35s cubic-bezier(.2,.7,.2,1),
              background .35s ease, color .35s ease, box-shadow .35s ease;
}
.contact-link.primary {
  background: var(--oxblood-fill);
  color: var(--light);
  box-shadow: 0 6px 18px rgba(66,0,1,0.18);
}
.contact-link.primary:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(66,0,1,0.28); }
.contact-link.outline {
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.contact-link.outline:hover { transform: translateY(-3px); background: var(--ink); color: var(--paper); }

/* dark footer button treatment — all three identical, matching the bg */
#contact .contact-links { margin-bottom: 2rem; }
#contact .contact-link {
  background: var(--footer-bg);
  border: 1.5px solid rgba(244,239,228,0.45);
  color: var(--light);
  box-shadow: none;
}
#contact .contact-link:hover {
  transform: translateY(-3px);
  background: var(--light);
  color: var(--dark);
  border-color: var(--light);
}
.footer-note {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: rgba(244,239,228,0.4);
}
.footer-note em { font-style: italic; }

/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  nav { padding: 0.9rem 1.25rem; }
  nav.scrolled { padding: 0.6rem 1.25rem; }
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(74vw, 320px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.8rem;
    padding: 2rem 2.4rem;
    background: var(--paper);
    box-shadow: -12px 0 40px var(--menu-shadow);
    z-index: 1;
    opacity: 0;
    visibility: hidden;    /* closed menu: hidden from taps, Tab and screen readers */
    transform: translateX(100%);
    transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .35s ease, visibility 0s linear .5s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .35s ease, visibility 0s;
  }
  /* links drift in one after another */
  .nav-links li {
    opacity: 0;
    transform: translateX(14px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.2,.7,.2,1);
  }
  .nav-links.open li { opacity: 1; transform: none; }
  .nav-links.open li:nth-child(1) { transition-delay: .08s; }
  .nav-links.open li:nth-child(2) { transition-delay: .12s; }
  .nav-links.open li:nth-child(3) { transition-delay: .16s; }
  .nav-links.open li:nth-child(4) { transition-delay: .20s; }
  .nav-links.open li:nth-child(5) { transition-delay: .24s; }
  .nav-links.open li:nth-child(6) { transition-delay: .28s; }
  .nav-links.open li:nth-child(7) { transition-delay: .32s; }
  .nav-links a { font-size: 1.3rem; font-family: 'Fraunces', serif; }
  /* top bar on mobile: logo ... toggle  hamburger */
  .nav-links + .theme-toggle { order: 1; margin-left: auto; margin-right: 0.9rem; }
  .nav-hamburger { order: 2; }
}

/* ------------------------------------------------------------
   TYPEWRITER CURSOR
   ------------------------------------------------------------ */
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------ */
/* ============================================================
   HOME PAGE
   ============================================================ */
.home-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 4rem);
  padding: 6rem clamp(1.5rem, 5vw, 5rem) 3rem;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}
.home-hero-text { flex: 0 1 620px; min-width: 0; }
@media (min-width: 1001px) {
  .home-hero-text { flex: 0 1 auto; }
  .home-title { white-space: nowrap; }
}
.hero-spark {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
  animation: sparkTwinkle 3.2s ease-in-out infinite;
}
@keyframes sparkTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85) rotate(0deg); }
  50%      { opacity: 0.95; transform: scale(1.08) rotate(8deg); }
}
.home-eyebrow {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.4rem;
}
.home-eyebrow::before { content:''; width:1.5rem; height:1px; background:var(--accent); display:block; }
.home-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.6rem, 4.8vw, 5.4rem);
  font-weight: 700; line-height: 0.94; letter-spacing: -0.035em;
  color: var(--ink); margin-bottom: 1.6rem;
}
.home-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.home-sub {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 300;
  font-size: 1.15rem; line-height: 1.7; color: var(--text);
  max-width: 32rem; margin-bottom: 1.5rem;
}
.tagline-highlight { font-weight: inherit; color: inherit; }
.home-sub-accent { color: var(--accent); }
.home-tags {
  font-family: 'DM Sans', sans-serif; font-style: italic;
  font-size: clamp(0.52rem, 2.5vw, 0.78rem); color: var(--hero-tags);
  letter-spacing: 0.03em; margin-top: 0.4rem; margin-bottom: 0; white-space: nowrap;
}
.home-bio {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.05rem; line-height: 1.85; color: var(--text);
  max-width: 32rem; margin-bottom: 1.8rem;
}
.home-bio em { font-style: italic; }

/* ---- Slide-to-unlock (vintage iOS) ---- */
.slide-unlock { width: 330px; max-width: 100%; margin-top: 0.75rem; }
.su-track {
  position: relative; height: 64px; border-radius: 999px;
  background: linear-gradient(var(--su-track-top), var(--su-track-bot));
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 7px rgba(26,22,20,0.13), inset 0 -1px 0 var(--su-track-hi);
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
}
.su-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding-left: 48px;
  font-family: 'DM Sans', sans-serif; font-size: 0.98rem; font-weight: 600; letter-spacing: 0.03em;
  white-space: nowrap; pointer-events: none;
  color: #bdb2a0;
  background: linear-gradient(100deg, #c2b7a6 38%, #fffaf0 50%, #c2b7a6 62%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: suShimmer 2.8s linear infinite;
  transition: opacity .2s ease;
}
@keyframes suShimmer { 0% { background-position: 165% 0; } 100% { background-position: -65% 0; } }
.su-knob {
  position: absolute; top: 5px; left: 5px; width: 54px; height: 54px;
  border-radius: 50%; border: none; padding: 0; cursor: grab;
  background: radial-gradient(circle at 50% 32%, #62100f, #420001);
  box-shadow: 0 5px 14px rgba(66,0,1,0.36), inset 0 1px 0 rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  color: #F4EFE4; z-index: 2; touch-action: none;
  will-change: transform;
}
.su-knob:active { cursor: grabbing; }
.su-knob svg { width: 24px; height: 24px; }
.su-track.done { background: linear-gradient(var(--su-done-top), var(--su-done-bot)); }
.su-track.done .su-text { opacity: 0; }
.su-track.done .su-knob { background: radial-gradient(circle at 50% 32%, #3a6b46, #2E5A3C); box-shadow: 0 5px 14px rgba(46,90,60,0.4); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* hero polaroid */
.home-hero-photo { flex: 0 0 auto; position: relative; display: inline-block; width: 340px; }
.hero-sticker {
  width: 100%; display: block;
  filter: drop-shadow(4px 7px 0 var(--pol-shadow-soft)) drop-shadow(0 14px 26px rgba(26,22,20,0.22));
}
.hero-star { position: absolute; pointer-events: none; }
.hero-star--lg { top: -22px; right: -14px; color: var(--accent); }
.hero-star--sm { bottom: 34px; left: -20px; color: var(--forest-accent); }

/* ---- Section scaffold shared by home sections ---- */
.home-section { padding: 6rem 5rem; max-width: 1180px; margin: 0 auto; }
#experience.home-section { padding-top: 3rem; }
/* standalone experience / projects pages: clear the fixed nav */
.home-section.page-top, #experience.page-top { padding-top: 9rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-head .eyebrow-tag { margin-bottom: 0; }
.home-h2.spaced { margin-top: 4.5rem; margin-bottom: 0; }
#certifications .home-h2.spaced { margin-top: 0; }
/* short subpages: stretch the main section so the footer sits at the bottom */
body.subpage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.subpage > section { width: 100%; }
body.subpage > .page-top { flex: 1 0 auto; }
#projects.page-top { background: var(--cream); }   /* match the other subpages */
.home-section.alt { background: var(--paper); max-width: none; }
/* dark mode: the home page's Projects band uses the same red as the Writing band */
[data-theme="dark"] body.home #projects { background: var(--oxblood-fill); }
/* ...and the title banner on the RSM / DeerHacks project pages */
[data-theme="dark"] .case-hero { background: var(--forest); }
/* home + Projects page: both project cards use the maroon card's colours (light + dark) */
#projects .proj-card.neutral { background: var(--oxblood-fill); color: #F4EFE4; }
#projects .proj-card.neutral .proj-title { color: #F4EFE4; }
#projects .proj-card.neutral .proj-eyebrow,
#projects .proj-card.neutral .proj-foot { color: rgba(244,239,228,0.6); }
#projects .proj-card.neutral .proj-chip { background: rgba(244,239,228,0.15); color: #F4EFE4; }
[data-theme="dark"] #projects .proj-card.neutral {
  box-shadow: inset 0 0 0 1.5px #000;
}
[data-theme="dark"] #projects .proj-card.neutral:hover {
  box-shadow: inset 0 0 0 1.5px #000, 0 20px 44px rgba(0,0,0,0.3);
}
/* maroon card: same black outline (its red comes from --oxblood-fill) */
[data-theme="dark"] #projects .proj-card.maroon {
  box-shadow: inset 0 0 0 1.5px #000;
}
[data-theme="dark"] #projects .proj-card.maroon:hover {
  box-shadow: inset 0 0 0 1.5px #000, 0 20px 44px rgba(0,0,0,0.3);
}
/* ...on the home page's red band, both cards turn cream (like the Subscribe pill) */
[data-theme="dark"] body.home #projects .proj-card.neutral,
[data-theme="dark"] body.home #projects .proj-card.maroon { background: #F4EFE4; color: #211C18; }
[data-theme="dark"] body.home #projects .proj-card .proj-title { color: #420001; }
[data-theme="dark"] body.home #projects .proj-card .proj-eyebrow { color: #8C8275; }
[data-theme="dark"] body.home #projects .proj-card .proj-desc { color: #211C18; }
[data-theme="dark"] body.home #projects .proj-card .proj-foot { color: #6E665A; }
[data-theme="dark"] body.home #projects .proj-card .proj-chip { background: rgba(66,0,1,0.08); color: #420001; }
.home-section.alt > .home-section-inner { max-width: 1180px; margin: 0 auto; }

.eyebrow-tag {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.2rem;
}
.eyebrow-tag::before { content:''; width:1.4rem; height:1px; background:var(--accent); display:block; }

.home-h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700; line-height: 0.98; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 2.6rem;
}
.home-h2 em { font-style: italic; font-weight: 300; color: var(--accent); }

/* ---- Experience list ---- */
.exp-group-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  margin: 2.6rem 0 0.4rem;
}
.exp-list { border-top: 1px solid var(--border); }
.exp-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 132px;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: padding .4s cubic-bezier(.2,.7,.2,1), background .4s ease;
}
.exp-row::after {
  content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: var(--accent); transition: width .5s cubic-bezier(.2,.7,.2,1);
}
.exp-row:hover { padding-left: 1.4rem; padding-right: 1.4rem; background: color-mix(in srgb, var(--accent) 3%, transparent); }
.exp-row:hover::after { width: 100%; }
.exp-row--has-tooltip { display: block; }
.exp-row--has-tooltip .exp-row-top {
  display: grid;
  grid-template-columns: 1fr 1.1fr 132px;
  align-items: baseline;
  gap: 1.5rem;
}
.exp-details {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.2,.7,.2,1);
}
.exp-details-inner {
  overflow: hidden;
}
.exp-row--has-tooltip:hover .exp-details,
.exp-row--has-tooltip.tapped .exp-details { grid-template-rows: 1fr; }
.exp-details-intro { font-size: 0.82rem; line-height: 1.65; color: var(--ink); margin: 0.9rem 0 0.6rem; border-top: 1px solid var(--border); padding-top: 0.85rem; max-width: 62%; }
.exp-details ul { list-style: none; padding: 0; margin: 0.9rem 0 0.3rem; display: flex; flex-direction: column; gap: 0.6rem; border-top: 1px solid var(--border); padding-top: 0.85rem; max-width: 62%; }
.exp-details li { font-size: 0.82rem; line-height: 1.65; color: var(--ink); padding-left: 1rem; position: relative; }
.exp-details li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.exp-org {
  font-family: 'Fraunces', serif; font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1.2;
}
.exp-role { font-size: 0.92rem; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.exp-dates { display: block; font-weight: 400; color: var(--muted); margin-top: 0.35rem; font-size: 0.8rem; letter-spacing: 0.04em; }
.exp-tag {
  justify-self: end; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.36rem 0.85rem; border-radius: 999px; white-space: nowrap;
}
.exp-tag--lead  { background: var(--tag-lead-bg);  color: var(--tag-lead-fg); }
.exp-tag--teach { background: var(--tag-teach-bg); color: var(--tag-teach-fg); }
.exp-tag--coop  { background: var(--tag-coop-bg);  color: var(--tag-coop-fg); }

.resume-btn {
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1.5px solid var(--accent); border-radius: 999px;
  padding: 0.65rem 1.5rem; text-decoration: none; white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.resume-btn:hover { background: var(--accent); color: var(--on-accent); }

/* ---- Project cards ---- */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; margin-bottom: 4.5rem; }
.proj-card {
  text-decoration: none; cursor: pointer;
  border-radius: 10px; padding: 2rem 2.1rem; min-height: 230px;
  display: flex; flex-direction: column;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease;
}
.proj-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(26,22,20,0.16); }
.proj-card.neutral { background: var(--card-neutral); color: var(--ink); }
.proj-card.maroon  { background: var(--oxblood-fill); color: #F4EFE4; }
.proj-eyebrow {
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.4rem;
}
.proj-card.maroon .proj-eyebrow { color: rgba(244,239,228,0.6); }
.proj-title { font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.proj-card.neutral .proj-title { color: var(--accent); }
.proj-card.maroon  .proj-title { color: #F4EFE4; }
.proj-desc {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 300;
  font-size: 1.02rem; margin-top: 0.45rem; opacity: 0.8;
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.3rem; }
.proj-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
  font-size: 0.72rem; font-weight: 500; padding: 0.34rem 0.72rem; border-radius: 999px;
}
.proj-card.neutral .proj-chip { background: var(--chip-neutral); color: var(--ink); }
.proj-card.maroon  .proj-chip { background: rgba(244,239,228,0.15); color: #F4EFE4; }
.proj-foot { margin-top: auto; padding-top: 1.2rem; font-size: 0.78rem; color: var(--card-foot); }

/* ---- Certifications ---- */
.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; margin-top: 2.4rem; }
.cert-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.6rem 1.8rem;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), border-color .45s ease, box-shadow .45s ease;
  display: flex; flex-direction: column;
}
.cert-card .cert-tags { flex: 1; align-content: flex-start; }
/* a lone card on the last row sits centred under the pair above */
.cert-card:last-child:nth-child(odd) {
  grid-column: 1 / -1; justify-self: center;
  width: calc((100% - 1.6rem) / 2);
}
.cert-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 14px 32px rgba(26,22,20,0.08); }
.cert-eyebrow { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.cert-title { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 700; color: var(--ink); margin-bottom: 1.1rem; }
.cert-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cert-chip { font-size: 0.72rem; font-weight: 500; white-space: nowrap; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.32rem 0.72rem; }
.cert-credential-btn { align-self: flex-start; margin-top: 1rem; font-size: 0.8rem; font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.4rem 1rem; text-decoration: none; transition: background 0.2s ease, color 0.2s ease; }
.cert-credential-btn:hover { background: var(--ink); color: var(--on-ink); }

/* ---- Teasers (about / writing) ---- */
.teaser {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.teaser-copy { max-width: 38rem; }
.teaser-copy p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.08rem; line-height: 1.9; color: var(--text); margin-top: 0.8rem;
}

/* ---- Writing band (forest accent) ---- */
.writing-band {
  background: var(--forest);
  max-width: none;
  padding-top: 4.5rem; padding-bottom: 6.5rem;
  border-top: 1px solid rgba(244,239,228,0.12);
  border-bottom: 1px solid rgba(244,239,228,0.12);
  position: relative;
  overflow: hidden;
}
.train-track {
  position: absolute;
  left: 0; bottom: 14px;
  pointer-events: none;
  animation: trainAcross 16s linear infinite;
  will-change: transform;
}
.train-doodle {
  display: block;
  width: 118px; height: auto;
  opacity: 0.5;
  animation: trainBob 0.9s ease-in-out infinite;
}
@keyframes trainAcross {
  from { transform: translateX(-150px); }
  to   { transform: translateX(calc(100vw + 150px)); }
}
@keyframes trainBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(-0.6deg); }
}
.writing-band > .home-section-inner { max-width: 1180px; margin: 0 auto; }
.writing-band .eyebrow-tag { color: rgba(244,239,228,0.65); }
.writing-band .eyebrow-tag::before { background: #E8A598; }
.writing-band .home-h2 { color: var(--light); margin-bottom: 0.4rem; }
.writing-band .home-h2 em { color: #E8A598; }
.writing-band .teaser-copy p {
  font-family: 'Kalam', cursive;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(244,239,228,0.9);
}
.writing-band .contact-link.primary {
  background: var(--light); color: var(--forest);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  align-self: flex-start;
  margin-top: -1rem;
}
.writing-band .contact-link.primary:hover { transform: translateY(-3px); background: #fff; }
/* dark mode: the Writing band uses the maroon glow instead of green */
[data-theme="dark"] .writing-band { background: var(--oxblood-fill); }
[data-theme="dark"] .writing-band .contact-link.primary { color: #420001; }

@media (max-width: 1000px) {
  .home-hero { flex-direction: column; align-items: center; text-align: center; gap: 2.5rem; padding: 7rem 1.5rem 3rem; min-height: auto; }
  .home-hero-text { flex: 0 1 auto; }
  .home-eyebrow { justify-content: center; }
  .home-sub { margin-left: auto; margin-right: auto; font-size: 0.95rem !important; line-height: 1.55 !important; }
  .slide-unlock { margin-left: auto; margin-right: auto; }
  .home-hero-photo { align-self: center; width: 220px !important; }
  .tagline-highlight { font-weight: 700 !important; color: var(--accent) !important; }
  .mobile-only { display: inline !important; }
}
.mobile-only { display: none; }

@media (max-width: 880px) {
  .home-section { padding: 4rem 1.5rem; }
  .home-section.alt { padding: 4rem 1.5rem; }
  .home-section.page-top, #experience.page-top { padding-top: 8rem; }

  /* stack exp rows vertically */
  .exp-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.1rem 0.5rem;
  }
  .exp-row--has-tooltip .exp-row-top {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }
  .exp-tag { align-self: flex-start; margin-bottom: 0.25rem; }
  .exp-org { font-size: 1.05rem; }
  .exp-role { font-size: 0.85rem; }
  .exp-dates { font-size: 0.75rem; margin-top: 0.15rem; }
  .exp-details-intro { max-width: 100%; }
  .exp-details ul { max-width: 100%; }
  .proj-grid, .cert-grid { grid-template-columns: 1fr; }
  .cert-card:last-child:nth-child(odd) { width: auto; justify-self: stretch; }
  .exp-group-label { font-size: 0.65rem; }
}

/* ============================================================
   TYPEWRITER CURSOR
   ============================================================ */

/* ------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
}
