/* ---------- Tokens ---------- */
/* Palette from meridial.ai: carbon, warm whites, electric blue, hypercitrus, soft sand, midnight blue */
:root {
  --bg: #fffdf9;
  --bg-alt: #f6f0e4;
  --surface: #ffffff;
  --text: #0f0f0f;
  --muted: #606060;
  --line: rgba(15, 15, 15, 0.09);
  --accent: #0c76fe;
  --tile: #f5f5f7;
  --link: #0066cc;
  --accent-hover: #0a66db;
  --btn-bg: #0f0f0f;
  --btn-text: #ffffff;
  --btn-hover: #2b2b2b;
  --citrus: #dcf58f;
  --sand: #e3cfa9;
  --sky: #bedaea;
  --navy: #24246e;
  --nav-bg: rgba(255, 253, 249, 0.75);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 40px rgba(0, 0, 0, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --bg-alt: #171717;
    --surface: #1d1d1d;
    --text: #f6f0e4;
    --muted: #9d9d9d;
    --line: rgba(255, 255, 255, 0.10);
    --accent: #5aa2ff;
    --tile: #1d1d1f;
    --link: #2997ff;
    --accent-hover: #7ab4ff;
    --btn-bg: #dcf58f;
    --btn-text: #0f0f0f;
    --btn-hover: #e8fab0;
    --nav-bg: rgba(15, 15, 15, 0.72);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 18px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; margin-bottom: 16px;
  padding: 5px 12px; border-radius: 980px; background: var(--citrus); color: #0f0f0f;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: 980px;
  background: var(--btn-bg); color: var(--btn-text);
  font-size: 16px; font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.btn--ghost { background: transparent; color: var(--text); padding-left: 8px; padding-right: 8px; }
.btn--ghost:hover { background: transparent; text-decoration: underline; }
.btn--outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn--outline:hover { background: var(--bg-alt); }
.btn--small { padding: 7px 15px; font-size: 14px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
.nav__brand { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; margin-right: auto; }
.nav__links { display: flex; gap: 28px; font-size: 14px; }
.nav__links a { color: var(--muted); transition: color 0.2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__toggle { display: none; background: none; border: 0; width: 36px; height: 36px; padding: 0; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease); }
.nav__toggle span:first-child { top: 14px; }
.nav__toggle span:last-child { top: 21px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 20px 0 40px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.hero__actions--center { justify-content: center; }

/* Title overlaid on the right side of the slideshow */
.stage__overlay {
  position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: min(46%, 580px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 0 96px 64px; color: #fff;
}
.hero__kicker {
  align-self: flex-start; font-size: 14px; font-weight: 500; letter-spacing: 0;
  padding: 6px 14px; border-radius: 980px; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.hero__title { font-size: clamp(40px, 5.2vw, 76px); letter-spacing: -0.045em; line-height: 1; margin-top: 0; color: #fff; }
.hero__lead { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: rgba(255, 255, 255, 0.82); margin-top: 18px; letter-spacing: -0.01em; }
.stage__overlay .hero__actions { margin-top: 28px; }
.btn--light { background: #fff; color: #0f0f0f; }
.btn--light:hover { background: rgba(255, 255, 255, 0.86); }
.btn--on-dark { color: #fff; }

/* Staggered entrance for overlay text */
.stage__overlay > * { opacity: 0; transform: translateY(16px); animation: overlay-in 1s var(--ease) forwards; }
.stage__overlay > :nth-child(2) { animation-delay: 0.1s; }
.stage__overlay > :nth-child(3) { animation-delay: 0.2s; }
.stage__overlay > :nth-child(4) { animation-delay: 0.3s; }
@keyframes overlay-in { to { opacity: 1; transform: none; } }

/* Slideshow stage */
.container--wide { max-width: 1280px; }
.stage {
  position: relative; overflow: hidden; max-height: calc(100svh - 96px); min-height: 420px; width: 100%;
  border-radius: 32px; background: #0f0f0f; aspect-ratio: 16 / 9;
  transition-delay: 0s;
}
.stage__slides, .stage__slide { position: absolute; inset: 0; }
.stage__slide { opacity: 0; transition: opacity 1.4s var(--ease); }
.stage__slide.is-active { opacity: 1; }
.stage__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.stage__slide.is-active img { transform: scale(1); transition: transform calc(var(--dur, 6000ms) + 1600ms) linear; }
.stage::after { /* right-side + bottom shading so overlay text, caption & controls read cleanly */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(10, 12, 20, 0.78) 0%, rgba(10, 12, 20, 0.55) 30%, rgba(10, 12, 20, 0) 62%),
    linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 32%);
}
.stage__caption {
  position: absolute; left: 32px; bottom: 30px; z-index: 2; max-width: 60%;
  color: #fff; font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.stage__caption.is-changing { opacity: 0; transform: translateY(6px); }
.stage__controls { position: absolute; right: 24px; bottom: 22px; z-index: 2; display: flex; align-items: center; gap: 10px; }
.stage__dots {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 980px;
  background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.stage__dots button {
  position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 980px; cursor: pointer;
  background: rgba(255, 255, 255, 0.5); overflow: hidden; transition: width 0.4s var(--ease), background 0.3s;
}
.stage__dots button:hover { background: rgba(255, 255, 255, 0.8); }
.stage__dots button[aria-selected="true"] { width: 44px; background: rgba(255, 255, 255, 0.4); }
.stage__dots button span { position: absolute; inset: 0; width: 0; background: #fff; border-radius: inherit; }
.stage__dots button[aria-selected="true"] span { width: 100%; }
.stage__dots button.is-running span { width: 0; animation: stage-progress var(--dur, 6000ms) linear forwards; }
.stage.is-paused .stage__dots button[aria-selected="true"] span { width: 100%; animation: none; }
@keyframes stage-progress { from { width: 0; } to { width: 100%; } }
.stage__pause {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background 0.2s;
}
.stage__pause:hover { background: rgba(255, 255, 255, 0.36); }
.stage__pause svg { width: 18px; height: 18px; fill: #fff; }
.stage__pause .i-play, .stage.is-paused .stage__pause .i-pause { display: none; }
.stage.is-paused .stage__pause .i-play { display: block; }

/* Portrait (About) */
.about__photo { margin: 0; position: relative; border-radius: 28px; overflow: hidden; background: var(--navy); aspect-ratio: 4 / 5; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.about__photo figcaption {
  position: absolute; left: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 980px; font-size: 14px; font-weight: 500; color: #1d1d1f;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 72px 0 0; border-top: 1px solid var(--line); }
.stats:empty { display: none; }
.stat { padding: 28px 0 0; }
.stat dt { font-size: 15px; color: var(--muted); order: 2; }
.stat dd { margin: 0 0 4px; font-size: clamp(32px, 4vw, 44px); font-weight: 600; letter-spacing: -0.03em; }
.stat { display: flex; flex-direction: column; }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { margin-bottom: 56px; max-width: 760px; }
.section__head h2 { font-size: clamp(32px, 4.6vw, 52px); }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 72px; align-items: start; }
.about__photo { position: sticky; top: 96px; }
.about__body p { font-size: 18px; line-height: 1.65; color: var(--muted); max-width: 640px; }
.about__body p:first-child { font-size: clamp(21px, 2vw, 24px); line-height: 1.45; color: var(--text); letter-spacing: -0.015em; }
.about__body p + p { margin-top: 18px; }
.about__body p strong { color: var(--text); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chips li { padding: 8px 14px; border-radius: 980px; font-size: 14px; background: var(--bg-alt); border: 1px solid var(--line); }

/* Experience timeline */
/* Experience — LinkedIn-style list inside one clean panel */
.timeline {
  display: grid; max-width: 880px; padding: 8px 36px;
  background: var(--surface); border-radius: 28px; border: 1px solid var(--line);
}
.job { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 28px 0; }
.job + .job { border-top: 1px solid var(--line); }
.job__logo {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line);
}
.job__logo img { width: 100%; height: 100%; object-fit: contain; }
.job__logo span { font-size: 24px; font-weight: 600; color: #fff; width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #5ab8ff, #0c76fe); }
.job h3 { font-size: 19px; letter-spacing: -0.02em; line-height: 1.3; }
.job__company { font-size: 16px; margin-top: 2px; }
.job__company a { color: var(--text); }
.job__company a:hover { color: var(--link); text-decoration: underline; }
.job__meta { font-size: 15px; color: var(--muted); margin-top: 2px; }
.job--current .job__dates::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #30d158; margin-right: 8px; vertical-align: 1px; }
.job__summary { margin-top: 10px; color: var(--muted); }
.job__skills { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 15px; font-weight: 500; color: var(--text); }
.job__skills svg { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--muted); }
/* Apple-style segmented control for experience categories */
.segmented {
  display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 28px; max-width: 100%;
  border-radius: 980px; background: rgba(118, 118, 128, 0.12); overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--muted);
  padding: 9px 18px; border-radius: 980px; transition: background 0.25s var(--ease), color 0.25s, box-shadow 0.25s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 3px 10px rgba(0, 0, 0, 0.08);
}
#experiencePanels .timeline[hidden] { display: none; }
#experiencePanels .timeline:not([hidden]) { animation: panel-in 0.5s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Grids & cards */
.grid { display: grid; gap: 20px; }
.grid--projects { grid-template-columns: repeat(3, 1fr); }
.grid--certs { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card__media { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--navy), var(--accent)); display: grid; place-items: center; color: rgba(255, 255, 255, 0.9); font-size: 40px; font-weight: 600; letter-spacing: -0.04em; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
.card p { color: var(--muted); font-size: 16px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card__tags span { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 980px; background: var(--bg-alt); color: var(--muted); }
.card__links { display: flex; gap: 18px; margin-top: auto; padding-top: 12px; font-size: 15px; font-weight: 500; }
.card__links a { color: var(--accent); }
.card__links a:hover { text-decoration: underline; }

/* Project filters */
.filters { display: inline-flex; gap: 4px; padding: 4px; border-radius: 980px; background: var(--bg-alt); border: 1px solid var(--line); flex-wrap: wrap; }
.filters:empty { display: none; }
.filters button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 980px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.filters button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.card.is-hidden { display: none; }

/* Certifications — Apple-style product tiles */
.grid--certs { gap: 20px; }
.cert {
  background: var(--tile); box-shadow: none; border-radius: 28px;
  text-align: center; align-items: center;
}
.cert:hover { transform: none; box-shadow: none; }
.cert .card__media {
  width: 100%; aspect-ratio: 4 / 3; background: transparent;
  padding: 40px 36px 8px; cursor: zoom-in; color: var(--muted);
}
.cert .card__media svg { width: 40px; height: 40px; }
.cert .card__media img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.10));
  transition: transform 0.6s var(--ease);
}
.cert:hover .card__media img { transform: scale(1.03); }
.cert .card__body { padding: 20px 28px 36px; gap: 6px; align-items: center; }
.cert h3 { font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
.cert .cert__type { font-size: 12px; font-weight: 600; color: var(--muted); }
.cert .cert__meta { font-size: 15px; color: var(--muted); }
.cert .cert__skills { font-size: 14px; color: var(--muted); max-width: 440px; line-height: 1.6; margin-top: 4px; }
.cert .card__links { justify-content: center; padding-top: 14px; font-size: 15px; font-weight: 400; }
.cert .card__links a { color: var(--link); }

/* Featured (largest) certification: full-width hero tile */
.cert--featured { grid-column: 1 / -1; flex-direction: row; text-align: left; }
.cert--featured .card__media { flex: 0 0 56%; padding: 56px 24px 56px 56px; }
.cert--featured .card__body { padding: 56px 56px 56px 32px; align-items: flex-start; justify-content: center; gap: 10px; }
.cert--featured h3 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; line-height: 1.08; }
.cert--featured .cert__meta { font-size: 17px; }
.cert--featured .card__links { justify-content: flex-start; font-size: 17px; }
@media (max-width: 760px) {
  .cert--featured { flex-direction: column; text-align: center; }
  .cert--featured .card__media { flex: none; padding: 32px 24px 8px; }
  .cert--featured .card__body { padding: 20px 24px 36px; align-items: center; }
  .cert--featured .card__links { justify-content: center; }
}

/* Education */
.list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.edu { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.edu__period { color: var(--muted); font-size: 15px; }
.edu h3 { font-size: 22px; letter-spacing: -0.02em; }
.edu__school { color: var(--muted); font-weight: 500; margin-top: 4px; }
.edu__detail { color: var(--muted); margin-top: 10px; }

/* Draft marker for unfilled content */
.is-draft { outline: 1.5px dashed rgba(255, 159, 10, 0.6); outline-offset: -1.5px; }
.is-draft::after { content: "Draft"; position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 980px; background: rgba(255, 159, 10, 0.15); color: #c77700; }
.job.is-draft, .edu.is-draft { position: relative; }

/* Contact */
.contact { text-align: center; background: var(--btn-bg); color: var(--btn-text); }
.contact .muted { color: inherit; opacity: 0.7; }
.contact .eyebrow { background: var(--btn-text); color: var(--btn-bg); }
.contact .btn { background: var(--btn-text); color: var(--btn-bg); }
.contact .btn:hover { opacity: 0.9; }
.contact .btn--outline { background: transparent; color: var(--btn-text); border-color: currentColor; }
.contact .btn--ghost { background: transparent; color: var(--btn-text); }
.contact__inner { max-width: 720px; }
.contact__title { font-size: clamp(40px, 6vw, 68px); }
.contact__lead { font-size: 21px; margin-top: 16px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 20px; }
.footer__links a:hover { color: var(--text); }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 1000px); max-height: 90vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); }
.lightbox img { max-height: 86vh; border-radius: var(--radius-sm); }
.lightbox__close { position: fixed; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.9); font-size: 24px; cursor: pointer; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .card__media img { transition: none; }
  .stage__slide img, .stage__slide.is-active img { transform: none; transition: none; }
  .stage__overlay > * { animation: none; opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .stage__overlay { width: 58%; padding-left: 40px; }
  .stage::after { background: linear-gradient(to right, rgba(10, 12, 20, 0.82) 0%, rgba(10, 12, 20, 0.6) 40%, rgba(10, 12, 20, 0) 75%), linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 32%); }
  .stage__caption { max-width: 40%; }
  .grid--projects, .grid--certs { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__photo { position: relative; top: auto; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container, .nav__inner { padding: 0 16px; }
  .nav__toggle { display: block; }
  .nav__cta { display: none; }
  .nav__links {
    position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s var(--ease);
  }
  .nav__links a { font-size: 20px; font-weight: 500; color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; transform: none; }

  .hero { padding: 8px 0 24px; }
  .stage { aspect-ratio: auto; height: min(calc(100svh - 80px), 720px); min-height: 560px; max-height: none; border-radius: 24px; }
  .stage::after {
    background: linear-gradient(to top, rgba(10, 12, 20, 0.88) 0%, rgba(10, 12, 20, 0.6) 40%, rgba(10, 12, 20, 0) 68%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 22%);
  }
  .stage__overlay { top: auto; left: 0; right: 0; width: auto; justify-content: flex-end; padding: 24px 22px 28px; }
  .hero__title { font-size: clamp(38px, 11vw, 52px); margin-top: 0; }
  .hero__lead { font-size: 16px; margin-top: 12px; }
  .stage__overlay .hero__actions { margin-top: 20px; }
  .stage__caption { display: none; }
  .stage__controls { top: 16px; right: 16px; bottom: auto; left: auto; }
  .stage__dots { height: 34px; padding: 0 12px; }
  .stage__pause { width: 34px; height: 34px; }
  .about__photo { max-width: 420px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; margin-top: 48px; }
  .stat dt { font-size: 13px; }

  .section { padding: 80px 0; }
  .section__head { margin-bottom: 36px; }
  .grid--projects, .grid--certs { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; gap: 8px; }
  .timeline { padding: 4px 20px; border-radius: 22px; }
  .segmented { display: flex; }
  .segmented button { padding: 8px 14px; font-size: 14px; }
  .job { grid-template-columns: 48px 1fr; gap: 14px; padding: 22px 0; }
  .job__logo { width: 48px; height: 48px; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* =========================================================
   Experience page, award gallery & home preview
   ========================================================= */
.section--tight { padding-top: 24px; }
.section__more { font-size: 17px; color: var(--link); white-space: nowrap; }
.section__more:hover { text-decoration: underline; }

/* Page hero (sub-pages) */
.page-hero { padding: 72px 0 24px; }
.back-link { display: inline-flex; gap: 6px; font-size: 15px; color: var(--link); margin-bottom: 28px; }
.back-link:hover { text-decoration: underline; }
.page-hero__title { font-size: clamp(44px, 7vw, 80px); letter-spacing: -0.045em; line-height: 1.02; }
.page-hero__lead { font-size: clamp(19px, 2.2vw, 24px); color: var(--muted); max-width: 680px; margin-top: 18px; line-height: 1.4; letter-spacing: -0.015em; }
#experience .timeline { max-width: 920px; }

/* Segmented control counts */
.segmented__count { margin-left: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.segmented__count:empty { display: none; }

/* Trophy icon tile */
.job__logo .job__icon { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #ffe58a, #f5b301); color: #5a3d00; }
.job__logo .job__icon svg { width: 28px; height: 28px; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 980px; background: var(--tile); color: var(--muted); }
.badge--gold { background: #fff4cc; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .badge--gold { background: rgba(245, 179, 1, 0.18); color: #ffd25a; } }

/* Bento photo gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; gap: 8px; margin-top: 20px; }
.gallery__item { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--tile); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item:first-child { grid-column: span 2; grid-row: span 2; border-radius: 18px; }
.gallery--1 { grid-template-columns: 1fr; grid-auto-rows: 320px; }
.gallery--1 .gallery__item:first-child { grid-column: auto; grid-row: auto; }
.job__links { margin-top: 14px; }
.link-btn { border: 0; padding: 0; background: none; font: inherit; font-size: 15px; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Home: preview list + featured award card */
.exp-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.exp-preview .timeline { max-width: none; }
.teaser { display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.teaser:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.teaser__media { aspect-ratio: 4 / 3; overflow: hidden; }
.teaser__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.teaser:hover .teaser__media img { transform: scale(1.04); }
.teaser__body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 6px; }
.teaser__kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #8a5a00; }
.teaser__kicker svg { width: 16px; height: 16px; }
.teaser h3 { font-size: 24px; letter-spacing: -0.025em; }
.teaser__cta { margin-top: 8px; color: var(--link); font-size: 16px; }

/* Lightbox caption */
.lightbox { text-align: center; }
.lightbox img { margin: 0 auto; }
.lightbox__caption { margin-top: 12px; color: rgba(255, 255, 255, 0.85); font-size: 15px; }
.lightbox__caption:empty { display: none; }

@media (max-width: 960px) {
  .exp-preview { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page-hero { padding: 40px 0 8px; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; gap: 6px; }
  .gallery__item:nth-child(6) { grid-column: span 2; }
  .section__head--row .section__more { font-size: 16px; }
}

/* =========================================================
   Navigation drawer (Apple-style flyout under "Experience")
   ========================================================= */
.nav__links { align-self: stretch; align-items: center; }
.nav__item { height: 100%; display: flex; align-items: center; }
.nav__trigger { color: var(--muted); transition: color 0.2s; }
.nav__trigger:hover, .nav__trigger.is-active, .has-menu.is-open .nav__trigger { color: var(--text); }
.nav.has-flyout { background: var(--bg); border-bottom-color: transparent; }

.flyout {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line);
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity 0.28s var(--ease), transform 0.36s var(--ease), visibility 0s linear 0.36s;
}
.has-menu.is-open .flyout { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.flyout__inner {
  max-width: var(--max); margin: 0 auto; padding: 36px 24px 52px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 56px;
}
.flyout__label { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.flyout__big { display: grid; gap: 6px; }
.nav__links .flyout__big a { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; color: var(--text); }
.nav__links .flyout__small a { display: block; padding: 5px 0; font-size: 14px; font-weight: 500; color: var(--text); }
.flyout__small a span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.nav__links .flyout a:hover { color: var(--link); }

/* Staggered reveal of drawer items */
.flyout li { opacity: 0; transform: translateY(-4px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.has-menu.is-open .flyout li { opacity: 1; transform: none; }
.has-menu.is-open .flyout li:nth-child(2) { transition-delay: 0.03s; }
.has-menu.is-open .flyout li:nth-child(3) { transition-delay: 0.06s; }
.has-menu.is-open .flyout li:nth-child(4) { transition-delay: 0.09s; }

/* Blurred page behind the open drawer */
.nav__scrim {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0;
  background: rgba(15, 15, 15, 0.12);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: opacity 0.3s var(--ease);
}
.nav__scrim.is-visible { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .flyout, .flyout li { transition: none; transform: none; }
}

/* Mobile: the drawer becomes an indented sub-list inside the menu */
@media (max-width: 760px) {
  .nav__links { align-self: auto; }
  .nav__item { display: block; height: auto; }
  .nav__links .nav__trigger { display: block; font-size: 20px; font-weight: 500; color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--line); }
  .flyout { position: static; visibility: visible; opacity: 1; transform: none; background: transparent; border: 0; transition: none; }
  .flyout li { opacity: 1; transform: none; }
  .flyout__inner { display: block; padding: 4px 0 8px 16px; }
  .flyout__label, .flyout__col:not(.flyout__col--main) { display: none; }
  .flyout__big { gap: 0; }
  .nav__links .flyout__big a { display: block; font-size: 17px; font-weight: 400; color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav__scrim { display: none; }
}

/* Five-photo gallery: last photo fills the final row */
.gallery--5 .gallery__item:nth-child(5) { grid-column: span 2; }
@media (max-width: 760px) {
  .gallery--5 .gallery__item:nth-child(5) { grid-column: auto; }
}

/* Four-photo gallery: large + two stacked, last photo as a wide strip */
.gallery--4 .gallery__item:nth-child(4) { grid-column: 1 / -1; }

/* Second featured certificate: image on the right for an alternating rhythm */
.cert--flip { flex-direction: row-reverse; }
.cert--flip .card__media { padding: 56px 56px 56px 24px; }
.cert--flip .card__body { padding: 56px 32px 56px 56px; }
@media (max-width: 760px) {
  .cert--flip { flex-direction: column; }
  .cert--flip .card__media { padding: 32px 24px 8px; }
  .cert--flip .card__body { padding: 20px 24px 36px; }
}

/* Single image (e.g. a square award graphic): show it whole, not cropped */
.gallery--1 { grid-template-columns: minmax(0, 440px); grid-auto-rows: auto; }
.gallery--1 .gallery__item { aspect-ratio: 1 / 1; }

/* Home: two experience panels (Professional · Workshops & training) */
.exp-col__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 4px 14px; }
.exp-col__head h3 { font-size: 21px; letter-spacing: -0.02em; }
.exp-col__head a { font-size: 15px; color: var(--link); white-space: nowrap; }
.exp-col__head a:hover { text-decoration: underline; }
.exp-preview .timeline { padding: 4px 28px; }
.exp-preview .job { grid-template-columns: 48px 1fr; gap: 16px; padding: 22px 0; }
.exp-preview .job__logo { width: 48px; height: 48px; border-radius: 11px; }
.exp-preview .job h3 { font-size: 17px; }
.exp-preview .job__company, .exp-preview .job__meta, .exp-preview .job__skills { font-size: 14px; }
.exp-preview .badges { margin-bottom: 6px; }
.job--link { cursor: pointer; }
.job--link h3 { transition: color 0.2s; }
.job--link:hover h3 { color: var(--link); }
@media (max-width: 960px) {
  .exp-preview { grid-template-columns: 1fr; gap: 40px; }
}

/* Home preview: clean compact rows, photo thumbnails for workshops */
.exp-preview .job { padding: 20px 0; align-items: center; }
.exp-preview .job h3 { margin-top: 0; }
.exp-preview .job__meta { margin-top: 4px; }
.exp-preview .badges { margin-bottom: 8px; }
.exp-preview .job--thumb { grid-template-columns: 120px 1fr; gap: 18px; }
.job__thumb { width: 120px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--tile); }
.job__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.job--link:hover .job__thumb img { transform: scale(1.05); }
@media (max-width: 760px) {
  .exp-preview .job--thumb { grid-template-columns: 96px 1fr; gap: 14px; }
  .job__thumb { width: 96px; }
}

/* Experience page: no card behind the list — entries sit on the page, separated by hairlines */
#experiencePanels .timeline { background: transparent; border: 0; border-radius: 0; padding: 0; max-width: 960px; }
#experiencePanels .job:first-child { padding-top: 8px; }
@media (max-width: 760px) {
  #experiencePanels .timeline { padding: 0; }
}

/* Home preview: no cards — rows sit on the section background, separated by hairlines */
.exp-preview .timeline { background: transparent; border: 0; border-radius: 0; padding: 0; }
.exp-preview .exp-col__head { margin: 0 0 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.exp-preview .job:first-child { border-top: 0; }

/* Projects — clean product cards (Apple-style tiles) */
.project { box-shadow: none; border: 1px solid var(--line); border-radius: 24px; }
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.project .card__media { background: var(--tile); aspect-ratio: 4 / 3; }
.project__cat { font-size: 12px !important; font-weight: 600; color: var(--muted) !important; letter-spacing: 0.01em; }
.project h3 { font-size: 21px; }
.project--wide { grid-column: span 2; flex-direction: row; }
.project--wide .card__media { flex: 0 0 52%; aspect-ratio: auto; min-height: 340px; }
.project--wide .card__body { padding: 40px; justify-content: center; }
.project--wide h3 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.03em; }
@media (max-width: 960px) {
  .project--wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .project--wide { flex-direction: column; }
  .project--wide .card__media { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
  .project--wide .card__body { padding: 24px; }
}

/* Projects — clean Apple-style tiles (overrides) */
.grid--projects { gap: 20px; }
.project { background: var(--tile); border: 0; border-radius: 28px; box-shadow: none; }
.project:hover { transform: none; box-shadow: none; }
.project .card__media { background: transparent; aspect-ratio: 4 / 3; margin: 12px 12px 0; border-radius: 18px; overflow: hidden; }
.project .card__media img { transition: transform 0.8s var(--ease); }
.project:hover .card__media img { transform: scale(1.03); }
.project .card__body { padding: 22px 28px 30px; gap: 8px; }
.project h3 { font-size: 22px; letter-spacing: -0.025em; }
.project .card__body > p:not(.project__cat):not(.project__stack) { font-size: 16px; line-height: 1.5; color: var(--muted); }
.project__stack { font-size: 13px !important; color: var(--muted) !important; opacity: 0.85; }
.project .card__links { padding-top: 10px; font-size: 15px; font-weight: 400; }
.project .card__links a { color: var(--link); }
.project--wide .card__media { margin: 12px 0 12px 12px; min-height: 360px; }
.project--wide .card__body { padding: 44px 48px; gap: 10px; }
@media (max-width: 760px) {
  .project--wide .card__media { margin: 12px 12px 0; min-height: 0; }
  .project--wide .card__body { padding: 22px 24px 28px; }
}

/* Education inside About — compact rows, no card */
.about__edu { margin-top: 44px; }
.about__edu h3 { font-size: 21px; letter-spacing: -0.02em; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.about__edu .timeline { background: transparent; border: 0; border-radius: 0; padding: 0; max-width: none; }
.about__edu .job { grid-template-columns: 48px 1fr; gap: 16px; padding: 18px 0; align-items: center; }
.about__edu .job__logo { width: 48px; height: 48px; border-radius: 11px; }
.about__edu .job h3 { font-size: 17px; border: 0; padding: 0; }
.about__edu .job__company, .about__edu .job__meta { font-size: 14px; }
.about__edu .job + .job { border-top: 1px solid var(--line); }

/* Certificates: no card background — image and text sit directly on the page */
.cert { background: transparent; border-radius: 0; overflow: visible; }
.cert .card__media { padding: 0 0 4px; aspect-ratio: 4 / 3; overflow: visible; }
.cert .card__media img { border-radius: 8px; }
.cert .card__body { padding: 18px 4px 8px; }
.cert--featured .card__media { padding: 0; aspect-ratio: 4 / 3; }
.cert--featured .card__body { padding: 0 0 0 48px; }
.cert--flip .card__media { padding: 0; }
.cert--flip .card__body { padding: 0 48px 0 0; }
.grid--certs { row-gap: 56px; column-gap: 32px; }
@media (max-width: 760px) {
  .cert--featured .card__body, .cert--flip .card__body { padding: 18px 4px 0; }
}

/* About portrait: background removed — no frame, soft glow behind, gentle fade at the bottom */
.about__photo { background: none; border-radius: 0; overflow: visible; aspect-ratio: auto; isolation: isolate; }
.about__photo::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 52%; width: 92%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 118, 254, 0.16) 0%, rgba(12, 118, 254, 0.06) 45%, transparent 70%);
}
.about__photo img {
  width: 100%; height: auto; object-fit: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
}

/* Certificates grid on 6 columns: wide cards span all, small cards span 2 (3 per row).
   If the last row would hold only 2 small cards, they split it evenly (span 3 each). */
.grid--certs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid--certs > .cert { grid-column: span 2; }
.grid--certs > .cert--featured { grid-column: 1 / -1; }
@media (min-width: 961px) {
  .grid--certs > .cert.cert--pair { grid-column: span 3; }
}
@media (max-width: 960px) {
  .grid--certs > .cert { grid-column: span 3; }
  .grid--certs > .cert--featured { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .grid--certs > .cert { grid-column: 1 / -1; }
}

/* About — profile layout: text left, large portrait right (like an official bio page) */
.about--profile { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 72px; align-items: start; }
.about__head { margin-bottom: 22px; }
.about__name { font-size: clamp(30px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); }
.about__title { margin-top: 6px; font-size: clamp(17px, 1.6vw, 20px); font-weight: 400; color: var(--muted); letter-spacing: -0.005em; }
.about--profile .about__body p,
.about--profile .about__body p:first-child { font-size: 17px; line-height: 1.7; color: var(--text); letter-spacing: 0; max-width: none; }
.about--profile .about__body p + p { margin-top: 16px; }
.about--profile .about__body p strong { font-weight: 600; }
.about--profile .about__photo { position: sticky; top: 96px; }
@media (max-width: 960px) {
  .about--profile { grid-template-columns: 1fr; gap: 32px; }
  .about--profile .about__photo { position: relative; top: auto; order: -1; max-width: 420px; }
}

/* About — fonts matching the reference bio page:
   condensed sans (Exo 2) for the name/title, classic serif for the paragraphs */
.about__name { font-family: "Exo 2", "Inter", sans-serif; font-weight: 700; letter-spacing: -0.01em; }
.about__title { font-family: "Exo 2", "Inter", sans-serif; font-weight: 300; font-size: clamp(18px, 1.7vw, 22px); letter-spacing: 0.01em; color: var(--text); }
.about--profile .about__body p,
.about--profile .about__body p:first-child { font-family: "Times New Roman", Times, Georgia, serif; font-size: 18px; line-height: 1.6; }

/* About — framed portrait on the LEFT, text on the right (reference bio layout) */
.about--profile { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.about__photo--framed { background: none; border-radius: 4px; overflow: hidden; aspect-ratio: 1029 / 1528; isolation: auto; box-shadow: var(--shadow); }
.about__photo--framed::before { content: none; }
.about__photo--framed img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 960px) {
  .about--profile .about__photo--framed { order: 0; max-width: 420px; }
}

/* About paragraphs: straight, even edges like the reference (justified, compact) */
#aboutText p,
#aboutText p:first-child {
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 17px; line-height: 1.5; color: var(--text); letter-spacing: 0;
  text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto;
  max-width: none;
}
#aboutText p + p { margin-top: 14px; }
/* Title stays in the heading font (not the paragraph serif) */
.about--profile .about__body p.about__title {
  font-family: "Exo 2", "Inter", sans-serif; font-weight: 300; font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.3; text-align: left; letter-spacing: 0.01em;
}

/* Project stats — e.g. "1K+ downloads · 5.0★ rating" */
.project__stats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.project__stats strong { color: var(--text, inherit); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; margin-right: 2px; }

/* Projects — no card background: image + text sit directly on the page */
.grid--projects { gap: 48px 28px; }
.project, .project:hover { background: transparent; border-radius: 0; }
.project .card__media { margin: 0; border-radius: 20px; }
.project .card__body { padding: 18px 2px 0; }
