/* ============ v2 — MHI-inspired redesign ============ */
/* 1. Tokens */
:root {
  --brand: #6a80d5; --brand-deep: #5075bb; --periwinkle: #88a3d8;
  --green: #c7f2bc; --green-soft: #cbf5d1; --ice: #d1f3f5; --ice-soft: #ddeefe;
  --accent-name: #1f6fb0; --accent-warm: #b54769; --accent-rust: #be431b;
  --paper: #fbfdff; --ink: #101321; --ink-soft: #3f4658; --line: #d9e2ef;
  /* Project tag tints — light red/orange/purple derived at the same lightness
     as --green (L=0.84) so all the chips read as one family. */
  --tag-red: #f4bdba; --tag-orange: #f4d5ba; --tag-purple: #d9baf4;
  /* v1 used Mako for everything; both tokens point at it so the whole site
     matches the original typeface. */
  --font-display: "Mako", system-ui, sans-serif;
  --font-body: "Mako", system-ui, sans-serif;
  --header-h: 72px;
}
/* 2. Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--ink); background: var(--paper);
       line-height: 1.65; font-size: 1.06rem; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
/* 3. Typography */
/* Mako (v1's font) ships one 400 weight — asking for 700/800 yields a synthetic
   faux-bold, so hierarchy comes from size and spacing instead, as it did in v1. */
h1, h2, .display { font-family: var(--font-display); font-weight: 400;
                   line-height: 1.1; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.35rem; font-weight: 400; }
/* v1 heritage class kept on page titles across projects/exp/faq. */
.sub-title { margin-bottom: 0.6rem; }
/* Page title followed by a section heading (experience page): a faint rule
   under the title and more air before the first section heading. */
.sub-title--rule { padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); margin-bottom: 2.2rem; }
/* Mako ships one weight; anything heavier gets synthesized and looks like another face. */
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
           color: var(--brand-deep); font-weight: 400; }
/* 4. Layout primitives */
/* The fixed header reserves no space, so every page's first band must clear it.
   .hero opts out — it deliberately runs full-bleed under the transparent bar. */
main { padding-top: var(--header-h); }
.hero { margin-top: calc(-1 * var(--header-h)); }
html { scroll-padding-top: var(--header-h); }
.container { width: min(1120px, 92vw); margin-inline: auto; }
.band { padding-block: clamp(3.5rem, 9vw, 7rem); }
.band--ice { background: linear-gradient(180deg, var(--ice-soft), var(--ice)); }
/* 5. Shared atoms */
.arrow-link { display: inline-flex; align-items: center; gap: 0.5rem;
              font-weight: 500; text-decoration: none; color: var(--brand-deep); }
.arrow-link::after { content: "\2192"; transition: transform 0.3s ease; }
.arrow-link:hover::after { transform: translateX(6px); }
.chip { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px;
        background: var(--green); color: var(--ink); font-size: 0.78rem; }
/* Per-category tags. Add class="chip chip--web" etc. alongside .chip.
   --web uses the full brand indigo, so it takes white text for contrast. */
.chip--research { background: var(--green); }
.chip--web      { background: var(--brand); color: #fff; }
.chip--teaching { background: var(--tag-red); }
.chip--final    { background: var(--tag-orange); }
.chip--side     { background: var(--tag-purple); }
.chip--patent   { background: var(--ice); }
/* font-family is explicit because .btn is also used on <button>, which
   doesn't inherit the page font. */
.btn { display: inline-block; padding: 0.85rem 1.8rem; border-radius: 999px;
       background: var(--brand); color: #fff; text-decoration: none; border: 0;
       font-family: var(--font-body);
       font-size: 1rem; cursor: pointer; transition: background 0.3s ease, transform 0.3s ease; }
.btn:hover { background: var(--brand-deep); transform: translateY(-2px); }
/* ============ Header / overlay menu / footer ============ */
.site-header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 40;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease; }
/* Over the homepage hero the bar reads as a pale stripe across the artwork.
   Sit transparent on the image, then fade the surface in once scrolled. */
body.at-top .site-header { background: transparent; backdrop-filter: none;
  border-bottom-color: transparent; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-header .logo { width: 56px; height: 40px; }
/* Icon-only hamburger (inline SVG, no icon-font dependency); the label lives in aria-label. */
.menu-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.4rem;
  background: none; border: 0; cursor: pointer; color: var(--ink); border-radius: 8px; }
.menu-btn__icon { width: 1.75rem; height: 1.75rem; display: block; }
.menu-btn:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
#menu-overlay { position: fixed; inset: 0; z-index: 50;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 55%, var(--periwinkle));
  display: flex; align-items: center;
  opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
#menu-overlay.open { opacity: 1; visibility: visible; }
#menu-overlay .container { display: flex; flex-direction: column; gap: 0.5rem; }
#menu-overlay a { font-family: var(--font-display); font-weight: 400; color: #fff;
  text-decoration: none; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.25;
  display: inline-flex; align-items: center; gap: 1rem;
  opacity: 0; transform: translateY(18px); transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: calc(var(--i) * 70ms); }
#menu-overlay.open a { opacity: 1; transform: none; }
#menu-overlay a::after { content: "\2192"; font-size: 0.6em; opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease; }
#menu-overlay a:hover::after { opacity: 1; transform: translateX(8px); }
#menu-overlay .close-btn { position: absolute; top: 1.4rem; right: max(4vw, 1.4rem);
  background: none; border: 0; color: #fff; cursor: pointer; padding: 0.4rem; border-radius: 8px; }
#menu-overlay .close-btn__icon { width: 1.75rem; height: 1.75rem; display: block; }
#menu-overlay .close-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.menu-open { overflow: hidden; }
/* Floating resume CTA (MHI floating-donate pattern) */
.fab-resume { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 30;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--brand-deep); color: #fff; text-decoration: none;
  padding: 0.8rem 1.3rem; border-radius: 999px; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgb(80 117 187 / 0.35);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease; }
/* Inline SVG so the icon doesn't depend on an icon font. */
.fab-resume__icon { width: 1.1em; height: 1.1em; flex: none; }
/* A 3px lift alone reads as "nothing happened"; add colour + shadow so the
   affordance is unmistakable. */
.fab-resume:hover { transform: translateY(-3px); background: var(--brand);
  box-shadow: 0 12px 30px rgb(80 117 187 / 0.45); }
/* Footer */
.site-footer { background: var(--ink); color: #cfd8ea; padding-block: 3rem 2rem; margin-top: 0; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: center; }
.site-footer nav a { color: #cfd8ea; text-decoration: none; margin-right: 1.4rem; font-size: 0.95rem; }
.site-footer nav a:hover { color: #fff; }
.site-footer .social a { color: #cfd8ea; font-size: 1.4rem; margin-left: 1rem; }
.site-footer .social a:hover { color: var(--green); }
.site-footer .fineprint { width: 100%; font-size: 0.8rem; color: #8b96ad; }
/* ============ Motion ============ */
.reveal { opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
/* Stagger delay is set per item by initReveals() when a batch enters view. */
.reveal-group > * { opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-group > .in { opacity: 1; transform: none; }
/* ============ Accordion ============ */
.acc { border-bottom: 1px solid var(--line); }
.acc__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  padding: 1.1rem 0; font-family: var(--font-body); color: var(--ink);
  /* Buttons don't inherit font-size (UA default is ~13px): size the label like an h3. */
  font-size: 1.35rem; line-height: 1.3; }
.proj-card .acc__head { font-size: 1.05rem; }
.acc__head .acc__icon { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--brand-deep); color: var(--brand-deep);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease; }
.acc.open .acc__icon { transform: rotate(45deg); background: var(--brand-deep); color: #fff; }
.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.acc.open .acc__body { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; }
.acc__inner > :first-child { margin-top: 0.2rem; }
.acc__inner > :last-child { margin-bottom: 1.2rem; }
/* ============ Page transitions ============ */
/* Cross-document view transitions (Chrome 126+, Safari 18.2+): the outgoing
   page fades and lifts away while the new one fades and rises in, on the
   same easing and duration as the menu overlay. The fixed header and resume
   button get their own groups so they appear to stay put between pages. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out 0.3s ease both; }
::view-transition-new(root) { animation: page-in 0.45s ease both; }
.site-header { view-transition-name: site-header; }
.fab-resume  { view-transition-name: fab-resume; }
@keyframes page-out { to   { opacity: 0; transform: translateY(-14px); } }
@keyframes page-in  { from { opacity: 0; transform: translateY(18px); } }
/* Fallback for browsers without cross-document transitions: js/site.js adds
   .vt-fallback, fades the page out before following an internal link, and
   the arriving page fades in. Opacity only — a transform on <body> would
   re-anchor the fixed header. */
html.vt-fallback body { animation: page-fade-in 0.45s ease both; }
html.vt-fallback body.leaving { opacity: 0; transition: opacity 0.3s ease; }
@keyframes page-fade-in { from { opacity: 0; } }
/* Reduced motion: everything instant */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important; }
  /* Covers every animated selector in v2: motion system, chrome (T3),
     atoms (T2), and page-level hover/idle animations (T6+). */
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-group > * { opacity: 1; transform: none; }
}
/* ============ Home ============ */
.hero { min-height: 100svh; display: flex; align-items: center;
  background: url("../images/opt/hero-bg.jpg") center / cover no-repeat; padding-top: var(--header-h); }
.hero__name { color: var(--accent-name); }
.typewriter { font-size: 1.3rem; min-height: 2rem; }
#typewriter-text, .cursor { color: var(--accent-name); }
.cursor { animation: blink 1s infinite; font-weight: 700; }
@keyframes blink { 0%,50% {opacity:1} 51%,100% {opacity:0} }
/* Name panel: pronunciation (a play button) · Gujarati · meaning */
.name-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6em 0.75em;
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.25; }
.name-panel__item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1em; }
/* Small caption above each value; same voice as .eyebrow. */
.name-panel__label { font-family: var(--font-body); font-size: 0.8rem; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--brand-deep); font-weight: 400; }
.name-panel__dot { color: var(--brand); }
.name-panel__pron em { font-style: italic; }
.name-panel__script { font-family: "Noto Sans Gujarati", var(--font-display); }
.name-panel__meaning { color: var(--ink-soft); }
.name-panel__say { display: inline-flex; align-items: center; gap: 0.35em;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  border-radius: 6px; }
.name-panel__say:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 6px; }
/* Speaker hint (inline SVG) stays faint until hovered, focused, or playing. */
.name-panel__icon { width: 0.5em; height: 0.5em; flex: none; fill: currentColor;
  color: var(--brand-deep); opacity: 0.4; transition: opacity 0.3s ease, transform 0.3s ease; }
.name-panel__say:hover .name-panel__icon, .name-panel__say:focus-visible .name-panel__icon { opacity: 1; }
.name-panel__say.playing .name-panel__icon { opacity: 1; transform: scale(1.2); }
/* No clip available: plain text, no affordance. */
.name-panel__say.no-audio { cursor: default; }
.name-panel__say.no-audio .name-panel__icon { display: none; }
@media (max-width: 720px) {
  .name-panel { flex-direction: column; align-items: flex-start; gap: 0.3em; }
  .name-panel__dot { display: none; }
}
@media (max-width: 720px) {
  .hero { background:
    linear-gradient(135deg, #6a80d5 0%, #88a3d8 22%, #c7f2bc 55%, #d1f3f5 80%, #ddeefe 100%); }
  .hero__inner { text-align: center; }
}
.in-view-immediate > * { opacity: 1 !important; transform: none !important; }
/* ============ About ============ */
/* Photo centers against the full height of the text column beside it, rather
   than pinning to the top — the text runs much taller once a tab is open. */
/* Two columns only while there's room for both. Below ~950px the photo
   degrades into a sliver and the text into a cramped column, so stack early
   rather than waiting for the 720px mobile breakpoint. */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 950px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-col-1 { max-width: 360px; margin-inline: auto; }
  /* Stacked: centre the text block under the photo like the photo itself.
     640px fits the 60ch paragraph; the text inside stays left-aligned. */
  .about-col-2 { max-width: 640px; margin-inline: auto; }
}
.about-col-1 img { border-radius: 18px; }
.about-col-2 p { color: var(--ink-soft); margin-top: 1.2rem; max-width: 60ch; }
/* Row-gap matters because the six tabs wrap onto a second line at most widths;
   without it a wrapped tab's underline collides with the row beneath. */
.tab-titles { display: flex; flex-wrap: wrap; margin: 2rem 0 2.2rem; gap: 1.5rem 2.4rem; }
/* Buttons for keyboard operability; the reset keeps them rendering exactly as
   the <p> elements they replaced. */
/* The six tabs wrap onto two rows (the column is ~590px, not the viewport),
   so the underline needs clear space on BOTH sides: enough padding above it to
   read as attached to its own label, and row-gap below so it doesn't crowd the
   wrapped row beneath. */
.tab-links { font: inherit; background: none; border: 0; color: inherit;
  text-align: inherit; font-size: 1rem; font-weight: 500; cursor: pointer;
  position: relative; padding: 0 0 0.75rem; }
.tab-links::after { content: ""; width: 0; height: 3px; background: var(--accent-warm);
  position: absolute; left: 0; bottom: 0.3rem; transition: width 0.4s ease; }
.tab-links.active-link::after { width: 100%; }
/* Mouse users see no focus ring at all; keyboard users get a visible one. */
.tab-links:focus { outline: none; }
.tab-links:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 3px; }
/* Panels range from 2 to 9 items. A fixed height (not max-height) keeps the
   column from resizing on every tab switch, which otherwise made the centered
   photo beside it jump. */
.tab-contents { height: 460px; overflow-y: auto; }
.tab-contents:not(.active-tab) { display: none; }
.tab-contents::-webkit-scrollbar { width: 6px; }
.tab-contents::-webkit-scrollbar-track { background: transparent; }
.tab-contents::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.tab-contents { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tab-contents ul li { list-style: none; margin: 0.7rem 0; }
.tab-contents ul li span, .about-accs ul li span { color: var(--accent-warm); font-size: 0.85rem; }
.about-accs ul li { list-style: none; margin: 0.7rem 0; }
.about-accs { display: none; }
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-col-1 { max-width: 320px; margin-inline: auto; }
  .tab-titles, .tab-contents { display: none; }
  .about-accs { display: block; }
}
/* ============ Projects ============ */
.proj-note { color: var(--ink-soft); font-weight: 400; margin-top: 0.6rem; max-width: 65ch; }
/* min() keeps the track from exceeding the container on narrow phones
   (92vw of a 320px viewport is 294px, below the 320px minimum). */
.proj-grid { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem; margin-top: 2.4rem; }
.proj-card { background: #fff; border-radius: 18px; padding: 2rem; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease; }
.proj-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgb(80 117 187 / 0.15); }
.proj-card__icon { font-size: 2.1rem; color: var(--brand-deep); margin-bottom: 0.8rem; }
.proj-card .chip { margin-bottom: 0.6rem; }
/* Several chips on one card sit side by side (the card itself is a flex column). */
.proj-card .chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.proj-card .chip-row .chip { margin-bottom: 0; }
.proj-card h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.proj-card__lede { color: var(--ink-soft); }
.proj-card .acc { border-bottom: none; width: 100%; }
.proj-card .acc__inner p { color: var(--ink-soft); margin-bottom: 0.9rem; }
.proj-card .acc__inner p:last-child { margin-bottom: 0; }
.proj-card p span { color: var(--accent-rust); font-weight: 500; }
.proj-card .arrow-link { margin-top: 0.8rem; }
/* ============ Experience ============ */
.exp-head-line { display: flex; align-items: center; gap: 1rem; }
.exp-head-line > i { font-size: 1.5rem; color: var(--brand-deep); width: 2rem; flex: none; text-align: center; }
.exp-meta { display: block; font-size: 0.9rem; color: var(--ink-soft); font-weight: 400; }
/* Body copy starts where the title does: icon width (2rem) + gap (1rem). */
.acc:has(.exp-head-line) .acc__inner { padding-left: 3rem; }
.acc-list { margin-top: 1.5rem; }
.acc__inner ul { padding-left: 1.2rem; margin-block: 0.6rem; }
.acc__inner h4 { font-family: var(--font-display); font-weight: 400; margin-top: 1.4rem;
  color: var(--brand-deep); }
.acc__inner p { margin-block: 0.6rem; }
.acc__inner .arrow-link { margin-top: 0.8rem; }
/* ============ FAQ ============ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.contact-lede { font-size: 1.35rem; color: var(--ink-soft); margin-top: 0.4rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 42rem; margin-top: 1.6rem; }
.contact-form input, .contact-form textarea { font-family: var(--font-body); font-size: 1rem;
  color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1rem; resize: vertical; }
/* Focus ring uses --brand-deep, not --ice: a light-cyan outline on a white
   input over the ice-tinted band is too low-contrast for keyboard users. */
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--brand-deep); outline-offset: 2px;
  border-color: var(--brand); }
.contact-form .btn { align-self: flex-start; }
#msg { display: block; margin-top: 1rem; color: var(--brand-deep); font-weight: 500; }
