/* ═══════════════════════════════════════════════════════════════════
   styles.css — Mohan Saini Portfolio · Architectural Monograph Theme
   ───────────────────────────────────────────────────────────────────
   60-30-10 Color System:
   • 60% Neutral Canvas: Carbon Obsidian (#08090D / #0C0E14)
   • 30% Structural Framing: Elevated Slate (#12151E) + Crisp Hairlines
   • 10% Focal Accent: International Engineering Vermilion (#FF5500)
     & Precision Cobalt (#38BDF8)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* 60% Neutral Canvas */
  --bg0:        #07080C;
  --bg1:        #0B0D13;
  --bg2:        #10131C;

  /* 30% Structural Surfaces & Hairlines */
  --surface:    rgba(18, 21, 30, 0.86);
  --surface-2:  rgba(255, 255, 255, 0.035);
  --surface-3:  rgba(255, 255, 255, 0.06);
  --line:       rgba(226, 232, 240, 0.10);
  --line-soft:  rgba(226, 232, 240, 0.06);
  --line-strong:rgba(255, 85, 0, 0.45);

  /* Typography Hierarchy */
  --t1:         #F4F4F6;
  --t2:         #C8CDD9;
  --t3:         #8E96AA;
  --t4:         #5E667A;

  /* 10% High-Contrast Focal Accents */
  --brand:      #FF5500;
  --brand-deep: #EA4C00;
  --brand-soft: #FF7833;
  --cobalt:     #38BDF8;
  --emerald:    #10B981;
  --red:        #F87171;

  /* Shadows */
  --sh-sm:      0 2px 12px rgba(0, 0, 0, 0.35);
  --sh-md:      0 18px 48px rgba(0, 0, 0, 0.50);
  --sh-lg:      0 32px 84px rgba(0, 0, 0, 0.65);
  --sh-brand:   0 12px 32px rgba(255, 85, 0, 0.25);

  /* 2+1 Font Family System */
  --ff-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --ff-serif:   'Fraunces', Georgia, serif;
  --ff-sans:    'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Spatial & Radius Tokens */
  --r-xs:       8px;
  --r-sm:       12px;
  --r-md:       16px;
  --r-lg:       20px;
  --content:    1220px;
  --nav-h:      64px;

  --blur:       blur(16px) saturate(1.3);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

/* ────────────────────────────────
   BASE & RESET
   ──────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: var(--bg0);
  background-image:
    radial-gradient(1100px 600px at 85% -5%, rgba(255, 85, 0, 0.07), transparent 60%),
    radial-gradient(900px 520px at 10% 25%, rgba(56, 189, 248, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 100%);
  color: var(--t1);
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--ff-display);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; }
figure, figcaption { margin: 0; }

::selection {
  background: rgba(255, 85, 0, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb {
  background: rgba(142, 150, 170, 0.28);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ────────────────────────────────
   UTILITIES & TYPOGRAPHIC HELPERS
   ──────────────────────────────── */
.hidden { display: none !important; }

.container {
  width: min(var(--content), calc(100% - 48px));
  margin-inline: auto;
}

.serif-italic {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--brand-soft);
}

.c-comment { color: var(--t4); }

/* ────────────────────────────────
   AMBIENT ARCHITECTURAL BACKDROP
   ──────────────────────────────── */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.three-ambient-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.45s ease;
}

body.light-mode .three-ambient-mount {
  opacity: 0.45;
}

.three-ambient-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.three-canvas-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.96;
  transition: opacity 0.45s ease;
}

body.light-mode .three-canvas-mount {
  opacity: 0.85;
}

.three-webgl-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}

.ambient-glow-1 {
  width: 560px;
  height: 560px;
  top: -220px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 85, 0, 0.10) 0%, transparent 65%);
}

.ambient-glow-2 {
  width: 520px;
  height: 520px;
  bottom: -240px;
  left: -140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07) 0%, transparent 65%);
}

.architectural-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 80%);
}

/* ────────────────────────────────
   SCROLL PROGRESS BAR
   ──────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 1300;
  background: var(--brand);
  transition: width 0.1s linear;
}

/* ────────────────────────────────
   CUSTOM CURSOR (Desktop Fine Pointer)
   ──────────────────────────────── */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  #cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    pointer-events: none;
    transition: width 0.15s var(--ease-out), height 0.15s var(--ease-out), opacity 0.15s ease;
  }
  #cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1999;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 85, 0, 0.45);
    pointer-events: none;
    transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out), border-color 0.2s ease, opacity 0.2s ease;
  }
  #cursor-glow {
    display: none;
  }
  .cursor-trail, .cursor-burst {
    display: none;
  }
  body.cursor-hover #cursor-dot {
    width: 10px;
    height: 10px;
  }
  body.cursor-hover #cursor-ring {
    width: 48px;
    height: 48px;
    border-color: var(--brand-soft);
  }
}

@media (max-width: 1023px) {
  #cursor-dot, #cursor-ring, #cursor-glow {
    display: none !important;
  }
}

/* ────────────────────────────────
   TOP BAR — 3-Zone Contract
   ──────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: rgba(7, 8, 12, 0.92);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

#navbar.navbar-scrolled {
  background: rgba(7, 8, 12, 0.97);
  border-bottom-color: rgba(226, 232, 240, 0.16);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--nav-h);
  width: min(var(--content), calc(100% - 48px));
  margin-inline: auto;
}

/* Zone 1: Brand Wordmark */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Zone 2: Clean Single-Line Typography Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--t2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: var(--t1);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* Zone 3: Theme Switch & Primary Action */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--t2);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--t1);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.theme-toggle svg {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}

.theme-toggle .ic-sun { opacity: 0; transform: rotate(45deg) scale(0.6); }
.theme-toggle .ic-moon { opacity: 1; transform: rotate(0) scale(1); }
body.light-mode .theme-toggle .ic-sun { opacity: 1; transform: rotate(0) scale(1); }
body.light-mode .theme-toggle .ic-moon { opacity: 0; transform: rotate(-45deg) scale(0.6); }

.theme-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--t2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.theme-toggle:hover .theme-tooltip {
  opacity: 1;
}

/* Resume Split Button */
.resume-split,
.hero-resume-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.btn-resume {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--r-xs) 0 0 var(--r-xs);
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.15s ease;
}

.btn-resume:hover {
  background: var(--brand-deep);
}

.resume-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  min-width: 34px;
  transition: background 0.15s ease;
}

.resume-caret:hover {
  background: var(--brand-deep);
}

.resume-caret svg,
.hero-resume-caret svg {
  transition: transform 0.2s var(--ease-out);
  pointer-events: none;
}

.resume-caret[aria-expanded="true"] svg,
.hero-resume-caret[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.resume-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 215px;
  border-radius: var(--r-sm);
  background: var(--bg2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  padding: 6px;
  z-index: 1500;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

.resume-dropdown[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.rd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  color: var(--t2);
  transition: background 0.15s ease, color 0.15s ease;
}

.rd-item:hover {
  background: var(--surface-3);
  color: var(--t1);
}

.rd-ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--brand-soft);
  flex-shrink: 0;
}

.rd-text { display: flex; flex-direction: column; }
.rd-label { font-size: 13px; font-weight: 600; color: var(--t1); }
.rd-sub { font-size: 11px; color: var(--t3); }

/* Burger Button (Tablet & Mobile) */
#burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

#burger-btn > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 13px;
}

.burger-line {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 99px;
  background: var(--t1);
  transition: transform 0.2s var(--ease-out), opacity 0.15s ease;
}

.burger-open .burger-line:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger-open .burger-line:nth-child(2) { opacity: 0; }
.burger-open .burger-line:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ────────────────────────────────
   MOBILE / TABLET NAVIGATION DRAWER
   ──────────────────────────────── */
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
}

#mobile-menu.open {
  pointer-events: auto;
}

.mm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#mobile-menu.open .mm-overlay {
  opacity: 1;
}

.mm-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  transform: translateX(100%);
  transition: transform 0.25s var(--ease-out);
}

#mobile-menu.open .mm-panel {
  transform: translateX(0);
}

.mm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.mm-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mm-brand-text { display: flex; flex-direction: column; }
.mm-name { font-family: var(--ff-display); font-size: 15px; font-weight: 700; color: var(--t1); }
.mm-title { font-size: 12px; color: var(--t3); }

.mm-close-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--t2);
}

.mm-links {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-xs);
  color: var(--t2);
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover {
  background: var(--surface-3);
  color: var(--t1);
}

.mn-idx {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--brand-soft);
}

.mm-foot {
  padding: 16px 20px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-cta {
  width: 100%;
  justify-content: center;
}

.mm-foot-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mm-foot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--t2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.mm-foot-link:hover {
  color: var(--t1);
  border-color: var(--line-strong);
}

/* ────────────────────────────────
   BUTTON SYSTEM
   ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: var(--r-xs);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s var(--ease-out), background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}

.btn-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--t1);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  transform: translateY(-2px);
}

.btn-line {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--line);
}

.btn-line:hover {
  color: var(--t1);
  border-color: var(--t3);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 14.5px;
  border-radius: var(--r-sm);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.hero-resume-view {
  border-radius: var(--r-sm) 0 0 var(--r-sm) !important;
  border-right: 0 !important;
}

.hero-resume-caret {
  border-radius: 0 var(--r-sm) var(--r-sm) 0 !important;
  padding: 0 13px !important;
  min-width: 42px;
}

.hero-resume-dropdown {
  top: calc(100% + 8px);
  right: 0;
}

/* ────────────────────────────────
   HERO — Split-Screen + Full-Width KPI Row
   ──────────────────────────────── */
.hero-section {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-h) + clamp(32px, 5vw, 64px));
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  gap: clamp(32px, 4.5vw, 64px);
  margin-bottom: clamp(36px, 5vw, 56px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-kicker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--t3);
}

.kicker-mono {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-soft);
  letter-spacing: 0.08em;
}

.hero-company-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--t2);
  transition: color 0.15s ease;
}

.hero-company-link strong {
  color: var(--t1);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 85, 0, 0.5);
}

.hero-company-link:hover {
  color: var(--brand-soft);
}

.hero-title {
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.07;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 20px;
}

.hero-lead {
  max-width: 62ch;
  color: var(--t2);
  font-size: clamp(15.5px, 1.3vw, 17.5px);
  line-height: 1.7;
  margin-bottom: 26px;
}

.hero-lead strong {
  color: var(--t1);
  font-weight: 600;
}

/* Interactive Terminal Card */
.term {
  width: 100%;
  max-width: 560px;
  margin-bottom: 28px;
  border-radius: var(--r-sm);
  background: var(--bg1);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.term-dots {
  display: flex;
  gap: 6px;
}

.term-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(142, 150, 170, 0.35);
}

.term-file {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  color: var(--t2);
}

.term-spec {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t3);
}

.term-body {
  padding: 16px 18px;
}

.term-body pre {
  margin: 0;
  font-family: var(--ff-mono);
  font-size: clamp(11.5px, 1.2vw, 13px);
  line-height: 1.8;
  color: var(--t2);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 82px;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Right Column: Portrait Monolith */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Dedicated Interactive Three.js 3D Architecture Stage Card */
.three-stage-card {
  width: 100%;
  margin-bottom: 28px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.three-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.tst-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tst-badge {
  color: var(--brand-soft);
}

.tst-status {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t2);
}

.tst-collapse-btn {
  padding: 5px 10px;
  border-radius: var(--r-xs);
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tst-collapse-btn:hover {
  color: var(--t1);
  border-color: var(--line-strong);
}

.three-stage-viewport-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  background: radial-gradient(circle at 50% 42%, #141824 0%, #07080c 100%);
  overflow: hidden;
  cursor: grab;
}

.three-stage-viewport-wrap:active {
  cursor: grabbing;
}

body.light-mode .three-stage-viewport-wrap {
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #efece6 100%);
}

.three-stage-viewport-wrap .three-canvas-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  opacity: 1;
}

/* Unified Collapsible Bottom Control Dock (Zero Center Occlusion) */
.three-control-dock {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: max-content;
  max-width: min(860px, calc(100% - 24px));
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(12, 14, 20, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

body.light-mode .three-control-dock {
  background: rgba(255, 255, 255, 0.94);
}

.three-control-dock.dock-collapsed {
  transform: translate(-50%, calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.tcd-modes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tcd-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 8px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.tcd-slider-label {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--t3);
}

.tcd-slider {
  width: 88px;
  accent-color: var(--brand);
  cursor: pointer;
}

.tcd-btn,
.tcd-pause {
  padding: 6px 10px;
  border-radius: var(--r-xs);
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

.tcd-btn:hover,
.tcd-pause:hover {
  color: var(--t1);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.tcd-btn.active {
  background: rgba(255, 85, 0, 0.16);
  color: var(--t1);
  border-color: var(--brand);
}

.tcd-pause[aria-pressed="true"] {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.portrait-monolith {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  overflow: hidden;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait-monolith:hover {
  border-color: var(--line-strong);
  box-shadow:
    0 20px 44px -14px rgba(0, 0, 0, 0.65),
    0 0 28px -8px rgba(255, 85, 0, 0.22);
}

.portrait-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.mono-meta {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t3);
}

.portrait-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1c1f26 0%, #111318 100%);
}

.portrait-img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait-monolith:hover .portrait-img {
  transform: scale(1.025);
}

.portrait-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 12, 16, 0.42) 100%);
  pointer-events: none;
}

.portrait-caption {
  position: relative;
  z-index: 2;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.pc-name {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.25;
}

.pc-role {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.4;
}

.pc-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--brand-soft);
  margin-top: 2px;
}

.portrait-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.pf-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pf-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--t3);
}

.pf-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t1);
}

.pf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-soft);
  white-space: nowrap;
}

.pf-link:hover {
  text-decoration: underline;
}

/* Full-Width KPI Ledger Strip Below Hero Split */
.hero-stats-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: clamp(44px, 6vw, 68px);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 20px 18px;
  border-right: 1px solid var(--line);
  transition: background 0.15s ease;
}

.stat-cell:last-child {
  border-right: 0;
}

.stat-cell:hover {
  background: var(--surface-2);
}

.stat-idx {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--t4);
}

.stat-num {
  font-family: var(--ff-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.03em;
}

.stat-num-period {
  font-size: clamp(19px, 2vw, 24px);
}

.stat-label {
  font-size: 12.5px;
  color: var(--t3);
  line-height: 1.35;
}

/* Section Divider Marquee Ribbon */
.marquee-divider {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--t3);
  animation: marqueeScroll 34s linear infinite;
}

.marquee-track .m-sep {
  color: var(--brand);
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ────────────────────────────────
   SECTIONS & EDITORIAL HEADERS
   ──────────────────────────────── */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(68px, 8vw, 108px) 0;
  scroll-margin-top: var(--nav-h);
}

.sec-topline {
  border-top: 1px solid var(--line);
}

.sec-header-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: end;
  gap: 28px;
  margin-bottom: clamp(36px, 4.5vw, 52px);
}

.sec-kicker-clean {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
  margin-bottom: 10px;
}

.section-h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  color: var(--t1);
}

.sec-sub-right {
  color: var(--t3);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 54ch;
  justify-self: end;
}

/* ────────────────────────────────
   INTERACTIVE FILTER TOOLBAR
   ──────────────────────────────── */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--t3);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-btn:hover {
  color: var(--t1);
}

.filter-btn.active {
  background: var(--brand);
  color: #fff;
}

.filter-count {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  opacity: 0.85;
}

.filter-status {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t3);
}

/* ────────────────────────────────
   SHARED CARD SURFACE — Medium Sizing & Premium Spotlight
   ──────────────────────────────── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transform: perspective(1000px) translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s ease,
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.card::before,
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 0%),
    rgba(255, 85, 0, 0.11),
    transparent 65%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
  z-index: 0;
}

.card::after,
.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--brand-soft), transparent);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.38s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}

.card > *,
.project-card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  transform: perspective(1000px) translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  border-color: var(--line-strong);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48), 0 0 28px rgba(255, 85, 0, 0.10);
}

.card:hover::before,
.project-card:hover::before {
  opacity: 1;
}

.card:hover::after,
.project-card:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ────────────────────────────────
   01. PROJECTS — Compact Medium 3x2 Bento Grid
   ──────────────────────────────── */
.proj-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transform: perspective(1000px) translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.project-card:hover {
  transform: perspective(1000px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  border-color: var(--line-strong);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.52), 0 0 32px rgba(255, 85, 0, 0.12);
}

.project-card.featured-bento {
  grid-column: span 1;
}

/* Architectural Schematic Preview Header (Compact Medium) */
.p-schematic {
  position: relative;
  padding: 11px 14px;
  background: var(--bg1);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.sch-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .sch-grid {
  transform: scale(1.06);
}

.sch-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  font-family: var(--ff-mono);
  font-size: 9.5px;
}

.sch-code { color: var(--t3); white-space: nowrap; }
.sch-metric { color: var(--brand-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sch-diagram {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 10px;
  overflow: hidden;
}

.sch-node {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.sch-node-accent {
  border-color: rgba(255, 85, 0, 0.45);
  color: var(--t1);
  box-shadow: 0 0 12px rgba(255, 85, 0, 0.08);
}

.project-card:hover .sch-node-accent {
  border-color: var(--brand);
  box-shadow: 0 0 18px rgba(255, 85, 0, 0.26);
  transform: translateY(-1px);
}

.sch-arrow {
  color: var(--t4);
  display: inline-block;
  flex-shrink: 0;
  transition: color 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .sch-arrow {
  color: var(--brand-soft);
  transform: translateX(2px);
}

.p-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px;
}

.p-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--t3);
  margin-bottom: 6px;
}

.p-idx {
  color: var(--brand-soft);
  font-weight: 700;
}

.p-highlight-metric {
  color: var(--t1);
  font-weight: 600;
}

.p-title {
  font-size: 16px;
  line-height: 1.26;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.project-card:hover .p-title {
  color: #fff;
}

.p-desc {
  color: var(--t2);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.p-desc strong {
  color: var(--t1);
  font-weight: 600;
}

.p-bullets {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.p-bullets li {
  position: relative;
  padding-left: 12px;
  color: var(--t3);
  font-size: 11.8px;
  line-height: 1.4;
}

.p-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brand-soft);
}

.p-bullets li strong {
  color: var(--t1);
  font-weight: 600;
}

.p-demo-creds {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 9px;
  margin-bottom: 10px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px dashed rgba(255, 85, 0, 0.4);
  font-family: var(--ff-mono);
  font-size: 10.5px;
}

.p-creds-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
}

.p-creds-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--t2);
}

.p-creds-row code {
  font-family: var(--ff-mono);
  color: var(--t1);
  font-weight: 600;
}

/* Unboxed Zero-Pill Tech Stack Metadata */
.p-stack-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--t2);
}

.p-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.p-action-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-case-study {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--t1);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-case-study:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
}

.p-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-soft);
  white-space: nowrap;
  transition: color 0.2s ease, transform 0.2s ease;
}

.p-ext-link svg {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.p-ext-link:hover svg {
  transform: translate(2px, -2px);
}

.p-ext-link.p-gh-link {
  color: var(--t2);
}

.p-ext-link.p-gh-link:hover {
  color: var(--brand-soft);
}

.p-ext-link:hover {
  text-decoration: underline;
}

/* ────────────────────────────────
   GITHUB ACTIVITY CALENDAR CHART
   ──────────────────────────────── */
.gh-calendar-card {
  margin-top: 28px;
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gh-cal-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.gh-kicker-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.gh-kicker-line .sec-kicker-clean {
  margin-bottom: 0;
}

.gh-handle-sep {
  color: var(--t4);
}

.gh-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  transition: color 0.15s ease;
}

.gh-profile-link:hover {
  color: var(--brand-soft);
}

.gh-cal-title {
  font-size: clamp(20px, 2.4vw, 24px);
  color: var(--t1);
}

.gh-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gh-metric-box {
  padding: 14px 16px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-m-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--t3);
}

.gh-m-val {
  font-family: var(--ff-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  color: var(--t1);
}

.gh-chart-scroll {
  width: 100%;
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  background: var(--bg1);
  border: 1px solid var(--line);
}

.gh-calendar-svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
  overflow: visible;
}

.gh-month-label,
.gh-day-label {
  fill: var(--t3);
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  user-select: none;
}

.gh-cell {
  rx: 2.5px;
  ry: 2.5px;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1px;
  cursor: pointer;
  transition: stroke 0.12s ease, filter 0.12s ease;
}

.gh-cell[data-level="0"] { fill: rgba(255, 255, 255, 0.05); }
.gh-cell[data-level="1"] { fill: rgba(255, 85, 0, 0.28); }
.gh-cell[data-level="2"] { fill: rgba(255, 85, 0, 0.52); }
.gh-cell[data-level="3"] { fill: rgba(255, 85, 0, 0.78); }
.gh-cell[data-level="4"] { fill: #FF5500; }

.gh-cell:hover,
.gh-cell.active-cell {
  stroke: #ffffff;
  stroke-width: 1.5px;
  filter: brightness(1.18);
}

.gh-cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 4px;
}

.gh-cell-readout {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t2);
}

.gh-cell-readout strong {
  color: var(--brand-soft);
  font-weight: 700;
}

.gh-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t3);
}

.gh-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2.5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: inline-block;
}

.gh-legend-swatch[data-level="0"] { background: rgba(255, 255, 255, 0.05); }
.gh-legend-swatch[data-level="1"] { background: rgba(255, 85, 0, 0.28); }
.gh-legend-swatch[data-level="2"] { background: rgba(255, 85, 0, 0.52); }
.gh-legend-swatch[data-level="3"] { background: rgba(255, 85, 0, 0.78); }
.gh-legend-swatch[data-level="4"] { background: #FF5500; }

@media (max-width: 767px) {
  .gh-metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sec-cta {
  text-align: center;
  margin-top: clamp(32px, 4vw, 48px);
}

/* ────────────────────────────────
   02. EXPERIENCE LEDGER (Medium Sizing)
   ──────────────────────────────── */
.xp-ledger {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.xp-card {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 24px;
}

.xp-meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line-soft);
  padding-right: 16px;
}

.xp-idx {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-soft);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.xp-period {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}

.xp-loc {
  font-size: 12.5px;
  color: var(--t3);
}

.xp-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.xp-role {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
}

.xp-org,
.xp-org-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-soft);
}

.xp-org-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.xp-org-link:hover {
  text-decoration: underline;
}

.xp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.xp-list li {
  position: relative;
  padding-left: 15px;
  color: var(--t2);
  font-size: 13.5px;
  line-height: 1.55;
}

.xp-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brand-soft);
}

.xp-stack-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  color: var(--t3);
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.xp-links-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12.5px;
}

.xp-links-kicker {
  color: var(--t3);
  font-family: var(--ff-mono);
  font-size: 11px;
}

.xp-link {
  color: var(--brand-soft);
  font-weight: 600;
}

.xp-link:hover {
  text-decoration: underline;
}

/* ────────────────────────────────
   03. ENGINEERING TOOLKIT (Medium Sizing)
   ──────────────────────────────── */
.tech-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tech-cat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
}

.tech-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.tech-cat-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tech-cat-idx {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
}

.tech-cat-title {
  font-family: var(--ff-display);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--t1);
}

.tech-cat-count {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--t3);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.tech-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tech-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--t1);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.tech-skill-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-soft);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-skill-chip:hover {
  border-color: var(--brand-soft);
  background: var(--surface-3);
  transform: translateY(-2px);
}

.tech-skill-chip:hover::before {
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--brand);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tech-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.tech-card .t-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.tech-card img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.t-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.t-name {
  font-family: var(--ff-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--t1);
}

.t-cat {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t3);
}

.ic-invert { filter: brightness(0) invert(1); opacity: 0.9; }
.ic-django { filter: invert(58%) sepia(38%) saturate(520%) hue-rotate(105deg) brightness(0.95); }
.ic-sock   { filter: brightness(0) invert(0.85); }

/* ────────────────────────────────
   04. ABOUT, EDUCATION & TIMELINE (Medium Sizing)
   ──────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}

.about-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}

.about-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
}

.card-kicker-mono {
  display: block;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
  margin-bottom: 3px;
}

.about-name {
  font-size: 18px;
  color: var(--t1);
}

.about-org {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t2);
}

.about-org:hover {
  color: var(--brand-soft);
}

.about-text {
  color: var(--t2);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.about-principles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
}

.principle-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pr-idx {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-soft);
  padding-top: 2px;
}

.principle-row strong {
  display: block;
  font-size: 13.5px;
  color: var(--t1);
  margin-bottom: 2px;
}

.principle-row p {
  font-size: 12.5px;
  color: var(--t3);
  line-height: 1.5;
}

.about-card-head {
  margin-bottom: 14px;
}

.about-card-head h3 {
  font-size: 18px;
}

.edu-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.edu-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.edu-item:first-child { padding-top: 0; }
.edu-item:last-child { border-bottom: 0; padding-bottom: 0; }

.edu-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.edu-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
}

.edu-period-mono {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--brand-soft);
  white-space: nowrap;
}

.edu-where {
  font-size: 12.5px;
  color: var(--t3);
}

/* Chronology Timeline Strip */
.tl-wrap {
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.tl-header {
  margin-bottom: 18px;
}

.tl-title {
  font-size: 18px;
}

.tl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.tl-step {
  padding-top: 12px;
  border-top: 2px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.tl-step:hover {
  border-top-color: var(--brand-soft);
  transform: translateY(-2px);
}

.tl-step-highlight {
  border-top-color: var(--brand);
}

.tl-year {
  display: block;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-soft);
  margin-bottom: 4px;
}

.tl-step h4 {
  font-size: 14.5px;
  color: var(--t1);
  margin-bottom: 4px;
}

.tl-step p {
  font-size: 12.5px;
  color: var(--t3);
  line-height: 1.55;
}

/* ────────────────────────────────
   05. ACHIEVEMENTS & CERTIFICATIONS (Medium Sizing)
   ──────────────────────────────── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.ach-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.ach-idx {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-soft);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.ach-title {
  font-size: 15.5px;
  color: var(--t1);
  margin-bottom: 6px;
}

.ach-text {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.55;
}

.ach-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-soft);
}

.ach-link:hover {
  text-decoration: underline;
}

.cert-subsection {
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.cert-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.cert-h3 {
  font-size: 24px;
}

.cert-total-mono {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t3);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.cert-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cert-year {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-soft);
}

.cert-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.4;
}

.cert-issuer {
  font-size: 12.5px;
  color: var(--t3);
  margin-top: auto;
}

/* ────────────────────────────────
   06. CONTACT
   ──────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
}

.avail-banner {
  padding: 22px 24px;
  margin-bottom: 16px;
}

.avail-kicker {
  display: block;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
  margin-bottom: 6px;
}

.avail-banner strong {
  display: block;
  font-family: var(--ff-display);
  font-size: 16px;
  color: var(--t1);
  margin-bottom: 6px;
}

.avail-banner p {
  font-size: 13.5px;
  color: var(--t3);
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}

.social-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.social-label {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t3);
}

.social-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-action {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--brand-soft);
  flex-shrink: 0;
}

.form-card {
  padding: clamp(24px, 3.5vw, 36px);
}

.form-card-head {
  margin-bottom: 24px;
}

.form-card-head h3 {
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 7px;
}

.field label em {
  color: var(--brand-soft);
  font-style: normal;
}

.contact-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-xs);
  font-size: 14px;
  color: var(--t1);
  background: var(--bg1);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-input::placeholder {
  color: var(--t4);
}

.contact-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.15);
}

textarea.contact-input {
  resize: vertical;
  min-height: 120px;
}

.form-msg {
  font-size: 13px;
  color: var(--red);
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-xs);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-submit {
  width: 100%;
  padding: 14px;
}

.form-success {
  text-align: center;
  padding: 28px 12px;
}

.ok-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--emerald);
  margin-bottom: 10px;
}

.form-success h4 {
  font-size: 22px;
  margin-bottom: 8px;
}

.form-success p {
  color: var(--t3);
  font-size: 14.5px;
  margin-bottom: 20px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ────────────────────────────────
   PROJECT CASE STUDY LIGHTBOX MODAL
   ──────────────────────────────── */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pm-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}

.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.pm-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--t3);
}

.pm-idx {
  color: var(--brand-soft);
  font-weight: 700;
}

.pm-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  color: var(--t2);
}

.pm-close:hover {
  color: var(--t1);
  border-color: var(--line-strong);
}

.pm-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pm-title {
  font-size: clamp(22px, 3vw, 28px);
  color: var(--t1);
}

.pm-summary {
  color: var(--t2);
  font-size: 15px;
  line-height: 1.7;
}

.pm-metric-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.pm-label {
  display: block;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--t3);
  margin-bottom: 2px;
}

.pm-metric-bar strong {
  font-size: 14px;
  color: var(--t1);
}

.pm-subhead {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-soft);
  margin-bottom: 8px;
}

.pm-text {
  color: var(--t2);
  font-size: 14.5px;
  line-height: 1.7;
}

.pm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-list li {
  position: relative;
  padding-left: 16px;
  color: var(--t2);
  font-size: 14px;
  line-height: 1.65;
}

.pm-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brand-soft);
}

.pm-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 12.5px;
  color: var(--t1);
}

.pm-creds-box {
  padding: 11px 14px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px dashed rgba(255, 85, 0, 0.45);
  font-family: var(--ff-mono);
  font-size: 12.5px;
  color: var(--t1);
}

.pm-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* ────────────────────────────────
   FOOTER & BACK TO TOP
   ──────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 32px 0;
  background: var(--bg1);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-name {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}

.footer-note {
  font-size: 12.5px;
  color: var(--t3);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--t2);
}

.footer-links a:hover {
  color: var(--brand-soft);
}

#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--sh-brand);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ────────────────────────────────
   SMOOTH PREMIUM REVEAL & FILTER ANIMATIONS
   ──────────────────────────────── */
@keyframes cardRevealUp {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateY(22px) scale(0.975);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translateY(0) scale(1);
  }
}

@keyframes cardFilterIn {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateY(16px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translateY(0) scale(1);
  }
}

.reveal, .reveal-left, .reveal-right, .reveal-scale {
  opacity: 1;
  transform: none;
}

.reveal.anim-in {
  animation: cardRevealUp 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--stagger-delay, 0ms);
}

.filter-anim-in {
  animation: cardFilterIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--filter-delay, 0ms);
}

/* ═══════════════════════════════════════════════════════════════════
   COMPLETE RESPONSIVE ARCHITECTURE
   Laptop (1024–1279px) · Tablet Landscape/Tab (768–1023px)
   Tablet Portrait (600–767px) · Mobile (≤599px & ≤480px)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Laptop / Compact Desktop (≤ 1180px) ── */
@media (max-width: 1180px) {
  .tech-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cert-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Tablet Landscape / Tab (≤ 1023px) ── */
@media (max-width: 1023px) {
  :root {
    --nav-h: 60px;
  }

  .container,
  .nav-inner {
    width: calc(100% - 36px);
  }

  /* Switch primary links to slide-over drawer; keep header clean */
  .nav-links {
    display: none;
  }

  #burger-btn {
    display: inline-flex;
  }

  /* Hero stacks cleanly with balanced proportions */
  .hero-split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-visual {
    align-items: center;
  }

  .portrait-monolith {
    max-width: 420px;
    margin-inline: auto;
  }

  .three-stage-viewport-wrap {
    height: 330px;
  }

  .three-control-dock {
    width: calc(100% - 20px);
    max-width: 680px;
    padding: 8px 10px;
    gap: 8px;
  }

  .portrait-media-frame {
    aspect-ratio: 1 / 1;
    min-height: 0;
  }

  .portrait-img {
    min-height: 0;
    max-height: none;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 18%;
  }

  /* KPI Ledger becomes 2x2 grid on tablet */
  .hero-stats-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-cell:nth-child(2n) {
    border-right: 0;
  }

  .stat-cell:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  /* Section Headers stack cleanly */
  .sec-header-split {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sec-sub-right {
    justify-self: start;
    max-width: 65ch;
  }

  /* Bento Grid stays 2-column on Tablet Landscape */
  .proj-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card.featured-bento {
    grid-column: span 1;
  }

  .tech-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Experience Card adapts to single column */
  .xp-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px;
  }

  .xp-meta-col {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-right: 0;
    padding-bottom: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .tl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Tablet Portrait (≤ 767px) ── */
@media (max-width: 767px) {
  .container,
  .nav-inner {
    width: calc(100% - 28px);
  }

  .proj-bento-grid {
    grid-template-columns: 1fr;
  }

  .tech-cat-grid {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pm-metric-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Mobile Devices (≤ 599px) ── */
@media (max-width: 599px) {
  :root {
    --nav-h: 56px;
  }

  .container,
  .nav-inner {
    width: calc(100% - 24px);
  }

  /* Keep top bar compact on mobile */
  .resume-split {
    display: none;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 38px);
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row > .btn,
  .hero-resume-split {
    width: 100%;
  }

  .hero-resume-view {
    flex: 1;
  }

  .portrait-monolith {
    max-width: 100%;
  }

  .portrait-header-bar {
    padding: 10px 14px;
  }

  .portrait-caption {
    padding: 12px 15px;
  }

  .portrait-footer-bar {
    padding: 12px 15px;
  }

  /* KPI Ledger becomes 2x2 grid on Mobile */
  .hero-stats-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-cell {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 16px 14px;
  }

  .stat-cell:nth-child(2n) {
    border-right: 0;
  }

  .stat-cell:nth-last-child(-n+2) {
    border-bottom: 0;
  }

  /* Projects, Tech, Timeline, Achievements, Certs become 1-column */
  .proj-bento-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured-bento {
    grid-column: span 1;
  }

  .tech-cat-grid {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .tl-grid {
    grid-template-columns: 1fr;
  }

  .ach-grid {
    grid-template-columns: 1fr;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }

  .p-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-case-study,
  .p-ext-link {
    justify-content: center;
    padding: 10px 14px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FIRST-VISIT "HELLO" INTRO ANIMATION OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.hello-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #111522 0%, #07080c 68%, #040508 100%);
  color: var(--t1);
  overflow: hidden;
  transition:
    opacity 1.15s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.25s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 1.25s ease;
}

.hello-intro-overlay.is-exiting {
  opacity: 0;
  transform: translate3d(0, -3.5%, 0) scale(1.015);
  pointer-events: none;
}

.hello-intro-overlay.is-complete {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.hello-intro-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hello-orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hello-orbit-ring-1 {
  width: min(460px, 78vw);
  height: min(460px, 78vw);
  border-top-color: rgba(255, 85, 0, 0.48);
  border-right-color: rgba(255, 140, 66, 0.16);
  animation: helloRingSpin 18s linear infinite;
}

.hello-orbit-ring-2 {
  width: min(620px, 94vw);
  height: min(620px, 94vw);
  border-bottom-color: rgba(56, 189, 248, 0.32);
  border-left-color: rgba(255, 85, 0, 0.22);
  animation: helloRingSpinReverse 26s linear infinite;
}

.hello-ambient-glow {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 85, 0, 0.16) 0%, rgba(56, 189, 248, 0.06) 48%, transparent 72%);
  filter: blur(36px);
}

@keyframes helloRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes helloRingSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.hello-intro-center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hello-kicker {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
  opacity: 0;
  transform: translateY(12px);
  animation: helloFadeUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.hello-word-wrap {
  overflow: hidden;
  padding: 6px 14px;
}

.hello-word {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--ff-display);
  font-size: clamp(56px, 11vw, 116px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: #f4f5f8;
}

.hello-char,
.hello-dot {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 68%, 0) rotateX(-25deg);
  animation: helloCharReveal 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.45s + var(--char-idx, 0) * 0.16s);
}

.hello-dot {
  color: var(--brand);
  font-family: var(--ff-serif);
  font-style: italic;
  margin-left: 2px;
}

@keyframes helloCharReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 68%, 0);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes helloFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hello-sub {
  font-family: var(--ff-sans);
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 500;
  color: var(--t2);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(12px);
  animation: helloFadeUp 1.15s cubic-bezier(0.16, 1, 0.3, 1) 1.55s forwards;
}

.hello-sub span {
  color: var(--brand);
  margin-inline: 6px;
}

.hello-progress-track {
  width: min(220px, 64vw);
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}

.hello-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #ff9248, var(--cobalt));
  transform-origin: left center;
  transform: scaleX(0);
  animation: helloProgressFill 3.85s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

@keyframes helloProgressFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hello-skip-btn {
  position: absolute;
  bottom: 32px;
  right: 32px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.hello-skip-btn:hover {
  background: rgba(255, 85, 0, 0.14);
  border-color: rgba(255, 85, 0, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════
   ORBITING / ROTATING ANIMATED SEARCH BAR
   ═══════════════════════════════════════════════════════════════════ */
.orbit-search-section {
  margin-bottom: 20px;
}

.orbit-search-shell {
  position: relative;
  border-radius: 14px;
  padding: 1.5px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.orbit-search-shell:focus-within,
.orbit-search-shell:hover {
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.52),
    0 0 28px rgba(255, 85, 0, 0.16);
}

/* Rotating Conic-Gradient Orbital Light Beam along the Search Bar Border */
.orbit-search-halo {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  z-index: 0;
}

.orbit-conic-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220%;
  height: 220%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 62deg,
    rgba(255, 85, 0, 0.92) 105deg,
    rgba(255, 158, 94, 0.98) 120deg,
    transparent 150deg,
    transparent 242deg,
    rgba(56, 189, 248, 0.85) 285deg,
    rgba(255, 85, 0, 0.72) 310deg,
    transparent 340deg
  );
  animation: searchOrbitBeam 5.5s linear infinite;
}

.orbit-search-shell:focus-within .orbit-conic-beam {
  animation-duration: 3.2s;
}

/* Subtle Counter-Rotating Orbital Tracks inside the Halo */
.orbit-track {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 85, 0, 0.18);
  transform: translate(-50%, -50%);
}

.orbit-track-outer {
  width: 96%;
  height: 320%;
  animation: searchOrbitBeam 9s linear infinite;
}

.orbit-track-inner {
  width: 78%;
  height: 250%;
  border-color: rgba(56, 189, 248, 0.18);
  animation: searchOrbitBeamReverse 7s linear infinite;
}

.orbit-node {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.orbit-node-orange {
  background: var(--brand);
  box-shadow: 0 0 12px 3px rgba(255, 85, 0, 0.85);
}

.orbit-node-cobalt {
  background: var(--cobalt);
  box-shadow: 0 0 12px 3px rgba(56, 189, 248, 0.85);
}

@keyframes searchOrbitBeam {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes searchOrbitBeamReverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0deg); }
}

.orbit-search-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12.5px;
  background: rgba(13, 15, 22, 0.95);
  backdrop-filter: blur(14px);
}

.orbit-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.orbit-search-shell:focus-within .orbit-search-icon {
  transform: scale(1.08);
}

.orbit-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--t1);
  font-family: var(--ff-sans);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}

.orbit-search-input::placeholder {
  color: var(--t3);
}

.orbit-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.orbit-search-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.orbit-search-count {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.orbit-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--t2);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.orbit-search-clear:hover {
  background: rgba(255, 85, 0, 0.16);
  border-color: rgba(255, 85, 0, 0.45);
  color: var(--t1);
}

.orbit-search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--t3);
  font-family: var(--ff-mono);
  font-size: 11px;
}

.orbit-search-BarFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-inline: 4px;
}

.orbit-quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.oqt-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--t3);
  margin-right: 2px;
}

.oqt-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--t2);
  font-family: var(--ff-mono);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.oqt-btn:hover,
.oqt-btn.active {
  background: rgba(255, 85, 0, 0.14);
  border-color: rgba(255, 85, 0, 0.45);
  color: var(--t1);
}

.orbit-skills-readout {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  color: var(--t2);
}

.orbit-skills-readout strong {
  color: var(--brand-soft);
}

.projects-empty-state {
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.pes-title {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 6px;
}

.pes-sub {
  font-size: 14px;
  color: var(--t2);
  margin-bottom: 16px;
}

@media (max-width: 599px) {
  .hello-skip-btn {
    bottom: 20px;
    right: 20px;
  }

  .orbit-search-inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .orbit-search-input {
    font-size: 13.5px;
  }

  .orbit-search-kbd {
    display: none;
  }
}

/* ── Reduced Motion Compliance ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
