/* =====================================================================
   Rohan Khambekar — Portfolio
   Editorial cream & midnight-navy design system
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --cream: #F8EFDF;
  --cream-2: #F2E6D0;
  --navy: #202344;
  --navy-2: #282B52;
  --navy-3: #171933;
  --champagne: #D2A66C;
  --champagne-2: #E2BF8E;

  --ink: var(--navy);
  --ink-soft: #5D5F78;          /* secondary text on cream (AA) */
  --ink-faint: rgba(32, 35, 68, .14);
  --light: var(--cream);
  --light-soft: rgba(248, 239, 223, .68);
  --light-faint: rgba(248, 239, 223, .14);

  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 11vw, 9.5rem);
  --radius: 22px;
  --radius-lg: 32px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--champagne); color: var(--navy); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--navy); color: var(--cream);
  transform: translateY(-160%); transition: transform .25s var(--ease);
}
.skip-link:focus { transform: none; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.section-cream { background: var(--cream); color: var(--ink); }
.section-navy  { background: var(--navy); color: var(--light); }

/* ---------- Type ---------- */
.section-head { margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.01em;
}
.section-kicker {
  margin-top: 1rem;
  max-width: 30ch;
  font-size: .9rem;
  color: var(--ink-soft);
}
.section-navy .section-kicker { color: var(--light-soft); }
.eyebrow {
  font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--champagne);
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--navy); --fg: var(--cream);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .8rem 1.6rem;
  border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-size: .875rem; font-weight: 600; letter-spacing: .01em;
  transition: color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--hover-bg, var(--champagne));
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .45s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover { color: var(--hover-fg, var(--navy)); transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(32, 35, 68, .55); }
.btn svg { transition: transform .4s var(--ease); }
.btn:hover svg { transform: translateY(2px); }
.btn-sm { min-height: 42px; padding: .6rem 1.25rem; font-size: .8rem; }
.btn-navy { --bg: var(--navy); --fg: var(--cream); }
.btn-champagne { --bg: var(--champagne); --fg: var(--navy); --hover-bg: var(--cream); }
.btn-ghost-light {
  --bg: transparent; --fg: var(--cream); --hover-bg: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(248, 239, 223, .35);
}
.link-arrow {
  display: inline-flex; gap: .5rem; align-items: center;
  margin-top: 2rem; padding-bottom: .25rem;
  font-size: .875rem; font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease), gap .4s var(--ease);
}
.link-arrow:hover { gap: .9rem; background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), height .4s var(--ease);
}
.site-header.is-scrolled {
  --header-h: 64px;
  background: rgba(248, 239, 223, .94);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--ink-faint);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.logo { display: inline-flex; align-items: baseline; font-family: var(--serif); font-size: 1.9rem; line-height: 1; letter-spacing: -.02em; }
.logo-dot { color: var(--champagne); transition: transform .4s var(--ease); display: inline-block; }
.logo:hover .logo-dot { transform: translateY(-4px); }

.nav-list { display: flex; gap: clamp(1.25rem, 2.6vw, 2.5rem); }
.nav-list a {
  position: relative; font-size: .85rem; font-weight: 500; color: var(--ink-soft);
  transition: color .3s var(--ease);
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--navy); transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-list a:hover, .nav-list a.is-active { color: var(--navy); }
.nav-list a:hover::after, .nav-list a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-resume-mobile { display: none; }

.header-actions { display: flex; align-items: center; gap: .75rem; }
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1px var(--ink-faint); }
.menu-toggle span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--navy);
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-toggle span:first-child { top: 18px; }
.menu-toggle span:last-child { top: 25px; }
.menu-open .menu-toggle span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 21.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--header-h) + clamp(2rem, 6vw, 4rem));
  padding-bottom: 2rem;
  overflow: hidden;
}
.hero::before {               /* soft champagne glow */
  content: ""; position: absolute; width: 60vmax; height: 60vmax; right: -18vmax; top: -22vmax;
  background: radial-gradient(closest-side, rgba(210, 166, 108, .2), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto minmax(0, .7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-block: auto;
}
.hero-greeting {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.6rem); color: var(--ink-soft);
}
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s 1.2s var(--ease) 2; font-size: .9em; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.hero-name {
  margin-top: .6rem;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(3.4rem, 8.4vw, 7.6rem);
  line-height: .92; letter-spacing: -.025em;
}
.hero-tagline {
  margin-top: 1.6rem;
  font-size: clamp(.95rem, 1.2vw, 1.05rem); font-weight: 500;
  color: var(--ink-soft);
}

.hero-portrait { justify-self: center; }
.portrait-ring {
  position: relative;
  width: clamp(150px, 16vw, 220px); aspect-ratio: 1;
  border-radius: 50%;
  padding: 8px;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(210, 166, 108, .55), 0 30px 60px -30px rgba(32, 35, 68, .45);
}
.portrait-ring::after {      /* rotating dashed orbit */
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px dashed rgba(32, 35, 68, .22);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait-ring img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  transition: transform .8s var(--ease-out), filter .8s var(--ease);
  filter: saturate(.95);
}
.hero-portrait:hover img { transform: scale(1.05); filter: saturate(1.05); }

.hero-stat { justify-self: end; text-align: left; }
.stat-number {
  font-family: var(--serif); font-size: clamp(4.5rem, 9vw, 8rem); line-height: .85; letter-spacing: -.03em;
}
.stat-label {
  margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--ink-faint);
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}

.hero-meta {
  position: relative;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  margin-top: clamp(3rem, 7vw, 5rem); padding-top: 1.4rem;
  border-top: 1px solid var(--ink-faint);
  font-size: .8rem; color: var(--ink-soft);
}
.hero-meta::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); }
.hero-meta-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--champagne); }
.scroll-cue { margin-left: auto; display: inline-flex; gap: .4rem; font-weight: 600; color: var(--navy); }
.scroll-cue span { display: inline-block; animation: bob 2.4s var(--ease) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- About ---------- */
.about { padding-block: var(--section-y); position: relative; overflow: hidden; }
.about-grid {
  display: grid; grid-template-columns: minmax(220px, .8fr) 2fr; gap: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--light-faint);
}
.expertise-list li {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--light-faint);
  font-size: .95rem; color: var(--light);
  transition: padding-left .4s var(--ease), color .4s var(--ease);
}
.expertise-list li:first-child { padding-top: 0; }
.expertise-list li:hover { padding-left: .5rem; color: var(--champagne-2); }
.expertise-list .num { font-size: .7rem; letter-spacing: .1em; color: var(--champagne); font-variant-numeric: tabular-nums; }
.about-lead {
  font-family: var(--serif); font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.2; letter-spacing: -.005em;
  max-width: 32ch;
}
.about-cols { margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.about-cols p { font-size: .93rem; color: var(--light-soft); }

.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--light-faint);
}
.about-stats li { padding: 2rem 1.5rem 2rem 0; display: grid; gap: .5rem; align-content: start; }
.about-stats li + li { padding-left: 1.5rem; border-left: 1px solid var(--light-faint); }
.about-stat-value { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; color: var(--champagne-2); }
.about-stat-label { font-size: .82rem; color: var(--light-soft); max-width: 28ch; }

.skills-head { display: flex; align-items: center; gap: 1.5rem; margin: clamp(3rem, 6vw, 4.5rem) 0 2rem; }
.skills-head h3 { font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--champagne); white-space: nowrap; }
.skills-head .rule { flex: 1; height: 1px; background: var(--light-faint); }
.skills-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: clamp(.75rem, 1.6vw, 1.25rem); }
.skill-card {
  position: relative;
  display: grid; place-items: center; gap: .7rem; align-content: center;
  aspect-ratio: 1; padding: .75rem;
  border-radius: var(--radius);
  background: var(--cream); color: var(--navy);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 18px 30px -22px rgba(0,0,0,.6);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), background-color .4s var(--ease);
}
.skill-card:hover { transform: translateY(-6px) rotate(-1.5deg); background: #fff8ea; box-shadow: 0 30px 40px -24px rgba(0,0,0,.7); }
.skill-icon { width: clamp(30px, 2.8vw, 40px); height: clamp(30px, 2.8vw, 40px); display: grid; place-items: center; transition: transform .5s var(--ease-out); }
.skill-card:hover .skill-icon { transform: scale(1.1); }
.skill-icon img { width: 100%; height: 100%; object-fit: contain; }
.skill-mono { font-family: var(--serif); font-size: 1.6rem; line-height: 1; color: var(--navy); }
.skill-name { font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); text-align: center; line-height: 1.2; }

/* ---------- Services ---------- */
.services { padding-block: var(--section-y); }
.services-grid { display: grid; grid-template-columns: minmax(240px, .8fr) 2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.services-head { position: sticky; top: calc(var(--header-h) + 2rem); margin-bottom: 0; }
.service-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 4vw, 3.5rem); }
.service {
  position: relative;
  padding: 2rem 0 2.25rem;
  border-top: 1px solid var(--ink-faint);
}
.service::before {           /* animated hairline */
  content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: 100%;
  background: var(--navy); transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease-out);
}
.service:hover::before { transform: scaleX(1); }
.service-num { font-size: .7rem; font-weight: 600; letter-spacing: .12em; color: var(--champagne); }
.service-title {
  margin-top: .75rem;
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.45rem, 2.1vw, 1.8rem); line-height: 1.1;
  transition: transform .5s var(--ease-out);
}
.service:hover .service-title { transform: translateX(6px); }
.service-text { margin-top: .75rem; font-size: .9rem; color: var(--ink-soft); max-width: 40ch; }

/* ---------- Experience ---------- */
.experience { padding-block: var(--section-y); }
.exp-list { border-top: 1px solid var(--light-faint); }
.exp-item { border-bottom: 1px solid var(--light-faint); position: relative; }
.exp-item::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--champagne); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out);
}
.exp-item:hover::before, .exp-item.is-open::before { transform: scaleX(1); }
.exp-row {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 1.3fr 1.5fr 1fr 1fr 28px; gap: 1.5rem; align-items: center;
  padding: 1.75rem 0;
}
.exp-role { font-family: var(--serif); font-size: clamp(1.35rem, 2.1vw, 1.75rem); line-height: 1.1; transition: color .3s var(--ease), transform .5s var(--ease-out); }
.exp-row:hover .exp-role { color: var(--champagne-2); transform: translateX(6px); }
.exp-company, .exp-type, .exp-duration { font-size: .85rem; color: var(--light-soft); }
.exp-company { color: var(--light); }
.exp-duration { text-align: right; font-variant-numeric: tabular-nums; }
.exp-loc { opacity: .7; }
.exp-toggle { position: relative; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--light-faint); transition: background-color .3s var(--ease); }
.exp-toggle::before, .exp-toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: var(--cream);
  transform: translate(-50%, -50%); transition: transform .4s var(--ease);
}
.exp-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.exp-item.is-open .exp-toggle { background: var(--champagne); }
.exp-item.is-open .exp-toggle::before, .exp-item.is-open .exp-toggle::after { background: var(--navy); }
.exp-item.is-open .exp-toggle::after { transform: translate(-50%, -50%) rotate(0); }

.exp-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.exp-item.is-open .exp-detail { grid-template-rows: 1fr; }
.exp-detail-inner { overflow: hidden; }
.exp-summary, .exp-highlights { max-width: 760px; margin-left: calc((100% - 28px - 6rem) * 1.3 / 4.8 + 1.5rem); }
.exp-summary { font-size: .88rem; color: var(--champagne-2); margin-bottom: 1rem; }
.exp-highlights { display: grid; gap: .6rem; padding-bottom: 2rem; }
.exp-highlights li { position: relative; padding-left: 1.4rem; font-size: .9rem; color: var(--light-soft); }
.exp-highlights li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--champagne); }

.education { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; grid-template-columns: minmax(220px, .8fr) 2fr; gap: clamp(2rem, 6vw, 5rem); }
.education h3 { font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--champagne); padding-top: .3rem; }
.education li { display: grid; grid-template-columns: 1.2fr 1.5fr auto; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--light-faint); font-size: .88rem; color: var(--light-soft); }
.education li:first-child { padding-top: 0; }
.edu-degree { font-family: var(--serif); font-size: 1.2rem; color: var(--light); line-height: 1.2; }

/* ---------- Featured Work ---------- */
.work { padding-block: var(--section-y) calc(var(--section-y) * .55); overflow: hidden; }
.work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.carousel-controls { display: flex; align-items: center; gap: .75rem; }
.carousel-count { margin-right: .75rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.carousel-count [data-current] { color: var(--navy); }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(32, 35, 68, .25);
  transition: background-color .35s var(--ease), color .35s var(--ease), transform .35s var(--ease), opacity .3s;
}
.round-btn:hover:not(:disabled) { background: var(--navy); color: var(--cream); transform: scale(1.06); }
.round-btn:disabled { opacity: .3; cursor: default; }

.carousel { --slide-w: min(1080px, calc(100vw - var(--gutter) * 2 - 4vw), max(640px, calc((100svh - 220px) * 16 / 9))); }
.carousel-track {
  display: flex; gap: clamp(1rem, 2.5vw, 2rem);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 1rem calc((100vw - var(--slide-w)) / 2) 2rem;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline-offset: -4px; }
.slide { flex: 0 0 var(--slide-w); scroll-snap-align: center; transition: opacity .6s var(--ease), transform .6s var(--ease-out); opacity: .4; transform: scale(.96); }
.slide.is-active { opacity: 1; transform: none; }

.project {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--navy); color: var(--light);
  overflow: hidden;
  box-shadow: 0 40px 80px -50px rgba(32, 35, 68, .8);
}
.project-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy-2); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.project:hover .project-media img { transform: scale(1.04); }
.project-info {
  position: absolute; left: clamp(1rem, 2.5vw, 2rem); bottom: clamp(1rem, 2.5vw, 2rem);
  width: min(460px, calc(100% - 2rem));
  padding: clamp(1.25rem, 2.4vw, 1.9rem);
  border-radius: var(--radius);
  background: rgba(32, 35, 68, .88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(248, 239, 223, .1);
  transition: transform .6s var(--ease-out);
}
.project:hover .project-info { transform: translateY(-6px); }
.project-kind { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--champagne); }
.project-name { margin-top: .5rem; font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.05; }
.project-desc { margin-top: .7rem; font-size: .85rem; color: var(--light-soft); }
.project-tech { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.project-tech li { padding: .25rem .7rem; border-radius: 999px; font-size: .7rem; font-weight: 500; box-shadow: inset 0 0 0 1px rgba(248, 239, 223, .22); color: var(--light); }
.project-links { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.project-private { font-size: .75rem; color: var(--light-soft); font-style: italic; }

.carousel-dots { display: flex; justify-content: center; gap: .5rem; }
.dot { width: 28px; height: 28px; position: relative; }
.dot::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 999px;
  background: rgba(32, 35, 68, .22); transform: translate(-50%, -50%);
  transition: width .5s var(--ease-out), background-color .3s var(--ease);
}
.dot[aria-selected="true"]::before { width: 26px; background: var(--navy); }

/* ---------- Contact ---------- */
.contact { padding-block: calc(var(--section-y) * .45) calc(var(--section-y) * .6); }
.contact-card {
  position: relative; overflow: hidden; isolation: isolate;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1.5rem, 6vw, 5rem);
  border-radius: var(--radius-lg);
  background: var(--navy); color: var(--light);
}
.contact-card::before, .contact-card::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(210, 166, 108, .18);
}
.contact-card::before { width: 640px; height: 640px; left: -260px; top: -380px; }
.contact-card::after { width: 520px; height: 520px; right: -220px; bottom: -340px; background: radial-gradient(closest-side, rgba(210,166,108,.12), transparent); }
.contact-title { margin: 1.25rem auto 0; max-width: 16ch; font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.75rem); line-height: 1; letter-spacing: -.015em; }
.contact-text { margin: 1.5rem auto 0; max-width: 52ch; font-size: .98rem; color: var(--light-soft); }
.contact-actions { margin-top: 2.5rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; }
.contact-email {
  display: inline-block; margin-top: 2rem;
  font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--champagne-2);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out);
}
.contact-email:hover { background-size: 100% 1px; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 1.5rem 2.5rem; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; padding-bottom: 2.75rem; }
.footer-brand .logo { font-size: 2.6rem; }
.footer-line { margin-top: .6rem; max-width: 34ch; font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.3; color: var(--ink-soft); }
.social-list { display: flex; flex-wrap: wrap; gap: clamp(.9rem, 2.4vw, 1.6rem); }
.social.is-placeholder { opacity: .38; cursor: default; }
.social.is-placeholder .social-circle { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px rgba(32, 35, 68, .45); }
.social { display: grid; justify-items: center; gap: .6rem; }
.social-circle {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--cream);
  transition: transform .5s var(--ease-out), background-color .35s var(--ease), color .35s var(--ease), box-shadow .5s var(--ease-out);
}
.social:hover .social-circle, .social:focus-visible .social-circle {
  transform: translateY(-5px); background: var(--champagne); color: var(--navy);
  box-shadow: 0 16px 24px -14px rgba(32, 35, 68, .6);
}
.social-label { font-size: .75rem; font-weight: 600; color: var(--ink-soft); transition: color .3s var(--ease); }
.social:hover .social-label { color: var(--navy); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.5rem; border-top: 1px solid var(--ink-faint);
  font-size: .8rem; color: var(--ink-soft);
}
.footer-bottom a:hover { color: var(--navy); }

/* ---------- Reveal animation ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0ms); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .hero .reveal:nth-child(2) { --d: 90ms; }
.js-reveal .hero .reveal:nth-child(3) { --d: 180ms; }
.js-reveal .hero-portrait { --d: 240ms; }
.js-reveal .hero-stat { --d: 340ms; }
.js-reveal .hero-meta { --d: 450ms; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .skills-grid { grid-template-columns: repeat(6, 1fr); }
  .exp-row { grid-template-columns: 1.3fr 1.4fr 1fr 28px; }
  .exp-duration { grid-column: 3; grid-row: 2; text-align: left; margin-top: -1rem; }
  .exp-type { grid-column: 2; grid-row: 2; margin-top: -1rem; }
  .exp-company { grid-column: 2; grid-row: 1; }
  .exp-toggle { grid-column: 4; grid-row: 1 / span 2; }
  .exp-role { grid-row: 1 / span 2; }
  .exp-summary, .exp-highlights { margin-left: calc((100% - 28px - 4.5rem) * 1.3 / 3.7 + 1.5rem); }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .menu-toggle { display: block; }
  .header-resume { display: none; }
  .nav {
    position: fixed; inset: 0; z-index: -1;
    display: flex; flex-direction: column; justify-content: center; gap: 2.5rem;
    padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
    background: var(--cream);
    clip-path: circle(0 at calc(100% - var(--gutter) - 22px) calc(var(--header-h) / 2));
    transition: clip-path .7s var(--ease-out), visibility 0s .7s;
    visibility: hidden;
  }
  .menu-open .nav { clip-path: circle(150% at calc(100% - var(--gutter) - 22px) calc(var(--header-h) / 2)); transition: clip-path .8s var(--ease-out); visibility: visible; }
  .menu-open { overflow: hidden; }
  .menu-open .site-header { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-list { flex-direction: column; gap: .25rem; }
  .nav-list a { display: block; padding: .35rem 0; font-family: var(--serif); font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1.1; color: var(--navy); font-weight: 400; }
  .nav-list a::after { display: none; }
  .nav-list li { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .6s var(--ease-out); }
  .menu-open .nav-list li { opacity: 1; transform: none; }
  .menu-open .nav-list li:nth-child(1) { transition-delay: .12s; }
  .menu-open .nav-list li:nth-child(2) { transition-delay: .17s; }
  .menu-open .nav-list li:nth-child(3) { transition-delay: .22s; }
  .menu-open .nav-list li:nth-child(4) { transition-delay: .27s; }
  .menu-open .nav-list li:nth-child(5) { transition-delay: .32s; }
  .nav-resume-mobile { display: inline-flex; align-self: flex-start; }

  .hero { min-height: auto; padding-top: calc(var(--header-h) + 4.5rem); }
  .hero-meta { margin-top: 4rem; }
  .hero-grid { grid-template-columns: 1fr auto; grid-template-areas: "intro intro" "portrait stat"; row-gap: 3rem; }
  .hero-intro { grid-area: intro; }
  .hero-portrait { grid-area: portrait; justify-self: start; }
  .hero-stat { grid-area: stat; }

  .about-grid, .services-grid, .education { grid-template-columns: 1fr; }
  .services-head { position: static; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
  .exp-summary, .exp-highlights { margin-left: 0; }
  .exp-row { grid-template-columns: 1fr 28px; gap: .35rem 1rem; }
  .exp-role, .exp-company, .exp-type, .exp-duration, .exp-toggle { grid-column: auto; grid-row: auto; margin-top: 0; }
  .exp-role { grid-column: 1; grid-row: 1; margin-bottom: .35rem; }
  .exp-toggle { grid-column: 2; grid-row: 1; }
  .exp-company { grid-column: 1 / -1; }
  .exp-type, .exp-duration { grid-column: 1 / -1; text-align: left; }

  .project-info { position: static; width: auto; border-radius: 0; background: var(--navy); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  .project:hover .project-info { transform: none; }
}

@media (max-width: 640px) {
  :root { --radius-lg: 24px; --radius: 18px; }
  .hero { min-height: auto; padding-bottom: 1.5rem; }
  .hero-name { font-size: clamp(3rem, 15vw, 4.4rem); }
  .hero-grid { row-gap: 2.5rem; column-gap: 1.5rem; }
  .portrait-ring { width: 128px; }
  .stat-number { font-size: 4.25rem; }
  .hero-meta { gap: .75rem; }
  .hero-meta-sep { display: none; }
  .hero-meta > span:nth-child(3) { display: none; }

  .about-cols { grid-template-columns: 1fr; gap: 1rem; }
  .about-stats { grid-template-columns: 1fr; }
  .about-stats li, .about-stats li + li { padding: 1.5rem 0; border-left: 0; }
  .about-stats li + li { border-top: 1px solid var(--light-faint); }
  .skills-grid { grid-template-columns: repeat(4, 1fr); gap: .6rem; }
  .skill-card { padding: .4rem; gap: .4rem; border-radius: 16px; }
  .skill-icon { width: 28px; height: 28px; }
  .skill-name { font-size: .62rem; }

  .service-list { grid-template-columns: 1fr; }
  .service { padding: 1.6rem 0 1.75rem; }

  .education li { grid-template-columns: 1fr auto; gap: .25rem 1rem; }
  .edu-school { grid-column: 1; grid-row: 2; }
  .edu-year { grid-column: 2; grid-row: 1; }

  .carousel { --slide-w: calc(100vw - var(--gutter) * 2); }
  .carousel-track { gap: .75rem; }
  .carousel-count { display: none; }
  .round-btn { width: 46px; height: 46px; }
  .project-media { aspect-ratio: 16 / 10; }

  .contact-actions .btn { flex: 1 1 100%; }
  .contact-email { word-break: break-all; }
  .social-circle { width: 50px; height: 50px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-top { flex-direction: column; align-items: center; text-align: center; }
  .social-list { justify-content: center; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
