/* ============================================================
   Navneet Raj — Portfolio
   Editorial · warm-neutral · single accent · dual facet
   ============================================================ */

:root {
  --paper: #f4f2ec;
  --paper-rgb: 244, 242, 236;
  --paper-2: #eceae1;
  --card: #fffefb;
  --ink: #1b1a16;
  --ink-2: #3d3b34;
  --muted: #77746a;
  --faint: #a8a498;
  --line: #ddd9cd;
  --line-2: #cfcabb;

  --accent: #bb4b2b;      /* burnt sienna / terracotta */
  --accent-2: #8f3a20;
  --accent-soft: #f0e4dc;
  --shadow-rgb: 20, 18, 14;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --maxw: 1140px;
  --gutter: 40px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Dark / night mode ---------- */
html[data-theme="dark"] {
  --paper: #14130f;
  --paper-rgb: 20, 19, 15;
  --paper-2: #1c1a15;
  --card: #211f19;
  --ink: #f1eee6;
  --ink-2: #cbc7bc;
  --muted: #9a968a;
  --faint: #6f6c62;
  --line: #322f28;
  --line-2: #423e35;

  --accent: #e06a43;
  --accent-2: #c9552e;
  --accent-soft: #3a281f;
  --shadow-rgb: 0, 0, 0;
}
html { transition: background-color 0.4s var(--ease); }
body, .nav, .card, .instructor, .work-item, .cert-card, .contact-method,
.xp-card, .stack-item i, .nav-panel, .footer, .tabbar {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}

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

html {
  scroll-behavior: smooth; scroll-padding-top: 88px; overflow-x: clip;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
/* subtle, theme-matched scrollbar (no dark bar) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; letter-spacing: -0.01em; }

.display {
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.accent { color: var(--accent); }
.serif-italic { font-style: italic; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 44px;
}
.section-index {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.section-title { font-size: clamp(26px, 3.4vw, 42px); }
.section-note { margin-left: auto; max-width: 340px; color: var(--muted); font-size: 15px; text-align: right; }

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  padding: 14px 26px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.link-underline {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--line-2); padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s, gap 0.25s var(--ease);
}
.link-underline:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }

/* ============================================================
   Navigation — minimal top bar + fullscreen menu
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 600;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.nav.scrolled {
  background: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 15px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--sans); font-size: 15px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 10px;
  transition: color 0.25s;
}
.brand:hover { color: var(--ink); }
.brand .ast { color: var(--accent); font-size: 17px; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  cursor: pointer; display: grid; place-items: center; font-size: 15px;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.3s var(--ease);
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: rotate(-18deg); }

/* animated hamburger */
.nav-burger {
  width: 40px; height: 30px; position: relative;
  background: none; border: none; cursor: pointer; padding: 0;
}
.nav-burger span {
  position: absolute; left: 8px; right: 8px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.nav-burger span:nth-child(1) { top: 11px; }
.nav-burger span:nth-child(2) { top: 18px; }
.nav-burger.open span:nth-child(1) { top: 14px; transform: rotate(45deg); }
.nav-burger.open span:nth-child(2) { top: 14px; transform: rotate(-45deg); }

/* Right-side drawer menu */
.nav-overlay {
  position: fixed; inset: 0; z-index: 550;
  background: transparent;
  display: flex; justify-content: flex-end;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-panel {
  width: min(400px, 84vw); height: 100%;
  background: color-mix(in srgb, var(--paper) 52%, transparent);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  display: flex; flex-direction: column; justify-content: center;
  gap: 30px; padding: 0 clamp(34px, 5vw, 56px);
  box-shadow: -18px 0 50px rgba(20, 18, 14, 0.08);
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}
.nav-overlay.open .nav-panel { transform: translateX(0); }
.nav-overlay-inner { display: flex; flex-direction: column; gap: 4px; }
.nav-overlay-inner a {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; color: var(--ink);
  display: flex; align-items: baseline; gap: 14px;
  transition: color 0.25s, transform 0.3s var(--ease);
}
.nav-overlay-inner a .i {
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--faint);
  letter-spacing: 0.05em; min-width: 24px;
}
.nav-overlay-inner a:hover, .nav-overlay-inner a.active { color: var(--accent); transform: translateX(8px); }
.nav-overlay-resume {
  align-self: flex-start;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--line-2); padding: 11px 24px; border-radius: 999px;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.nav-overlay-resume:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Rotated side email (bottom-left) */
.side-email {
  position: fixed; left: 22px; bottom: 32px; z-index: 90;
  writing-mode: vertical-rl; transform: rotate(180deg);
}
.side-email a {
  font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.14em; color: var(--muted);
  transition: color 0.25s;
}
.side-email a:hover { color: var(--accent); }

/* Scroll rail (right) */
.scroll-rail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 180px; border-radius: 3px; background: var(--line-2); z-index: 90;
}
.scroll-thumb {
  position: absolute; left: 0; top: 0; width: 100%; height: 34%;
  background: var(--accent); border-radius: 3px; will-change: transform;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 72% center;
  filter: grayscale(0.08) contrast(1.02);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--paper) 4%, rgba(var(--paper-rgb),0.94) 30%, rgba(var(--paper-rgb),0.45) 56%, rgba(var(--paper-rgb),0) 80%),
    linear-gradient(0deg, rgba(var(--paper-rgb),0.35), transparent 30%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding-top: 96px; padding-bottom: 40px; }
.hero-text { max-width: 600px; }

.hero-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.hero-eyebrow .rule { width: 46px; height: 1px; background: var(--line-2); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #3aa76d;
  box-shadow: 0 0 0 3px color-mix(in srgb, #3aa76d 22%, transparent);
}

.hero h1 { margin-bottom: 26px; }
.hero h1 .role-word { color: var(--accent); font-style: italic; }

.hero-intro { font-size: 16px; color: var(--ink-2); max-width: 420px; margin-bottom: 30px; }

/* facet toggle */
.facet {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 2px;
  padding: 4px; margin-bottom: 34px; background: var(--card);
}
.facet button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  padding: 9px 20px; border-radius: 2px; transition: color 0.25s, background 0.25s;
}
.facet button.active { background: var(--ink); color: var(--paper); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.hero-portrait { position: relative; }
.hero-portrait .frame {
  position: relative; border: 1px solid var(--line-2); padding: 10px; background: var(--card);
}
.hero-portrait .frame::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--line);
  transform: translate(14px, 14px); z-index: -1;
}
.hero-portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(0.12) contrast(1.02); }
.hero-portrait .cap {
  position: absolute; bottom: 22px; left: -1px;
  background: var(--ink); color: var(--paper);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 14px;
}

/* ============================================================
   Work (projects / videos)
   ============================================================ */
.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
}
.work-item {
  cursor: default;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 18px;
  box-shadow: 0 6px 22px rgba(20, 18, 14, 0.05);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
}
.work-item:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(20, 18, 14, 0.12); border-color: var(--line-2); }
.work-item.is-clickable { cursor: pointer; }
.work-media {
  position: relative; overflow: hidden; background: var(--paper-2);
  border-radius: 12px; aspect-ratio: 16/11; margin-bottom: 18px;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); filter: grayscale(0.08); }
.work-item:hover .work-media img { transform: scale(1.05); filter: grayscale(0); }
.work-top, .work-desc, .work-tags { padding-inline: 6px; }
.work-media .num {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-family: var(--serif); font-size: 15px; color: var(--paper); mix-blend-mode: difference;
}
.work-media .play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  background: rgba(20, 18, 14, 0.14); transition: background 0.3s;
}
.work-item:hover .work-media .play { background: rgba(20, 18, 14, 0.28); }
.work-media .play span {
  width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); color: var(--ink); font-size: 18px; padding-left: 3px;
  transition: transform 0.3s var(--ease);
}
.work-item:hover .work-media .play span { transform: scale(1.1); }

.work-top { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.work-title { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.work-cat { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.work-desc { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.work-tags span {
  font-size: 12px; color: var(--ink-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 999px;
}

/* ============================================================
   About — "Meet Your Instructor" gradient panel
   ============================================================ */
.instructor {
  position: relative; overflow: hidden;
  border-radius: 20px;
  padding: clamp(24px, 3vw, 38px);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(var(--shadow-rgb), 0.05);
}
.instructor::before {
  content: ""; position: absolute; top: -140px; right: -140px;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}
.instructor-heading {
  text-align: left; font-size: clamp(22px, 2.8vw, 32px);
  margin-bottom: 30px; color: var(--ink);
  display: flex; align-items: center; gap: 18px;
}
.instructor-heading::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.5;
}
.instructor-row {
  display: grid; grid-template-columns: 0.82fr 1.18fr; gap: clamp(26px, 3.4vw, 48px);
  align-items: center; margin-bottom: 0;
}
.instructor-row:last-child { margin-bottom: 0; }
.instructor-row.reverse { grid-template-columns: 1fr 1.05fr; }
.instructor-row.reverse .instructor-media { order: 2; }
.instructor-row.reverse .instructor-text { order: 1; }
.instructor-media { position: relative; }
.instructor-media::after {
  content: ""; position: absolute; inset: 0;
  border: 1px solid var(--line-2); border-radius: 18px;
  transform: translate(14px, 14px); z-index: -1;
}
.instructor-media img {
  width: 100%; aspect-ratio: 4/4.6; object-fit: cover;
  border-radius: 16px; box-shadow: 0 16px 38px rgba(20, 18, 14, 0.14);
}
.instructor-text .about-lead {
  font-family: var(--serif); font-size: clamp(18px, 1.9vw, 23px); line-height: 1.36;
  margin-bottom: 14px; color: var(--ink);
}
.instructor-body { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; margin-bottom: 12px; }
.instructor-body:last-child { margin-bottom: 0; }
.instructor-meta {
  display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.instructor-meta span {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.instructor-meta i { color: var(--accent); font-size: 13px; }
.instructor-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.instructor-meta span {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: color-mix(in srgb, #fff 55%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px;
}
.instructor-meta i { color: var(--accent); font-size: 13px; }

/* ============================================================
   My Stack (category + icon items)
   ============================================================ */
.stack { margin-top: 84px; }
.stack-label {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 30px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2);
}
.stack-label::before { content: "✳"; color: var(--accent); font-size: 15px; }
.stack-group {
  display: grid; grid-template-columns: minmax(150px, 0.7fr) 2.3fr; gap: 30px; align-items: center;
  padding: 30px 0; border-top: 1px solid var(--line);
}
.stack-group:last-child { border-bottom: 1px solid var(--line); }
.stack-cat {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 2.8vw, 36px); letter-spacing: -0.01em; line-height: 1.05;
  color: var(--ink);
}
.stack-items { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; }
.stack-item {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 600; color: var(--ink);
  transition: transform 0.25s var(--ease);
}
.stack-item:hover { transform: translateY(-3px); }
.stack-item i {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center; border-radius: 13px;
  background: var(--bg, var(--accent)); color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(20, 18, 14, 0.14);
}

/* Work project link */
.work-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding-inline: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent);
  transition: gap 0.25s var(--ease);
}
.work-link:hover { gap: 12px; }

/* ============================================================
   Collapse (See More / Show Less) — shared
   ============================================================ */
.collapse-wrap { position: relative; }
.collapse-wrap.collapsed { overflow: hidden; }
.collapse-fade {
  position: absolute; inset: auto 0 0 0; height: 170px; pointer-events: none;
  background: linear-gradient(transparent, var(--paper) 92%);
  opacity: 0; transition: opacity 0.35s;
}
.collapse-wrap.collapsed .collapse-fade { opacity: 1; }
.collapse-more { text-align: center; margin-top: 26px; }
.collapse-more.is-hidden { display: none; }
.see-more-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 8px 20px;
  font-family: var(--sans); font-weight: 600; font-size: 17px; color: var(--ink);
  transition: color 0.25s;
}
.see-more-btn:hover { color: var(--accent); }
.see-more-btn i { font-size: 14px; transition: transform 0.35s var(--ease); }
.see-more-btn.open i { transform: rotate(180deg); }

/* ============================================================
   Experience & Education
   ============================================================ */
/* Tabbed slider: Experience ⇄ Education */
.xp-tabs {
  display: inline-flex; gap: 4px; padding: 5px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card);
  margin-bottom: 40px;
}
.xp-tab {
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  padding: 10px 26px; border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}
.xp-tab.active { background: var(--ink); color: var(--paper); }
.xp-slider { overflow: hidden; transition: height 0.5s var(--ease); }
.xp-track {
  display: flex; width: 200%; align-items: flex-start;
  transition: transform 0.55s var(--ease);
}
.xp-panel { width: 50%; padding-right: 4px; }
.xp-panel .roadmap { max-width: 860px; }

/* staggered slide-in for roadmap entries */
.xp-item { opacity: 0; transform: translateX(34px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.xp-slider.visible .xp-item { opacity: 1; transform: none; }
.xp-slider.visible .xp-item:nth-child(1) { transition-delay: 0.05s; }
.xp-slider.visible .xp-item:nth-child(2) { transition-delay: 0.15s; }
.xp-slider.visible .xp-item:nth-child(3) { transition-delay: 0.25s; }
.xp-slider.visible .xp-item:nth-child(4) { transition-delay: 0.35s; }
.xp-slider.visible .xp-item:nth-child(5) { transition-delay: 0.45s; }

/* Professional dated list (Experience / Education) */
.roadmap { position: relative; max-width: 920px; }
.xp-item {
  display: grid; grid-template-columns: 165px 1fr; gap: 30px;
  padding: 26px 0 26px 20px; position: relative;
  border-top: 1px solid var(--line);
  align-items: start;
}
.xp-item:last-child { border-bottom: 1px solid var(--line); }
.xp-item::before {
  content: ""; position: absolute; left: 0; top: 26px; bottom: 26px; width: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleY(0); transform-origin: top; opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.xp-item:hover::before { transform: scaleY(1); opacity: 1; }
.xp-item .when {
  font-family: var(--serif); font-size: 15.5px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums; padding-top: 4px; white-space: nowrap;
}
.xp-card { background: none; border: none; padding: 0; box-shadow: none; }
.xp-card .role { font-family: var(--serif); font-size: clamp(19px, 2vw, 23px); font-weight: 500; line-height: 1.22; color: var(--ink); }
.xp-card .org {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 7px 0 9px;
}
.xp-card p { font-size: 14.5px; color: var(--muted); line-height: 1.62; max-width: 58ch; }

/* ============================================================
   Certifications
   ============================================================ */
.cert-list { border-top: 1px solid var(--line); }
.cert-line {
  display: flex; align-items: center; gap: 24px; padding: 22px 4px;
  border-bottom: 1px solid var(--line); transition: padding 0.3s var(--ease), background 0.3s;
}
.cert-line:hover { padding-left: 14px; background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.cert-line .cn { font-family: var(--serif); font-size: 15px; color: var(--accent); width: 34px; }
.cert-line .ct { font-family: var(--serif); font-size: 22px; font-weight: 500; flex: 1; }
.cert-line .ci { font-size: 14px; color: var(--muted); text-align: right; }

.cert-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cert-card { cursor: pointer; }
.cert-card .frame {
  position: relative; overflow: hidden; border: 1px solid var(--line-2);
  background: var(--card); aspect-ratio: 4/3; margin-bottom: 16px;
}
.cert-card .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.cert-card:hover .frame img { transform: scale(1.04); }
.cert-card .frame .view {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(20, 18, 14, 0.3); color: var(--paper);
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.3s;
}
.cert-card:hover .frame .view { opacity: 1; }
.cert-card h4 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin-bottom: 3px; }
.cert-card p { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   Gallery (masonry)
   ============================================================ */
/* Auto-scrolling marquee: alternating up/down columns */
.gallery-marquee {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  height: min(60vh, 580px); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
}
.gal-col { overflow: hidden; }
.gal-track {
  display: flex; flex-direction: column; gap: 20px;
  animation: gal-up var(--dur, 40s) linear infinite;
  will-change: transform;
}
.gal-track.down { animation-name: gal-down; }
@keyframes gal-up   { from { transform: translateY(0); }    to { transform: translateY(-50%); } }
@keyframes gal-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.gallery-marquee:hover .gal-track,
.gallery-marquee.paused .gal-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .gal-track { animation: none; } }

.gal-item {
  position: relative; flex: none;
  overflow: hidden; cursor: pointer;
  border-radius: 18px; border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: 0 8px 22px rgba(20, 18, 14, 0.07);
}
.gal-item img {
  width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; display: block;
  transition: transform 0.6s var(--ease);
}
.gal-item:hover img { transform: scale(1.06); }
.gal-item .ov {
  position: absolute; right: 14px; bottom: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(250, 249, 245, 0.88); color: var(--ink); font-size: 14px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(20, 18, 14, 0.18);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.gal-item:hover .ov { background: var(--accent); color: #fff; transform: scale(1.08); }

@media (max-width: 700px) {
  .gallery-marquee { grid-template-columns: repeat(2, 1fr); gap: 12px; height: 66vh; }
  .gal-track { gap: 12px; }
  .gal-col:nth-child(3) { display: none; }
}

/* Collapse heights per section (collapsed shows ~2 rows) */
#xpCollapse.collapsed { max-height: 560px; }
@media (max-width: 640px) {
  #xpCollapse.collapsed { max-height: 640px; }
}

/* ============================================================
   Carousels (Work / Certifications)
   ============================================================ */
.carousel-shell { position: relative; }
.work-grid.carousel, .cert-cards.carousel {
  display: flex; gap: 26px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.work-grid.carousel .work-item { flex: 0 0 min(350px, 82vw); scroll-snap-align: start; }
.cert-cards.carousel .cert-card { flex: 0 0 min(350px, 82vw); scroll-snap-align: start; }

/* Arrows overlay the sides (not at the bottom) */
.car-btn {
  position: absolute; top: 40%; z-index: 6;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font-size: 16px; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(20, 18, 14, 0.14);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.car-prev { left: -16px; }
.car-next { right: -16px; }
.car-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: scale(1.07); }
@media (max-width: 700px) {
  .car-btn { width: 44px; height: 44px; }
  .car-prev { left: -6px; }
  .car-next { right: -6px; }
}

/* ============================================================
   Contact — split layout
   ============================================================ */
.contact2 {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.contact2-left .label { display: block; margin-bottom: 18px; }
.contact2-title {
  font-family: var(--serif); font-weight: 500; color: var(--ink);
  font-size: clamp(32px, 4.2vw, 54px); line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.contact2-sub { color: var(--ink-2); font-size: 15px; line-height: 1.6; max-width: 42ch; margin-bottom: 24px; }
.contact2-avail {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.contact2-avail .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #3aa76d;
  box-shadow: 0 0 0 4px color-mix(in srgb, #3aa76d 20%, transparent);
}

.contact2-right { display: flex; flex-direction: column; gap: 16px; }
.contact-method {
  display: flex; align-items: center; gap: 15px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; box-shadow: 0 5px 16px rgba(var(--shadow-rgb), 0.04);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.contact-method:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(var(--shadow-rgb), 0.1); border-color: var(--line-2); }
.cm-ic {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px;
}
.cm-ic.wa { background: #25d366; }
.cm-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cm-value { font-family: var(--serif); font-size: 16.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.cm-arrow { margin-left: auto; color: var(--faint); transition: transform 0.3s var(--ease), color 0.3s; }
.contact-method:hover .cm-arrow { color: var(--accent); transform: translateX(4px); }

.contact2-socials { display: flex; gap: 10px; margin-top: 8px; }
.contact2-socials a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%; color: var(--ink); font-size: 17px;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.contact2-socials a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-3px); }

/* ============================================================
   Mobile bottom tab bar (iOS style)
   ============================================================ */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line); border-radius: 24px;
    box-shadow: 0 12px 34px rgba(20, 18, 14, 0.16);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 500; color: var(--muted);
    padding: 5px 10px; border-radius: 14px; transition: color 0.2s, background 0.2s;
  }
  .tabbar a i { font-size: 18px; }
  .tabbar a.active { color: var(--accent); background: var(--accent-soft); }
}

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: 34px 0; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-inner p { font-size: 13px; color: var(--muted); }
.footer-inner .top { font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.footer-inner .top:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   Modal
   ============================================================ */
.modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  align-items: center; justify-content: center; padding: 30px;
  background: rgba(20, 18, 14, 0.82); backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: min(94vw, 1040px); }
.modal-stage img, .modal-stage video { max-width: 100%; max-height: 82vh; background: #000; }
.modal-cap { color: var(--paper); font-size: 14px; letter-spacing: 0.04em; }
.modal-close {
  position: absolute; top: 24px; right: 28px; width: 48px; height: 48px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,0.4); color: var(--paper); font-size: 22px;
  transition: background 0.25s, transform 0.25s;
}
.modal-close:hover { background: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

/* ============================================================
   Reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--rd, 0s); }
/* directional slide-ins ("slider" reveal) */
.reveal-l { opacity: 0; transform: translateX(-56px); transition: opacity 0.85s var(--ease), transform 0.85s var(--ease); transition-delay: var(--rd, 0s); }
.reveal-r { opacity: 0; transform: translateX(56px); transition: opacity 0.85s var(--ease), transform 0.85s var(--ease); transition-delay: var(--rd, 0s); }
.reveal.visible, .reveal-l.visible, .reveal-r.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-l, .reveal-r { opacity: 1; transform: none; transition: none; }
}

/* Staggered cascade inside grids */
.work-grid .work-item.reveal:nth-child(2) { --rd: 0.09s; }
.work-grid .work-item.reveal:nth-child(3) { --rd: 0.18s; }
.work-grid .work-item.reveal:nth-child(4) { --rd: 0.27s; }
.cert-cards .cert-card.reveal:nth-child(2) { --rd: 0.1s; }
.cert-cards .cert-card.reveal:nth-child(3) { --rd: 0.2s; }
.cert-list .cert-line.reveal:nth-child(2) { --rd: 0.07s; }
.cert-list .cert-line.reveal:nth-child(3) { --rd: 0.14s; }
.cert-list .cert-line.reveal:nth-child(4) { --rd: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .xp-item { opacity: 1; transform: none; transition: none; }
  .xp-track { transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
/* Side email + scroll rail only where there's margin room */
@media (max-width: 1180px) { .side-email, .scroll-rail { display: none; } }

@media (max-width: 1040px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .stack-group { grid-template-columns: minmax(130px, 0.6fr) 2.4fr; gap: 24px; }
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .instructor { padding: 44px clamp(20px, 4vw, 40px); }
  .instructor-row, .instructor-row.reverse { grid-template-columns: 1fr; gap: 26px; }
  .instructor-row.reverse .instructor-media { order: 1; }
  .instructor-row.reverse .instructor-text { order: 2; }
  .instructor-media { max-width: 440px; margin: 0 auto; }
  .instructor-media img { aspect-ratio: 5/4; }
  .stack-group { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; align-items: start; }
  .xp-tab { padding: 9px 20px; }
  .xp-item { grid-template-columns: 1fr; gap: 6px; padding: 22px 0 22px 18px; }
  .xp-item .when { padding-top: 0; }
  .cert-cards { grid-template-columns: 1fr 1fr; }
  .contact2 { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 88px 0; }
  .section-note { display: none; }
}

@media (max-width: 760px) {
  /* desktop hamburger → mobile bottom tab bar */
  .nav-burger { display: none; }
  .nav-inner { padding: 16px var(--gutter); }
  .footer { padding-bottom: 110px; }
  .hero-bg::after {
    background:
      linear-gradient(0deg, var(--paper) 12%, rgba(var(--paper-rgb),0.86) 46%, rgba(var(--paper-rgb),0.35) 74%, transparent 100%);
  }
  .hero-bg img { object-position: 66% 22%; }
  .hero { align-items: flex-end; min-height: 96vh; }
  .hero-inner { padding-bottom: 8vh; }
  .work-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 620px) {
  .cert-cards { grid-template-columns: 1fr; }
  .stack-item i { width: 42px; height: 42px; font-size: 19px; }
}

@media (max-width: 400px) {
  .tabbar { left: 8px; right: 8px; padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a { padding: 6px 7px; gap: 2px; }
  .tabbar a span { font-size: 9px; }
  .tabbar a i { font-size: 16px; }
  .brand { font-size: 13px; letter-spacing: 0.12em; }
}
