/* ═══════════════════════════════════════════════════════════════
   JUSTIN MATHEW — SHARED DESIGN SYSTEM  v2.0
   Premium Warm Gold palette · Dark-first · .light class for light
   Fonts: DM Serif Display · Libre Baskerville · IBM Plex Mono
   Google Fonts link (add to every <head>):
   https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1
   &family=Libre+Baskerville:ital,wght@0,400;0,700;1,400
   &family=IBM+Plex+Mono:wght@300;400;500&display=swap
═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   DESIGN TOKENS — DARK MODE (Pure Primeval Nature & Pine)
────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds: Deep Midnight Pine Void (Richer, darker, high contrast) */
  --bg:          #030705;
  --surface:     #08120c;
  --surface-2:   #0d1d13;

  /* Borders: Deep Spruce & Pine Slate */
  --border:      #14271c;
  --border-2:    #0f2016;

  /* Text: Clean Mist & Crisp Mountain Pine (High-Legibility, Zero Murky Grey) */
  --text:        #f4fbf6;              /* Ultra-clean luminous white mist */
  --sub:         #cde2d6;              /* Crisp high-contrast sage mint (8.8:1 contrast against #030705) */
  --faint:       #a3c7b2;              /* Bright legible label pine (6.4:1 contrast) */
  --muted:       #7da88f;              /* Clear meta text (4.8:1 contrast) */

  /* Pure Nature Palette: Deep Pine, Emerald & Alpine Glacier */
  --nature:         #10b981;              /* Primary Accent: Emerald Forest */
  --nature-hi:      #34d399;              /* Hover Accent: Fresh Spring Sprout */
  --nature-dim:     #047857;              /* Deep Pine */
  --nature-glow:    rgba(var(--accent-rgb), 0.16);
  --glacier:        #2dd4bf;              /* Mountain Glacier Teal */
  --sprout:         #4ade80;              /* Morning Sprout */
  --accent-rgb:     16, 185, 129;
  --accent-hi-rgb:  52, 211, 153;
  --accent-dim-rgb: 4, 120, 87;
  --glacier-rgb:    45, 212, 191;
  --sprout-rgb:     74, 222, 128;

  /* Aliases pointing to pure Nature tokens */
  --gold:        var(--nature);
  --gold-hi:     var(--nature-hi);
  --gold-dim:    var(--nature-dim);
  --gold-glow:   var(--nature-glow);

  /* Status colours (Pure Botanical) */
  --thinking:    #2dd4bf;
  --exploring:   #4ade80;
  --building:    #10b981;
  --dropped:     #6b7280;

  /* Fonts */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-serif:   'Libre Baskerville', Georgia, serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* Layout */
  --section-gap: 120px;
  --radius:       2px;
  --nav-h:        58px;
  --max-w:        980px;
  --pad-x:        36px;
}

/* ──────────────────────────────────────────────────────────────
   DESIGN TOKENS — LIGHT MODE (High-Contrast Alpine Alabaster & Forest Ink)
────────────────────────────────────────────────────────────── */
html.light {
  /* Backgrounds: Pristine Light Canvas with Crisp White Surfaces */
  --bg:          #f7faf8;              /* Clean, crisp, luminous background */
  --surface:     #ffffff;              /* True crisp white cards for maximum contrast */
  --surface-2:   #edf4ef;              /* Soft secondary surface for insets & chips */

  /* Borders: Defined, crisp boundaries (Strong visible contrast) */
  --border:      #8db89b;
  --border-2:    #76a786;

  /* Text: Deep Carbon Pine (WCAG AAA High Contrast, Zero Pale Washed-Out Ink) */
  --text:        #041209;              /* Maximum dark carbon pine (>17:1 contrast ratio) */
  --sub:         #0a2414;              /* Deep solid pine (>13:1 contrast ratio) */
  --faint:       #143820;              /* Dark legible pine labels (>9:1 contrast ratio) */
  --muted:       #204c2e;              /* Clear metadata (>7:1 contrast ratio) */

  /* High-Contrast Nature Palette */
  --nature:         #047857;              /* Deep vivid emerald */
  --nature-hi:      #065f46;              /* Deep pine evergreen on hover */
  --nature-dim:     #022c22;              /* Deep Ancient Pine */
  --nature-glow:    rgba(var(--accent-rgb), 0.14);
  --glacier:        #0f766e;
  --sprout:         #15803d;
  --accent-rgb:     4, 120, 87;
  --accent-hi-rgb:  6, 95, 70;
  --accent-dim-rgb: 2, 44, 34;
  --glacier-rgb:    15, 118, 110;
  --sprout-rgb:     21, 128, 61;
  --gold:           var(--nature);
  --gold-hi:        var(--nature-hi);
  --gold-dim:       var(--nature-dim);
  --gold-glow:      var(--nature-glow);

  /* Status colours in Light Mode */
  --thinking:    #0284c7;              /* Clear Cerulean Sky */
  --exploring:   #15803d;              /* Rich Leaf Green */
  --building:    #047857;              /* Deep Pine Emerald */
  --dropped:     #4b5563;              /* Deep Steel Grey */
}

/* ──────────────────────────────────────────────────────────────
   RESET
────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html                   { scroll-behavior: smooth; overflow-x: hidden; }
img                    { max-width: 100%; height: auto; }

/* ──────────────────────────────────────────────────────────────
   BASE BODY
────────────────────────────────────────────────────────────── */
body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-mono);
  font-size:   14px;
  line-height: 1.6;
  min-height:  100vh;
  overflow-x:  hidden;
  transition:  background 0.35s, color 0.35s;
}

a { color: inherit; text-decoration: none; }

/* ── Dot-grid global background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #102416 1.1px, transparent 1.1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

body.light::before {
  background-image: radial-gradient(circle, #bcd1c1 1px, transparent 1px);
  opacity: 0.30;
}

/* ── Ambient nature glow at top ── */
body::after {
  content: '';
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 70vw;
  height: 55vh;
  background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ──────────────────────────────────────────────────────────────
   LAYOUT HELPERS
────────────────────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

section { padding: var(--section-gap) 0; }

/* ──────────────────────────────────────────────────────────────
   NAVIGATION
────────────────────────────────────────────────────────────── */
nav.site-nav,
body > nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 7, 5, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.35s, border-color 0.35s;
}

body.light nav.site-nav,
body.light body > nav {
  background: rgba(247, 250, 248, 0.95);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--gold);
  letter-spacing: 0.01em;
  flex-shrink: 0;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-logo:hover { color: var(--gold-hi); }

.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-links li {
  white-space: nowrap;
}

.nav-links a {
  color: var(--sub);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
  display: inline-block;
}

.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

/* Theme toggle button */
#theme-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.25s, transform 0.25s, color 0.25s;
}

#theme-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(20deg);
}

/* ──────────────────────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: all 0.22s;
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Filled primary (Nature Emerald) */
.btn-primary {
  background: var(--nature);
  color: #021208;
  font-weight: 700;
  border: 1.5px solid var(--nature);
  box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.35);
}

body.light .btn-primary {
  background: var(--nature-dim);
  color: #ffffff;
  font-weight: 700;
  border: 1.5px solid var(--nature-dim);
  box-shadow: 0 4px 16px rgba(var(--accent-dim-rgb), 0.3);
}

.btn-primary:hover {
  background: var(--nature-hi);
  border-color: var(--nature-hi);
  color: #021208;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.45);
}

body.light .btn-primary:hover {
  background: #065f46;
  border-color: #065f46;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(var(--accent-dim-rgb), 0.35);
}

/* Ghost with border */
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: #f4fbf6;
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: var(--nature);
  color: var(--nature-hi);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.25);
}

body.light .btn-ghost {
  border: 1.5px solid #06150b;
  color: #041209;
  background: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light .btn-ghost:hover {
  border-color: var(--nature-dim);
  color: #ffffff;
  background: var(--nature-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-dim-rgb), 0.25);
}

/* Outlined nature */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--nature);
  color: var(--nature);
  font-weight: 600;
}

.btn-outline:hover {
  background: var(--nature);
  color: #021208;
  font-weight: 700;
}

body.light .btn-outline {
  border: 1.5px solid var(--nature-dim);
  color: var(--nature-dim);
  font-weight: 700;
  background: #ffffff;
}

body.light .btn-outline:hover {
  background: var(--nature-dim);
  color: #ffffff;
}

/* Terminal button */
.btn-terminal {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  color: var(--nature-hi);
  font-weight: 700;
}

body.light .btn-terminal {
  background: #e6f6ec;
  border: 1.5px solid var(--nature-dim);
  color: var(--nature-dim);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(var(--accent-dim-rgb), 0.15);
}

.btn-terminal:hover {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: var(--nature-hi);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.35);
}

body.light .btn-terminal:hover {
  background: var(--nature-dim);
  border-color: var(--nature-dim);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-dim-rgb), 0.3);
}

.terminal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nature);
  margin-right: 6px;
  animation: pulse 2s infinite;
}

/* ──────────────────────────────────────────────────────────────
   TYPOGRAPHY UTILITIES
────────────────────────────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  width: fit-content;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  flex-shrink: 0;
}

body.light .section-label {
  color: var(--nature-dim);
  font-weight: 600;
}

body.light .section-label::before {
  background: var(--nature-dim);
  box-shadow: 0 0 6px rgba(var(--accent-dim-rgb), 0.4);
}

.section-title {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
}

.section-title em {
  font-style: italic;
  color: var(--gold);
}

.section-subtitle {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--sub);
  max-width: 520px;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 3px;
  height: 0.75em;
  background: var(--gold);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}

/* ──────────────────────────────────────────────────────────────
   STATUS PILLS (Ideas Lab / Portfolio)
────────────────────────────────────────────────────────────── */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-thinking  { background: rgba(110, 173, 212, 0.12); color: var(--thinking); }
.status-exploring { background: rgba(184, 150, 232, 0.12); color: var(--exploring); }
.status-building  { background: rgba(95, 212, 160, 0.12);  color: var(--building); }
.status-dropped   { background: rgba(196, 116, 116, 0.12); color: var(--dropped); }

/* ──────────────────────────────────────────────────────────────
   FORM ELEMENTS
────────────────────────────────────────────────────────────── */
label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

input, textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
  border-radius: var(--radius);
  transition: border-color 0.22s, box-shadow 0.22s;
  appearance: none;
  -webkit-appearance: none;
  caret-color: var(--gold);
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238c8983'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ──────────────────────────────────────────────────────────────
   KEYFRAMES
────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

@keyframes blink {
  50% { opacity: 0; }
}

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

@keyframes sweepLine {
  0%,100% { width: 52px; opacity: 0.5; }
  50%     { width: 72px; opacity: 1; }
}

/* ── Staggered hero entry ── */
.anim { opacity: 0; animation: fadeUp 0.5s ease forwards; }
.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.12s; }
.anim-3 { animation-delay: 0.19s; }
.anim-4 { animation-delay: 0.26s; }
.anim-5 { animation-delay: 0.33s; }
.anim-6 { animation-delay: 0.40s; }
.anim-7 { animation-delay: 0.47s; }
.anim-8 { animation-delay: 0.54s; }

/* ── Scroll-triggered reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible      { opacity: 1; transform: translateY(0); }
.reveal-d1           { transition-delay: 0.05s; }
.reveal-d2           { transition-delay: 0.12s; }
.reveal-d3           { transition-delay: 0.19s; }
.reveal-d4           { transition-delay: 0.26s; }
.reveal-d5           { transition-delay: 0.33s; }

/* ──────────────────────────────────────────────────────────────
   SITE FOOTER
────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  position: relative;
  z-index: 1;
  background: var(--bg);
  transition: background 0.35s;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  align-items: start;
  gap: 32px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.footer-tagline {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--sub);
  max-width: 320px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nature);
  margin-bottom: 2px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-nav a:hover {
  color: var(--gold);
  transform: translateX(2px);
}

.back-top {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  justify-self: end;
}

.back-top:hover {
  color: var(--gold);
  border-color: var(--gold);
}

@media (max-width: 780px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
  .footer-left {
    grid-column: 1 / -1;
  }
  .back-top {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ──────────────────────────────────────────────────────────────
   SCROLLBAR
────────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 3px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--gold-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE GLOBALS & ULTRA-WIDE / LANDSCAPE OPTIMIZATIONS
────────────────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: var(--radius);
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}

.nav-hamburger:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Wide Desktop Screens (1280px+) */
@media (min-width: 1280px) {
  :root {
    --max-w: 1220px;
    --pad-x: 48px;
    --section-gap: 140px;
  }
  .nav-inner {
    max-width: 1320px;
  }
}

/* Ultra-Wide Monitors & Landscape Displays (1600px+) */
@media (min-width: 1600px) {
  :root {
    --max-w: 1420px;
    --pad-x: 64px;
    --section-gap: 160px;
  }
  .nav-inner {
    max-width: 1540px;
  }
  body {
    font-size: 15px;
  }
}

/* 4K & Extreme Ultrawide Displays (2000px+) */
@media (min-width: 2000px) {
  :root {
    --max-w: 1680px;
    --pad-x: 80px;
  }
  .nav-inner {
    max-width: 1800px;
  }
}

@media (max-width: 1020px) {
  :root { --section-gap: 80px; --pad-x: 20px; }
  .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(6, 18, 11, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1.5px solid rgba(var(--accent-rgb), 0.35);
    flex-direction: column;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.7);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    z-index: 9999;
  }
  body.light .nav-links {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 20px 48px rgba(0,0,0,0.12);
  }
  .nav-links.open {
    display: flex;
    animation: mobileNavSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
  }
  .nav-links a:active,
  .nav-links a.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--nature);
  }
}

@keyframes mobileNavSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ──────────────────────────────────────────────────────────────
   CERTIFICATE LIGHTBOX MODAL
────────────────────────────────────────────────────────────── */
.cert-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 8, 7, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cert-modal.active {
  display: flex;
  opacity: 1;
}

.cert-modal-dialog {
  position: relative;
  max-width: 860px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.cert-modal.active .cert-modal-dialog {
  transform: scale(1);
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-2);
  background: var(--surface-2);
}

.cert-modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
}

.cert-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--sub);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.cert-modal-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cert-modal-body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  max-height: 80vh;
  overflow: auto;
}

.cert-modal-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 2px;
}

/* ──────────────────────────────────────────────────────────────
   INTERACTIVE TECH CONSOLE / TERMINAL DRAWER
────────────────────────────────────────────────────────────── */
.tech-terminal-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(var(--glacier-rgb), 0.08);
  border: 1px solid rgba(var(--glacier-rgb), 0.3);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.tech-terminal-trigger:hover {
  background: rgba(var(--glacier-rgb), 0.16);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(var(--glacier-rgb), 0.25);
}

body.light .tech-terminal-trigger {
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.4);
  color: var(--nature-dim);
  font-weight: 500;
}

body.light .tech-terminal-trigger:hover {
  background: rgba(13, 148, 136, 0.16);
  border-color: #064e3b;
  color: #064e3b;
}

.tech-terminal-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 8, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tech-terminal-modal.active {
  display: flex;
}

.tech-terminal-box {
  background: #080d0b;
  border: 1px solid rgba(var(--glacier-rgb), 0.4);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(var(--glacier-rgb), 0.12);
  border-radius: 8px;
  width: 100%;
  max-width: 920px;
  overflow: hidden;
  font-family: var(--font-mono);
  transition: all 0.25s ease;
  position: relative;
}

@media (min-width: 1400px) {
  .tech-terminal-box {
    max-width: 1080px;
  }
}

.tech-terminal-box.maximized {
  max-width: 96vw;
  height: 90vh;
}

.tech-terminal-box.maximized .tech-terminal-body {
  max-height: calc(90vh - 46px);
}

.tech-terminal-topbar {
  background: #0d1512;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(var(--glacier-rgb), 0.15);
  user-select: none;
}

.tech-terminal-dots {
  display: flex;
  gap: 8px;
}

.tech-term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 8px;
  color: transparent;
  transition: transform 0.15s, opacity 0.15s;
}

.tech-term-dot:hover {
  transform: scale(1.1);
  color: rgba(0, 0, 0, 0.6);
}

.tech-term-dot.red { background: #ff5f56; border: 1px solid #e0443e; }
.tech-term-dot.yellow { background: #ffbd2e; border: 1px solid #dea123; }
.tech-term-dot.green { background: #27c93f; border: 1px solid #1aab29; }

.tech-terminal-title,
body.light .tech-terminal-title {
  color: #cbd5e1 !important;
  font-size: 11px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tech-terminal-body,
body.light .tech-terminal-body {
  padding: 20px 22px;
  max-height: 520px;
  overflow-y: auto;
  color: #e2e8f0 !important;
  font-size: 12.5px;
  line-height: 1.65;
}

.tech-terminal-output {
  margin-bottom: 14px;
}

.tech-terminal-prompt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  background: transparent;
}

.tech-prompt-symbol {
  color: var(--glacier);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tech-terminal-input,
input.tech-terminal-input,
body.light .tech-terminal-input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #f0fdf4 !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  width: 100% !important;
  caret-color: var(--glacier) !important;
}

.tech-terminal-input::placeholder,
body.light .tech-terminal-input::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

.tech-terminal-input:focus,
input.tech-terminal-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.system-spec-badge,
body.light .system-spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--glacier-rgb), 0.08) !important;
  border: 1px solid rgba(var(--glacier-rgb), 0.35) !important;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  color: #a7f3d0 !important;
  font-family: var(--font-mono);
}

/* Force light mode terminal child elements to never inherit dark-on-dark body colors */
body.light .tech-terminal-box [style*="color:var(--sub)"],
body.light .tech-terminal-box div[style*="color:var(--sub)"],
body.light .tech-terminal-box span[style*="color:var(--sub)"] {
  color: #cbd5e1 !important;
}

body.light .tech-terminal-box [style*="color:var(--faint)"],
body.light .tech-terminal-box div[style*="color:var(--faint)"],
body.light .tech-terminal-box span[style*="color:var(--faint)"] {
  color: #94a3b8 !important;
}

body.light .tech-terminal-box [style*="color:var(--nature)"],
body.light .tech-terminal-box div[style*="color:var(--nature)"],
body.light .tech-terminal-box span[style*="color:var(--nature)"],
body.light .tech-terminal-box a[style*="color:var(--nature)"] {
  color: var(--nature-hi) !important;
}

body.light .tech-terminal-box a {
  color: var(--glacier) !important;
}

/* ──────────────────────────────────────────────────────────────
   TERMINAL VIEWER VIEWPORT (Integrated Code / Markdown Viewer)
────────────────────────────────────────────────────────────── */
.term-viewport-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 7, 0.98) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
  flex-direction: column;
  animation: termFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.term-viewport-overlay.active {
  display: flex;
}

@keyframes termFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.term-viewport-header {
  background: #0d1713 !important;
  border-bottom: 1px solid rgba(var(--glacier-rgb), 0.25) !important;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.term-viewport-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #f0f7f2;
}

.term-viewport-filename {
  color: var(--nature-hi) !important;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.term-viewport-meta,
body.light .term-viewport-meta {
  color: #94a3b8 !important;
  font-size: 11px;
}

.term-viewport-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-viewport-btn,
body.light .term-viewport-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(var(--glacier-rgb), 0.35) !important;
  color: #e2e8f0 !important;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.term-viewport-btn:hover,
body.light .term-viewport-btn:hover {
  background: rgba(var(--accent-rgb), 0.25) !important;
  color: #ffffff !important;
  border-color: var(--nature-hi) !important;
}

.term-viewport-btn.close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.term-viewport-btn.close:hover {
  background: #ef4444;
  color: #fff;
}

.term-viewport-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #d1e3d7;
  user-select: text;
}

.term-viewport-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.term-viewport-content h1, 
.term-viewport-content h2, 
.term-viewport-content h3 {
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 400;
  margin: 18px 0 10px;
  letter-spacing: 0.02em;
}

.term-viewport-content h1 { font-size: 22px; color: var(--nature); border-bottom: 1px solid rgba(var(--glacier-rgb),0.2); padding-bottom: 8px; }
.term-viewport-content h2 { font-size: 18px; color: var(--nature-hi); margin-top: 24px; }
.term-viewport-content h3 { font-size: 15px; color: var(--glacier); }

.term-viewport-content p {
  margin: 8px 0;
  color: #c7ded0;
}

.term-viewport-content ul, 
.term-viewport-content ol {
  margin: 8px 0 16px 20px;
}

.term-viewport-content li {
  margin: 4px 0;
  color: #d1e3d7;
}

.term-viewport-content strong {
  color: #ffffff;
  font-weight: 600;
}

.term-viewport-content code {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--nature-hi);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.term-viewport-content a {
  color: var(--nature);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.term-viewport-content a:hover {
  color: var(--nature-hi);
}

.term-viewport-footer {
  background: #08120c;
  border-top: 1px solid rgba(var(--glacier-rgb), 0.15);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--faint);
}

/* ──────────────────────────────────────────────────────────────
   INTERACTIVE PRISM & CHROMATIC ABERRATION DESIGN SYSTEM
────────────────────────────────────────────────────────────── */
.prism-canvas-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 1.0;
}

.prism-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Perspective container for realistic 3D glass tilt */
.prism-perspective-wrap {
  perspective: 1200px;
}

/* Prism Card with multi-layered glassmorphism, dynamic spotlight and chromatic edge */
.prism-card,
.project-card.prism-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --chroma-offset: 3px;
  position: relative;
  background: rgba(6, 14, 9, 0.94) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.28) !important;
  box-shadow: 
    0 22px 50px -10px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(var(--accent-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8);
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) !important;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
  overflow: visible;
}

body.light .prism-card,
body.light .project-card.prism-card {
  background: #ffffff !important;
  border: 1px solid #cce0d3 !important;
  box-shadow: 
    0 14px 34px -8px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(var(--accent-dim-rgb), 0.04),
    inset 0 1px 0 #ffffff !important;
}

/* 1. Dynamic Cursor Spotlight (Nature Dew / Forest Canopy Light Cone) */
.prism-card::before,
.project-card.prism-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(var(--accent-rgb), 0.26) 0%,
    rgba(var(--glacier-rgb), 0.16) 28%,
    rgba(var(--sprout-rgb), 0.08) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.25s ease;
  opacity: 0.9;
}

body.light .prism-card::before,
body.light .project-card.prism-card::before {
  background: radial-gradient(
    800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(var(--accent-dim-rgb), 0.06) 0%,
    transparent 65%
  );
}

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

/* 2. Chromatic Aberration & Spectral Emerald Sheen at Bevel Edges - Pure Nature */
.prism-card::after,
.project-card.prism-card::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  bottom: -1.5px !important;
  left: -1.5px !important;
  right: -1.5px !important;
  height: auto !important;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    calc(115deg + var(--tilt-y) * 4),
    rgba(var(--accent-dim-rgb), 0.9) 0%,
    rgba(var(--accent-rgb), 1.0) 25%,
    rgba(var(--glacier-rgb), 0.95) 50%,
    rgba(var(--sprout-rgb), 0.9) 75%,
    rgba(var(--accent-hi-rgb), 0.85) 100%
  ) !important;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  opacity: 0.65;
  transform: none !important;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.prism-card:hover::after,
.project-card.prism-card:hover::after {
  opacity: 1.0;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.75)) drop-shadow(0 0 18px rgba(var(--glacier-rgb), 0.45));
}

.prism-card-inner {
  position: relative;
  z-index: 3;
  transform: translateZ(20px);
  transform-style: preserve-3d;
}

/* Crisp, readable title hover state with pure nature emerald highlight */
.chroma-text {
  position: relative;
  display: inline-block;
  transition: color 0.25s ease, transform 0.25s ease;
}

.prism-card:hover .chroma-text,
.project-card.prism-card:hover .chroma-text {
  color: var(--nature-hi);
  transform: translateX(2px);
}

body.light .prism-card:hover .chroma-text,
body.light .project-card.prism-card:hover .chroma-text {
  color: var(--nature-dim);
  transform: translateX(2px);
}

/* ──────────────────────────────────────────────────────────────
   HIGH-CONTRAST LIGHT MODE READABILITY REINFORCEMENTS
────────────────────────────────────────────────────────────── */
body.light {
  /* Inherit high-contrast tokens from line 66 */
}

/* Status pills across all pages */
body.light .status-thinking  { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; font-weight: 600; }
body.light .status-exploring { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; font-weight: 600; }
body.light .status-building  { background: #d1fae5; color: var(--nature-dim); border: 1px solid #a7f3d0; font-weight: 600; }
body.light .status-dropped   { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; font-weight: 600; }

/* Achievement badges */
body.light .achieve-badge.gold  { background: #e6f6ec; color: var(--nature-dim); border: 1px solid #a7f3d0; font-weight: 600; }
body.light .achieve-badge.green { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; font-weight: 600; }
body.light .achieve-badge.blue  { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; font-weight: 600; }

/* Tags, Badges & Chips */
body.light .ptag,
body.light .tag,
body.light .timeline-tag,
body.light .skill-tag {
  background: #edf5f0;
  border: 1px solid #c2dac8;
  color: #06150b;
  font-weight: 500;
}

body.light .skill-tag.amber {
  background: #e6f6ec;
  border-color: #059669;
  color: var(--nature-dim);
  font-weight: 600;
}

body.light .proj-badge {
  background: #eaf6ee;
  border: 1px solid var(--nature-dim);
  color: var(--nature-dim);
  font-weight: 600;
}

body.light .jump-pill {
  background: #ffffff;
  border: 1px solid #c8dcd0;
  color: #06150b;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.light .jump-pill:hover {
  background: #edf5f0;
  border-color: var(--nature-dim);
  color: var(--nature-dim);
}
body.light .jump-pill .pill-num {
  color: var(--nature-dim);
  font-weight: 700;
}

/* Card surfaces & text contrast in light mode */
body.light .proof-card,
body.light .toolkit-card,
body.light .timeline-item,
body.light .idea-card,
body.light .principle {
  background: #ffffff;
  border: 1px solid #c8dcd0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

body.light .proof-stat { color: var(--nature-dim); }
body.light .proof-label { color: #1f3b28; font-weight: 600; }

body.light .timeline-time { color: #2a4934; font-weight: 600; }
body.light .timeline-role { color: #06150b; }
body.light .timeline-org { color: var(--nature-dim); font-weight: 600; }
body.light .timeline-desc { color: #11281a; }

body.light .toolkit-btn {
  background: #ffffff;
  border-color: #c8dcd0;
  color: #183421;
}
body.light .toolkit-btn.active,
body.light .toolkit-btn:hover {
  background: var(--nature-dim);
  color: #ffffff;
  border-color: var(--nature-dim);
}
body.light .toolkit-card-title { color: var(--nature-dim); font-weight: 600; }
body.light .toolkit-card-list { color: #06150b; }
body.light .toolkit-card-note { color: #24412f; }

/* Body typography & deep readability */
body.light .hero-desc,
body.light .about-body,
body.light .project-desc,
body.light .field-body,
body.light .header-desc,
body.light .idea-body {
  color: #0d2415;
}

body.light .field-label {
  color: #23442e;
  font-weight: 600;
}

body.light .proj-hook {
  background: #edf5f0;
  border-left: 3px solid var(--nature-dim);
  color: #06150b;
}

body.light .project-link {
  color: var(--nature-dim);
  background: #eef7f1;
  border: 1px solid #a3d2b7;
  font-weight: 600;
}
body.light .project-link:hover {
  background: var(--nature-dim);
  color: #ffffff;
  border-color: var(--nature-dim);
  box-shadow: 0 4px 14px rgba(var(--accent-dim-rgb), 0.25);
}

body.light .repo-link {
  background: #ffffff;
  border: 1px solid #c2dac8;
  color: #06150b;
  font-weight: 600;
}
body.light .repo-link:hover {
  border-color: var(--nature-dim);
  color: var(--nature-dim);
  background: #f7faf8;
}

body.light .meta-key { color: #2d4a36; font-weight: 500; }
body.light .meta-val { color: #06150b; font-weight: 600; }

body.light .hero-eyebrow-text,
body.light .hero-role,
body.light .intro-label,
body.light .intro-count,
body.light .project-type,
body.light .repo-label,
body.light .proj-year {
  color: #24442e;
  font-weight: 500;
}

/* ──────────────────────────────────────────────────────────────
   THE 4 INTERACTIVE DESIGN SYSTEMS
────────────────────────────────────────────────────────────── */

/* 1. Kinetic Typography & Fluid Distortion */
.kinetic-text-wrap {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  will-change: transform, filter;
  transform-origin: left center;
}

.kinetic-fluid-active {
  filter: url(#kinetic-fluid-filter);
  transition: filter 0.05s ease-out;
}

/* 2. Sleek Botanical Precision Cursor */
.mag-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999999;
  display: none;
}

@media (pointer: fine) {
  .mag-cursor { display: block; }
}

.mag-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--nature);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease, background 0.2s ease;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9), 0 0 2px #fff;
  z-index: 999999;
  will-change: transform;
}

.mag-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              background 0.2s ease,
              opacity 0.2s ease;
  z-index: 999998;
  will-change: transform, width, height;
}

body.light .mag-cursor-dot {
  background: var(--nature-dim);
  box-shadow: 0 0 6px rgba(var(--accent-dim-rgb), 0.8), 0 0 1px #fff;
}

body.light .mag-cursor-ring {
  border: 1.5px solid rgba(var(--accent-dim-rgb), 0.6);
}

.mag-cursor-ring.hovering {
  border-color: var(--nature-hi);
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.35);
}

body.light .mag-cursor-ring.hovering {
  border-color: var(--nature-dim);
  background: rgba(var(--accent-dim-rgb), 0.10);
  box-shadow: 0 0 12px rgba(var(--accent-dim-rgb), 0.25);
}

/* 3. Iridescent Mesh Gradients (WebGL Canvas) */
#iridescent-mesh-canvas,
#prism-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
  transition: opacity 0.4s ease;
}

body.light #prism-hero-canvas,
body.light #hero .hero-glow {
  display: none !important;
}

body.light #iridescent-mesh-canvas {
  opacity: 0.15;
}

body.light #hero {
  background: var(--bg);
}

/* 4. Bento Grid Parallax Depth */
.bento-parallax-card {
  transform-style: preserve-3d;
  perspective: 1200px;
  will-change: transform;
}

.bento-layer-bg {
  transform: translateZ(-8px);
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}

.bento-layer-mid {
  transform: translateZ(24px);
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}

.bento-layer-fore {
  transform: translateZ(48px);
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}

/* ── PHYSICAL HARDWARE PANEL (FLAGSHIP DRONE & HIGH-TIER CARDS) ── */
.hardware-panel-card {
  position: relative;
  border: 1px solid rgba(var(--accent-rgb), 0.42) !important;
  box-shadow: 
    0 24px 60px -12px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(var(--accent-rgb), 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8) !important;
}

body.light .hardware-panel-card {
  border: 1px solid #059669 !important;
  box-shadow: 
    0 18px 44px -10px rgba(0, 0, 0, 0.08),
    0 0 24px rgba(var(--accent-dim-rgb), 0.10),
    inset 0 1px 0 #ffffff !important;
}

.hardware-panel-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(var(--accent-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.75;
}

.hardware-panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--nature);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── AVIONICS TELEMETRY & 3D GYROSCOPIC GIMBAL RETICLE ── */
.drone-avionics-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: rgba(4, 14, 8, 0.75);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 8px;
  padding: 18px 24px;
  margin: 18px 0;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

body.light .drone-avionics-telemetry {
  background: #f4faf6;
  border: 1.5px solid #8db89b;
  box-shadow: 0 4px 16px rgba(var(--accent-dim-rgb), 0.06);
}

.telemetry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telemetry-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nature);
  box-shadow: 0 0 8px var(--nature);
  animation: pulse 1.8s infinite;
}

body.light .telemetry-dot {
  background: var(--nature-dim);
  box-shadow: 0 0 6px var(--nature-dim);
}

.telemetry-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nature-hi);
}

body.light .telemetry-title {
  color: var(--nature-dim);
}

.telemetry-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--sub);
  margin: 0;
}

body.light .telemetry-desc {
  color: #0a2414;
}

.telemetry-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tel-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tel-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  color: #7da88f;
  letter-spacing: 0.05em;
}

body.light .tel-label {
  color: #355840;
}

.tel-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #f4fbf6;
}

body.light .tel-val {
  color: #041209;
}

/* 3D Gyroscopic Reticle Widget */
.hero-interactive-reticle {
  position: relative;
  width: 175px;
  height: 175px;
  border-radius: 50%;
  background: rgba(6, 16, 10, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(var(--accent-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.hero-interactive-reticle:hover {
  transform: scale(1.03);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 32px rgba(var(--accent-rgb), 0.25);
}

body.light .hero-interactive-reticle {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #8db89b;
  box-shadow: 0 12px 30px -4px rgba(var(--accent-dim-rgb), 0.12), 0 0 16px rgba(var(--accent-dim-rgb), 0.08), inset 0 1px 0 #ffffff;
}

body.light .hero-interactive-reticle:hover {
  border-color: var(--nature-dim);
  box-shadow: 0 16px 36px -4px rgba(var(--accent-dim-rgb), 0.2), 0 0 20px rgba(var(--accent-dim-rgb), 0.12);
}

.reticle-outer-ring {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(var(--accent-rgb), 0.3);
  border-radius: 50%;
  pointer-events: none;
}

body.light .reticle-outer-ring {
  border-color: rgba(var(--accent-dim-rgb), 0.35);
}

.reticle-tick {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--nature-hi);
  letter-spacing: 0.05em;
  font-weight: 600;
}

body.light .reticle-tick {
  color: var(--nature-dim);
}

.reticle-tick.t-0   { top: 2px; left: 50%; transform: translateX(-50%); }
.reticle-tick.t-90  { right: 2px; top: 50%; transform: translateY(-50%); }
.reticle-tick.t-180 { bottom: 2px; left: 50%; transform: translateX(-50%); }
.reticle-tick.t-270 { left: 2px; top: 50%; transform: translateY(-50%); }

.reticle-gimbal {
  position: relative;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 1px solid rgba(var(--glacier-rgb), 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out;
}

body.light .reticle-gimbal {
  border-color: rgba(var(--accent-dim-rgb), 0.4);
}

.reticle-crosshair {
  position: absolute;
  background: rgba(var(--glacier-rgb), 0.25);
  pointer-events: none;
}

body.light .reticle-crosshair {
  background: rgba(var(--accent-dim-rgb), 0.25);
}

.reticle-crosshair.ch-x {
  width: 100%;
  height: 1px;
}

.reticle-crosshair.ch-y {
  width: 1px;
  height: 100%;
}

.reticle-compass-needle {
  position: absolute;
  width: 2px;
  height: 52px;
  background: linear-gradient(to top, transparent, var(--glacier));
  transform-origin: center center;
  pointer-events: none;
}

body.light .reticle-compass-needle {
  background: linear-gradient(to top, transparent, var(--nature-dim));
}

.reticle-compass-needle::after {
  content: '';
  position: absolute;
  top: 0;
  left: -2.5px;
  width: 7px;
  height: 7px;
  background: var(--nature-hi);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

body.light .reticle-compass-needle::after {
  background: var(--nature-dim);
}

.reticle-center-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nature-hi);
  box-shadow: 0 0 10px var(--nature-hi);
  z-index: 2;
}

body.light .reticle-center-core {
  background: var(--nature-dim);
  box-shadow: 0 0 8px rgba(var(--accent-dim-rgb), 0.5);
}

.reticle-pulse-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--nature);
  animation: reticlePulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

body.light .reticle-pulse-ring {
  border-color: var(--nature-dim);
}

@keyframes reticlePulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.reticle-readout {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

body.light .reticle-readout {
  color: #24442e;
}

.reticle-readout-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--nature-hi);
}

body.light .reticle-readout-line {
  color: var(--nature-dim);
}

.reticle-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nature);
  box-shadow: 0 0 6px var(--nature);
}

body.light .reticle-status-dot {
  background: var(--nature-dim);
}

.reticle-coords {
  font-size: 8px;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .drone-avionics-telemetry {
    flex-direction: column-reverse;
    align-items: center;
    padding-bottom: 34px;
  }
}

/* ──────────────────────────────────────────────────────────────
   ADVANCED INTERACTION SYSTEM SUITE
   1. Cross-Window Kinetic Elasticity
   2. Infinite Non-Euclidean 3D Portals
   3. Vector-Corrosion & CSS Melting Shaders
   4. Gravitational Inertia & Decoupling
────────────────────────────────────────────────────────────── */

/* 1. Cross-Window Kinetic Physics */
#cross-window-main-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99998;
}

.term-popout-btn {
  background: rgba(var(--glacier-rgb), 0.12);
  border: 1px solid rgba(var(--glacier-rgb), 0.4);
  color: var(--glacier);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.term-popout-btn:hover {
  background: rgba(var(--accent-rgb), 0.25);
  border-color: var(--nature-hi);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3);
}

/* 2. Vector-Corrosion & CSS Melting Shaders */
.liquid-melt-target {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.15s ease-out;
  will-change: transform, filter;
  position: relative;
}

.liquid-melt-target:hover {
  filter: url(#liquid-mercury-filter);
  transform: translateY(-2px) scale(1.02);
}

/* 4. Gravitational Inertia & Decoupling */
.inertia-physics-card {
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.gravity-stress-active {
  animation: gravitySway 3s ease-in-out infinite alternate;
}

@keyframes gravitySway {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(6px) rotate(0.4deg); }
  100% { transform: translateY(2px) rotate(-0.3deg); }
}

/* ──────────────────────────────────────────────────────────────
   HERO INTERACTIVE SYSTEMS: LIGHT-MODE CONTOUR & GYRO RETICLE
────────────────────────────────────────────────────────────── */
.hero-main-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  flex: 1;
  max-width: 620px;
}

.hero-light-contour-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

body.light .hero-light-contour-canvas {
  display: block;
  opacity: 0.95;
}

/* Liquid Mercury Quicksilver Fluid Canvas (Light Mode) - Full Page Following */
.hero-mercury-canvas {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99990;
}

body.light .hero-mercury-canvas,
html.light .hero-mercury-canvas {
  display: block;
  opacity: 0.40;
}

/* ──────────────────────────────────────────────────────────────
   HERO INTERACTIVE SYSTEMS DECK (Disciplines, Benchmarks, Micro-sim)
────────────────────────────────────────────────────────────── */
.hero-systems-deck {
  width: 100%;
  max-width: 440px;
  background: rgba(6, 16, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(var(--accent-rgb), 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.hero-systems-deck:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 32px rgba(var(--accent-rgb), 0.16);
}

body.light .hero-systems-deck {
  background: #ffffff;
  border: 1.5px solid #8db89b;
  box-shadow: 0 16px 36px -6px rgba(var(--accent-dim-rgb), 0.14), 0 2px 8px rgba(var(--accent-dim-rgb), 0.06);
}

body.light .hero-systems-deck:hover {
  border-color: var(--nature-dim);
  box-shadow: 0 20px 44px -6px rgba(var(--accent-dim-rgb), 0.22), 0 4px 14px rgba(var(--accent-dim-rgb), 0.1);
}

.deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
  padding-bottom: 10px;
}

body.light .deck-header {
  border-bottom-color: rgba(var(--accent-dim-rgb), 0.15);
}

.deck-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nature);
  box-shadow: 0 0 8px var(--nature);
  animation: pulse 2s infinite;
}

body.light .deck-beacon {
  background: var(--nature-dim);
  box-shadow: 0 0 6px var(--nature-dim);
}

.deck-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nature-hi);
}

body.light .deck-title {
  color: var(--nature-dim);
}

.deck-status-chip {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a3c7b2;
  background: rgba(var(--accent-rgb), 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

body.light .deck-status-chip {
  color: var(--nature-dim);
  background: #edf4ef;
  border-color: #8db89b;
}

/* Tabs */
.deck-tabs {
  display: flex;
  gap: 6px;
  background: rgba(4, 14, 8, 0.6);
  padding: 3px;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

body.light .deck-tabs {
  background: #edf4ef;
  border-color: #c4dcd0;
}

.deck-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

body.light .deck-tab {
  color: #24442e;
}

.deck-tab:hover {
  color: #f4fbf6;
  background: rgba(var(--accent-rgb), 0.12);
}

body.light .deck-tab:hover {
  color: var(--nature-dim);
  background: rgba(var(--accent-dim-rgb), 0.08);
}

.deck-tab.active {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--nature-hi);
  font-weight: 600;
}

body.light .deck-tab.active {
  background: #ffffff;
  border-color: var(--nature-dim);
  color: var(--nature-dim);
  box-shadow: 0 1px 4px rgba(var(--accent-dim-rgb), 0.1);
}

.deck-tab-index {
  opacity: 0.65;
  font-size: 8.5px;
}

/* Panel Contents */
.deck-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deck-project-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--nature-hi);
  text-transform: uppercase;
}

body.light .deck-project-badge {
  color: var(--nature-dim);
}

.deck-project-metric {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--glacier);
  background: rgba(var(--glacier-rgb), 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(var(--glacier-rgb), 0.25);
}

body.light .deck-project-metric {
  color: #065f46;
  background: #def7ec;
  border-color: #84e1bc;
}

.deck-project-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
  margin: 0;
}

.deck-project-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--sub);
  margin: 0;
}

body.light .deck-project-desc {
  color: #0a2414;
}

/* Live Simulation Scrubber / Controls */
.deck-live-control {
  background: rgba(4, 14, 8, 0.7);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.light .deck-live-control {
  background: #f4faf6;
  border: 1px solid #b8dac7;
}

.deck-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.deck-control-label {
  color: #94a3b8;
  font-weight: 500;
}

body.light .deck-control-label {
  color: #204c2e;
}

.deck-control-val {
  color: var(--nature-hi);
  font-weight: 600;
}

body.light .deck-control-val {
  color: var(--nature-dim);
}

.deck-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.25);
  outline: none;
  cursor: pointer;
  accent-color: var(--nature);
}

body.light .deck-slider {
  background: #c8e4d3;
  accent-color: var(--nature-dim);
}

.deck-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--nature-hi);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
  border: 1.5px solid #ffffff;
}

body.light .deck-slider::-webkit-slider-thumb {
  background: var(--nature-dim);
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(var(--accent-dim-rgb), 0.4);
}

.deck-control-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #94a3b8;
  border-top: 1px dashed rgba(var(--accent-rgb), 0.15);
  padding-top: 6px;
}

body.light .deck-control-metrics {
  color: #204c2e;
  border-top-color: rgba(var(--accent-dim-rgb), 0.2);
}

.deck-control-metrics strong {
  color: var(--nature-hi);
  font-weight: 600;
}

body.light .deck-control-metrics strong {
  color: var(--nature-dim);
}

/* Spec Grid for Tabs 2 & 3 */
.deck-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(4, 14, 8, 0.7);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 6px;
  padding: 10px 12px;
}

body.light .deck-spec-grid {
  background: #f4faf6;
  border: 1px solid #b8dac7;
}

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

.deck-spec-key {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #7da88f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.light .deck-spec-key {
  color: #4b6b55;
}

.deck-spec-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #f4fbf6;
}

body.light .deck-spec-val {
  color: #041209;
}

/* Deck Tags */
.deck-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.deck-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light .deck-tag {
  color: #143820;
  background: #edf4ef;
  border-color: #b8dac7;
}

.deck-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--nature-hi);
  text-decoration: none;
  margin-top: 2px;
  transition: gap 0.2s ease, color 0.2s ease;
}

.deck-link:hover {
  color: var(--sprout);
  gap: 9px;
}

body.light .deck-link {
  color: var(--nature-dim);
}

body.light .deck-link:hover {
  color: #065f46;
}

@media (max-width: 960px) {
  .hero-main-layout {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-systems-deck {
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 24px;
  }
}

/* ──────────────────────────────────────────────────────────────
   1. CYBERNETIC SYSTEM PRELOADER & HOLOGRAPHIC GYRO
   From Uiverse.io by Nawsome
   ────────────────────────────────────────────────────────────── */
.site-preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #0a1811 0%, #040906 70%, #020503 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s ease;
  user-select: none;
  cursor: pointer;
}

body.light .site-preloader {
  background: radial-gradient(circle at center, #edf8f2 0%, #e1f0e7 70%, #d4e8dc 100%);
}

.site-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

/* From Uiverse.io by Nawsome */
.svg-frame {
  position: relative;
  width: 240px;
  height: 240px;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s ease;
}

.svg-frame svg {
  position: absolute;
  transition: .5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: calc(1 - (0.2 * var(--j)));
  transform-origin: center;
  width: 260px;
  height: 260px;
  fill: none;
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.45));
}

body.light .svg-frame svg {
  filter: drop-shadow(0 0 8px rgba(var(--accent-dim-rgb), 0.35));
}

.svg-frame:hover svg,
.svg-frame.active-tilt svg {
  transform: rotate(-80deg) skew(30deg) translateX(calc(45px * var(--i))) translateY(calc(-35px * var(--i)));
}

.svg-frame svg #center {
  transition: .5s;
  transform-origin: center;
}

.svg-frame:hover svg #center,
.svg-frame.active-tilt svg #center {
  transform: rotate(-30deg) translateX(45px) translateY(-3px);
}

#out2 {
  animation: rotate16 7s ease-in-out infinite alternate;
  transform-origin: center;
}

#out3 {
  animation: rotate16 3s ease-in-out infinite alternate;
  transform-origin: center;
  stroke: #ff0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.6));
}

body.light #out3 {
  stroke: var(--nature-dim);
  filter: drop-shadow(0 0 6px rgba(var(--accent-dim-rgb), 0.5));
}

#inner3,
#inner1 {
  animation: rotate16 4s ease-in-out infinite alternate;
  transform-origin: center;
}

#center1 {
  fill: #ff0;
  animation: rotate16 2s ease-in-out infinite alternate;
  transform-origin: center;
  filter: drop-shadow(0 0 12px rgba(255, 255, 0, 0.8));
}

body.light #center1 {
  fill: var(--nature-dim);
  filter: drop-shadow(0 0 8px rgba(var(--accent-dim-rgb), 0.6));
}

body.light .svg-frame svg [fill="#00FFFF"] {
  fill: var(--nature-dim) !important;
}

body.light .svg-frame svg [stroke="#00FFFF"] {
  stroke: var(--nature-dim) !important;
}

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

.preloader-telemetry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 320px;
  max-width: 90vw;
  font-family: var(--font-mono);
}

.preloader-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--nature-hi);
  font-weight: 600;
  text-transform: uppercase;
}

body.light .preloader-status-line {
  color: var(--nature-dim);
}

.preloader-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ffff;
  box-shadow: 0 0 10px #00ffff;
  animation: pulse 1.4s infinite;
}

body.light .preloader-pulse-dot {
  background: var(--nature-dim);
  box-shadow: 0 0 8px var(--nature-dim);
}

.preloader-progress-wrap {
  width: 100%;
  height: 3px;
  background: rgba(var(--accent-rgb), 0.18);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

body.light .preloader-progress-wrap {
  background: rgba(var(--accent-dim-rgb), 0.18);
}

.preloader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--nature), #00ffff, #ff0);
  box-shadow: 0 0 12px #00ffff;
  transition: width 0.12s ease-out;
}

body.light .preloader-bar {
  background: linear-gradient(90deg, var(--nature), var(--nature-dim));
  box-shadow: 0 0 8px var(--nature-dim);
}

.preloader-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

body.light .preloader-meta {
  color: #24442e;
}

.preloader-skip-hint {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #64748b;
  margin-top: 2px;
  animation: pulse 2s infinite;
}

body.light .preloader-skip-hint {
  color: #4b6b55;
}

/* ──────────────────────────────────────────────────────────────
   2. FLOATING ISOMETRIC SOCIAL & QUICK LINKS DOCK
   From Uiverse.io by MijailVillegas
   ────────────────────────────────────────────────────────────── */
.floating-iso-dock {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100005;
}

.iso-dock-toggle {
  display: none;
}

.floating-iso-dock .iso-card,
.floating-iso-dock .card {
  max-width: fit-content;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  gap: 0.8rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(4, 14, 8, 0.78);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  box-shadow: 
    inset 0 0 20px rgba(var(--accent-rgb), 0.12),
    inset 0 0 5px rgba(255, 255, 255, 0.15),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px 4px;
}

.floating-iso-dock .iso-card:hover,
.floating-iso-dock .card:hover {
  background: rgba(6, 20, 12, 0.9);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 
    inset 0 0 24px rgba(var(--accent-rgb), 0.2),
    inset 0 0 8px rgba(255, 255, 255, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.65);
}

body.light .floating-iso-dock .iso-card,
body.light .floating-iso-dock .card {
  background: rgba(244, 250, 246, 0.94);
  border: 1.5px solid #8db89b;
  box-shadow: 
    inset 0 0 20px rgba(var(--accent-dim-rgb), 0.08),
    inset 0 0 5px rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(var(--accent-dim-rgb), 0.12);
}

body.light .floating-iso-dock .iso-card:hover,
body.light .floating-iso-dock .card:hover {
  background: #ffffff;
  border-color: var(--nature-dim);
  box-shadow: 
    inset 0 0 20px rgba(var(--accent-dim-rgb), 0.14),
    inset 0 0 5px #ffffff,
    0 12px 28px rgba(var(--accent-dim-rgb), 0.18);
}

.floating-iso-dock ul {
  padding: 0.5rem 0.6rem;
  display: flex;
  list-style: none;
  gap: 1.15rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 0;
}

.floating-iso-dock ul li {
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-iso-dock .svg {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 10px;
  height: 46px;
  width: 46px;
  border-radius: 50%;
  color: var(--nature-hi);
  fill: currentColor;
  background: rgba(6, 20, 12, 0.92);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  box-shadow: 
    inset 0 0 16px rgba(var(--accent-rgb), 0.25),
    inset 0 0 5px rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

body.light .floating-iso-dock .svg {
  color: var(--nature-dim);
  background: #ffffff;
  border: 1px solid #8db89b;
  box-shadow: 
    inset 0 0 12px rgba(var(--accent-dim-rgb), 0.1),
    inset 0 0 5px rgba(255, 255, 255, 0.9),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.floating-iso-dock .text {
  opacity: 0;
  pointer-events: none;
  border-radius: 6px;
  padding: 5px 11px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f4fbf6;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  background: rgba(4, 16, 9, 0.95);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  position: absolute;
  right: calc(100% + 14px);
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 
    -4px 0 12px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(var(--accent-rgb), 0.18);
  transform: translateX(12px) skew(4deg);
}

body.light .floating-iso-dock .text {
  color: #041209;
  background: #ffffff;
  border: 1.5px solid var(--nature-dim);
  box-shadow: 
    -4px 0 12px rgba(var(--accent-dim-rgb), 0.12),
    inset 0 0 8px rgba(var(--accent-dim-rgb), 0.08);
}

/* Isometric projection hover physics (Uiverse MijailVillegas) */
.iso-pro {
  transition: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.iso-pro:hover a > .svg {
  transform: translate(-10px, -10px);
  color: #00ffff;
  border-color: #00ffff;
  box-shadow: 
    inset 0 0 20px rgba(0, 255, 255, 0.45),
    inset 0 0 6px rgba(255, 255, 255, 0.6),
    0 10px 22px rgba(0, 0, 0, 0.55);
}

body.light .iso-pro:hover a > .svg {
  color: var(--nature-dim);
  border-color: var(--nature-dim);
  box-shadow: 
    inset 0 0 16px rgba(var(--accent-dim-rgb), 0.25),
    inset 0 0 6px #ffffff,
    0 8px 18px rgba(var(--accent-dim-rgb), 0.18);
}

.iso-pro:hover .text {
  opacity: 1;
  transform: translateX(0) skew(-4deg);
}

.iso-pro span {
  opacity: 0;
  position: absolute;
  border-radius: 50%;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  height: 46px;
  width: 46px;
  pointer-events: none;
  border: 1px solid var(--nature);
  box-shadow: 
    inset 0 0 16px rgba(var(--accent-rgb), 0.35),
    inset 0 0 5px rgba(255, 255, 255, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.25);
}

body.light .iso-pro span {
  border-color: var(--nature-dim);
  box-shadow: 
    inset 0 0 12px rgba(var(--accent-dim-rgb), 0.2),
    inset 0 0 4px rgba(255, 255, 255, 0.7),
    0 3px 6px rgba(var(--accent-dim-rgb), 0.1);
}

.iso-pro:hover span {
  opacity: 1;
}

.iso-pro:hover span:nth-child(1) {
  opacity: 0.25;
  transform: translate(-3px, -3px);
}

.iso-pro:hover span:nth-child(2) {
  opacity: 0.5;
  transform: translate(-6px, -6px);
}

.iso-pro:hover span:nth-child(3) {
  opacity: 0.75;
  transform: translate(-9px, -9px);
}

/* ── MOBILE / TOUCH COMPACT QUICK-CONNECT FAB (Compresses into a single corner icon <= 960px) ── */
@media (max-width: 960px) {
  .floating-iso-dock {
    position: fixed !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 48px !important;
    height: 48px !important;
    z-index: 100005 !important;
    display: block !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Single floating action trigger button */
  .iso-dock-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(6, 18, 11, 0.94);
    border: 1.5px solid rgba(var(--accent-rgb), 0.5);
    color: var(--nature);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 16px rgba(var(--accent-rgb), 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    pointer-events: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2 !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
  }

  body.light .iso-dock-toggle {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(var(--accent-rgb), 0.55);
    color: var(--nature);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 2px 12px rgba(var(--accent-rgb), 0.25);
  }

  .iso-dock-toggle:active {
    transform: scale(0.92);
  }

  .iso-dock-toggle .iso-icon-close {
    display: none !important;
  }

  .floating-iso-dock.is-open .iso-dock-toggle {
    background: var(--nature);
    color: #ffffff;
    border-color: var(--nature);
    box-shadow: 0 12px 32px rgba(var(--accent-rgb), 0.5);
  }

  body.light .floating-iso-dock.is-open .iso-dock-toggle {
    background: var(--nature);
    color: #ffffff;
    border-color: var(--nature);
  }

  .floating-iso-dock.is-open .iso-icon-connect {
    display: none !important;
  }

  .floating-iso-dock.is-open .iso-icon-close {
    display: block !important;
  }

  /* Expandable speed-dial card: positioned right above the FAB button */
  .floating-iso-dock .iso-card,
  .floating-iso-dock .card {
    position: absolute !important;
    right: 0 !important;
    bottom: 58px !important;
    top: auto !important;
    left: auto !important;
    max-width: fit-content !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(14px) scale(0.88) !important;
    transform-origin: bottom right;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s !important;
    margin: 0 !important;
    border-radius: 22px !important;
    padding: 6px 4px !important;
    background: rgba(6, 18, 11, 0.96) !important;
    border: 1.5px solid rgba(var(--accent-rgb), 0.45) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.75), 0 0 24px rgba(var(--accent-rgb), 0.2) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    z-index: 1 !important;
  }

  body.light .floating-iso-dock .iso-card,
  body.light .floating-iso-dock .card {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(var(--accent-rgb), 0.45) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 2px 14px rgba(var(--accent-rgb), 0.2) !important;
  }

  .floating-iso-dock.is-open .iso-card,
  .floating-iso-dock.is-open .card {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) scale(1) !important;
  }

  .floating-iso-dock ul {
    padding: 0.35rem 0.25rem !important;
    gap: 0.65rem !important;
    list-style: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .floating-iso-dock .svg,
  .iso-pro span {
    height: 44px !important;
    width: 44px !important;
    padding: 9px !important;
  }

  .floating-iso-dock .text {
    font-size: 11px !important;
    padding: 4px 10px !important;
    right: calc(100% + 12px) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease !important;
  }

  .floating-iso-dock.is-open .iso-pro:hover .text,
  .floating-iso-dock.is-open .iso-pro:active .text {
    opacity: 1 !important;
  }
}

@media (max-width: 480px) {
  .floating-iso-dock {
    right: calc(12px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    width: 46px !important;
    height: 46px !important;
  }
  .iso-dock-toggle {
    width: 46px !important;
    height: 46px !important;
  }
  .floating-iso-dock .iso-card,
  .floating-iso-dock .card {
    bottom: 54px !important;
  }
}

/* ── 3D CREDENTIALS VAULT WALLET (From Uiverse.io by byllzz, adapted for Justin's Portfolio) ── */
.credentials-vault-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 36px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: visible;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.credentials-vault-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6), 0 0 25px rgba(var(--accent-rgb), 0.08);
}

body.light .credentials-vault-card {
  background: #ffffff;
  border: 1px solid #cce3d4;
  box-shadow: 0 10px 30px -8px rgba(var(--accent-dim-rgb), 0.07);
}

body.light .credentials-vault-card:hover {
  border-color: #059669;
  box-shadow: 0 16px 36px -8px rgba(var(--accent-dim-rgb), 0.12);
}

.vault-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vault-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

body.light .vault-badge {
  background: #e6f6ec;
  border-color: #a7f3d0;
  color: var(--nature-dim);
}

.vault-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nature);
  box-shadow: 0 0 8px var(--nature);
  animation: pulse 1.8s infinite;
}

body.light .vault-live-dot {
  background: var(--nature-dim);
  box-shadow: 0 0 6px var(--nature-dim);
}

.vault-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.vault-title em {
  font-style: italic;
  color: var(--gold);
}

.vault-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--sub);
  margin: 0;
  max-width: 490px;
}

body.light .vault-desc {
  color: #3b5043;
}

.vault-actions-hint {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.vault-hint-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  padding: 3px 8px;
  border-radius: 4px;
}

body.light .vault-hint-chip {
  background: rgba(var(--accent-dim-rgb), 0.05);
  border-color: #a7f3d0;
  color: var(--nature-dim);
}

.vault-interactive-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 20px 20px;
  position: relative;
}

/* Wallet Wrapper */
.vault-wallet {
  position: relative;
  width: 280px;
  height: 230px;
  cursor: pointer;
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vault-wallet::after {
  content: "Hover to reveal credentials";
  position: absolute;
  bottom: -28px;
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.85;
  transition: opacity 0.3s;
  white-space: nowrap;
}

body.light .vault-wallet::after {
  color: var(--nature-dim);
}

.vault-wallet:hover::after {
  opacity: 1;
  content: "Click card to verify certificate ↗";
}

@keyframes vaultSlideIntoPocket {
  0% {
    transform: translateY(-90px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.vault-wallet-back {
  position: absolute;
  bottom: 0;
  width: 280px;
  height: 200px;
  background: #0d1a10;
  border-radius: 22px 22px 60px 60px;
  z-index: 5;
  box-shadow:
    inset 0 25px 35px rgba(0, 0, 0, 0.6),
    inset 0 5px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

body.light .vault-wallet-back {
  background: #1b3823;
  border: 1px solid rgba(var(--accent-dim-rgb), 0.3);
  box-shadow:
    inset 0 20px 30px rgba(0, 0, 0, 0.35),
    inset 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Cards */
.vault-card {
  position: absolute;
  width: 260px;
  height: 140px;
  left: 10px;
  border-radius: 16px;
  padding: 16px 18px;
  color: #ffffff;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 -4px 15px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    z-index 0s;
  animation: vaultSlideIntoPocket 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  user-select: none;
  cursor: pointer;
}

.vault-card-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.vault-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vault-chip {
  width: 32px;
  height: 24px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.45), rgba(255, 255, 255, 0.2));
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.vault-chip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.25);
}

.vault-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.vault-label {
  font-family: var(--font-mono);
  font-size: 8px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  display: block;
}

.vault-value {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.vault-card-number-wrapper {
  text-align: right;
  font-family: var(--font-mono);
}

.vault-hidden-stars {
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.vault-card-number {
  display: none;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #ffffff;
}

/* Card variants */
.vault-card.card-sih {
  background: linear-gradient(135deg, #094024 0%, #157347 100%);
  border: 1px solid rgba(var(--accent-hi-rgb), 0.35);
  bottom: 90px;
  z-index: 10;
  animation-delay: 0.1s;
}

.vault-card.card-vibefest {
  background: linear-gradient(135deg, #3730a3 0%, #6366f1 100%);
  border: 1px solid rgba(165, 180, 252, 0.35);
  bottom: 65px;
  z-index: 20;
  animation-delay: 0.2s;
}

.vault-card.card-birac {
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  bottom: 40px;
  z-index: 30;
  animation-delay: 0.3s;
}

.vault-card.card-birac .vault-card-top span {
  color: #fbbf24;
}

/* Pocket */
.vault-pocket {
  position: absolute;
  bottom: 0;
  width: 280px;
  height: 160px;
  z-index: 40;
  filter: drop-shadow(0 15px 25px rgba(0, 20, 10, 0.5));
}

.vault-pocket-svg {
  width: 100%;
  height: 100%;
}

.vault-pocket-bg {
  fill: #112215;
  transition: fill 0.3s;
}

body.light .vault-pocket-bg {
  fill: #1b3823;
}

.vault-pocket-stitch {
  stroke: var(--nature);
  opacity: 0.55;
}

body.light .vault-pocket-stitch {
  stroke: var(--nature-hi);
  opacity: 0.7;
}

.vault-pocket-content {
  position: absolute;
  top: 40px;
  width: 100%;
  text-align: center;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.vault-balance-stars {
  color: var(--nature-hi);
  font-size: 22px;
  letter-spacing: 4px;
  transition: opacity 0.3s, transform 0.3s;
  font-family: var(--font-mono);
  font-weight: 700;
}

.vault-balance-real {
  color: #6ee7b7;
  font-size: 19px;
  font-weight: 700;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 10px);
  transition: opacity 0.3s, transform 0.3s;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  white-space: nowrap;
}

.vault-pocket-sub {
  color: #9cd3b4;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* Eye Logic */
.vault-eye-icon-wrapper {
  margin-top: 6px;
  height: 20px;
  width: 20px;
  position: relative;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.vault-eye-icon {
  position: absolute;
  top: 0;
  left: 0;
  stroke: var(--nature);
  transition: opacity 0.3s;
}

body.light .vault-eye-icon {
  stroke: var(--nature-hi);
}

/* Hover Physics */
.vault-wallet:hover {
  transform: translateY(-5px);
}

.vault-wallet:hover .vault-eye-icon-wrapper {
  opacity: 1;
}

.vault-wallet:hover .card-sih {
  transform: translateY(-75px) rotate(-3deg);
}

.vault-wallet:hover .card-vibefest {
  transform: translateY(-45px) rotate(2deg);
}

.vault-wallet:hover .card-birac {
  transform: translateY(-20px) rotate(-1deg);
}

.vault-wallet:hover .vault-balance-stars {
  opacity: 0;
  transform: translateY(-10px);
}

.vault-wallet:hover .vault-balance-real {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vault-wallet:hover .vault-card-number {
  display: inline;
}

.vault-wallet:hover .vault-hidden-stars {
  display: none;
}

.vault-wallet:hover .vault-eye-slash {
  opacity: 0;
}

.vault-wallet:hover .vault-eye-open {
  opacity: 1;
}

/* Second hover effect: individual card focus */
.vault-wallet .card-sih:hover {
  transform: translateY(-118px) rotate(0deg) scale(1.05) !important;
  z-index: 100 !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--accent-rgb), 0.4);
}

.vault-wallet .card-vibefest:hover {
  transform: translateY(-98px) rotate(0deg) scale(1.05) !important;
  z-index: 100 !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.4);
}

.vault-wallet .card-birac:hover {
  transform: translateY(-78px) rotate(0deg) scale(1.05) !important;
  z-index: 100 !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.4);
}

@media (max-width: 860px) {
  .credentials-vault-card {
    grid-template-columns: 1fr;
    padding: 28px 24px 36px;
    gap: 24px;
  }
  .vault-interactive-zone {
    padding-top: 15px;
  }
}

/* ── 3D CYCLIC PHOTO DECK (From Uiverse.io by ilkhoeri, customized for Justin Mathew) ── */
.about-avatar-deck {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.photo-deck-wrap {
  position: relative;
  width: 280px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  --w-card: 165px;
  --h-card: 220px;
  --rotate-card: 14deg;
  --insetX-card: 24px;
  --t-card: 18px;
  --w-wrap-card: 280px;
  user-select: none;
}

.photo-deck-card {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  overflow: hidden;
  animation: photoRotating 9s cubic-bezier(0.75, 0, 0, 1.01) infinite 0s;
  border-radius: 16px;
  background: #0d1a10;
  width: var(--w-card);
  height: var(--h-card);
  border: 1.5px solid rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  --pd: 3px;
  --round: 16px;
  --x1: var(--insetX-card);
  --x2: calc(var(--w-wrap-card) - calc(var(--w-card) + var(--insetX-card)));
  --to-left: rotate(calc(var(--rotate-card) * -1));
  --to-center: calc(calc(var(--w-wrap-card) - var(--w-card)) / 2);
  --to-right: rotate(calc(var(--rotate-card) * 1));
}

body.light .photo-deck-card {
  background: #f0fdf4;
  border-color: rgba(5, 150, 105, 0.45);
  box-shadow: 0 10px 24px rgba(var(--accent-dim-rgb), 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.photo-deck-wrap:hover .photo-deck-card {
  animation-play-state: paused;
}

.photo-deck-card:hover {
  border-color: var(--nature-hi);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(var(--accent-rgb), 0.35);
}

body.light .photo-deck-card:hover {
  border-color: #059669;
  box-shadow: 0 14px 30px rgba(var(--accent-dim-rgb), 0.25);
}

/* Card cyclic keyframe coordinates */
.photo-deck-card:nth-child(1) {
  --z1: 3; --t1: 0; --l1: var(--to-center); --trans1: rotate(0deg);
  --z2: 1; --t2: var(--t-card); --l2: var(--x1); --trans2: var(--to-left);
  --z3: 1; --t3: var(--t-card); --l3: var(--x2); --trans3: var(--to-right);
}
.photo-deck-card:nth-child(2) {
  --z1: 1; --t1: var(--t-card); --l1: var(--x2); --trans1: var(--to-right);
  --z2: 3; --t2: 0; --l2: var(--to-center); --trans2: rotate(0deg);
  --z3: 1; --t3: var(--t-card); --l3: var(--x1); --trans3: var(--to-left);
}
.photo-deck-card:nth-child(3) {
  --z1: 1; --t1: var(--t-card); --l1: var(--x1); --trans1: var(--to-left);
  --z2: 1; --t2: var(--t-card); --l2: var(--x2); --trans2: var(--to-right);
  --z3: 3; --t3: 0; --l3: var(--to-center); --trans3: rotate(0deg);
}

@keyframes photoRotating {
  0%, 99.99% {
    z-index: var(--z1);
    top: var(--t1);
    left: var(--l1);
    transform: var(--trans1);
  }
  33.33% {
    z-index: var(--z2);
    top: var(--t2);
    left: var(--l2);
    transform: var(--trans2);
  }
  66.66% {
    z-index: var(--z3);
    top: var(--t3);
    left: var(--l3);
    transform: var(--trans3);
  }
}

/* Manual active states for click controls */
.photo-deck-wrap.manual-0 .photo-deck-card,
.photo-deck-wrap.manual-1 .photo-deck-card,
.photo-deck-wrap.manual-2 .photo-deck-card {
  animation: none !important;
}

.photo-deck-wrap.manual-0 .photo-card-1 {
  z-index: 3 !important; top: 0 !important; left: var(--to-center) !important; transform: rotate(0deg) !important;
}
.photo-deck-wrap.manual-0 .photo-card-2 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x2) !important; transform: var(--to-right) !important;
}
.photo-deck-wrap.manual-0 .photo-card-3 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x1) !important; transform: var(--to-left) !important;
}

.photo-deck-wrap.manual-1 .photo-card-1 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x1) !important; transform: var(--to-left) !important;
}
.photo-deck-wrap.manual-1 .photo-card-2 {
  z-index: 3 !important; top: 0 !important; left: var(--to-center) !important; transform: rotate(0deg) !important;
}
.photo-deck-wrap.manual-1 .photo-card-3 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x2) !important; transform: var(--to-right) !important;
}

.photo-deck-wrap.manual-2 .photo-card-1 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x2) !important; transform: var(--to-right) !important;
}
.photo-deck-wrap.manual-2 .photo-card-2 {
  z-index: 1 !important; top: var(--t-card) !important; left: var(--x1) !important; transform: var(--to-left) !important;
}
.photo-deck-wrap.manual-2 .photo-card-3 {
  z-index: 3 !important; top: 0 !important; left: var(--to-center) !important; transform: rotate(0deg) !important;
}

.photo-deck-content {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--round) - var(--pd));
}

.photo-deck-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.4s ease;
}

.photo-deck-card:hover .photo-deck-img {
  transform: scale(1.05);
}

.photo-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(7, 19, 11, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--nature-hi);
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
}

body.light .photo-badge {
  background: rgba(240, 253, 244, 0.9);
  border-color: #a7f3d0;
  color: var(--nature-dim);
}

/* Glowing baseline lines from Uiverse */
.photo-deck-lines {
  position: absolute;
  inset: auto 0 -4px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.photo-deck-line {
  position: absolute;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-deck-line:nth-child(1)::before {
  content: "";
  position: absolute;
  filter: blur(4px);
  width: 75%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--nature), transparent);
}

.photo-deck-line:nth-child(1)::after {
  content: "";
  position: absolute;
  width: 55%;
  height: 1.5px;
  background: linear-gradient(to right, transparent, var(--nature-hi), transparent);
}

body.light .photo-deck-line:nth-child(1)::before {
  background: linear-gradient(to right, transparent, #059669, transparent);
}

body.light .photo-deck-line:nth-child(1)::after {
  background: linear-gradient(to right, transparent, var(--nature), transparent);
}

/* Controls & Indicator Dots */
.photo-deck-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.photo-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.photo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
}

.photo-dot.active {
  background: var(--nature);
  box-shadow: 0 0 8px var(--nature);
  transform: scale(1.2);
}

body.light .photo-dot {
  border-color: #059669;
}

body.light .photo-dot.active {
  background: var(--nature-dim);
  box-shadow: 0 0 6px var(--nature-dim);
}

.photo-deck-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sub);
  letter-spacing: 0.04em;
  opacity: 0.8;
}

body.light .photo-deck-hint {
  color: var(--nature-dim);
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN CRAFT & UI POLISH SUITE
   1. Command Menu (⌘K Spotlight Palette)
   2. Shortcut Hints (<kbd> badges)
   3. Balanced Headlines (text-wrap: balance) & Pretty Copy
   4. Tabular Numbers (font-variant-numeric: tabular-nums)
   5. Hit Slop (Accessible 44x44px touch targets)
   6. Safe Area Insets (env safe-area support)
   7. View Transitions API (seamless root theme morphing)
   8. Continuous Corners (Squircle-smooth curves)
   9. Optimistic Toasts (Snackbar feedback)
═══════════════════════════════════════════════════════════════ */

/* ── 1. Balanced Headlines & Typographic Polish ── */
h1, h2, h3, h4, h5, h6,
.intro-h1, .hero-name, .hero-title, .project-title,
.deck-project-title, .proj-title, .proof-label,
.timeline-role, .achieve-title {
  text-wrap: balance;
}

p, .project-desc, .deck-project-desc, .intro-sub,
.field-body, .timeline-desc, .achieve-desc {
  text-wrap: pretty;
}

/* ── 2. Tabular Numbers (Jitter-free numeric alignment) ── */
.proof-stat, .deck-project-metric, .pill-num, .bg-num, .proj-num,
.reticle-coords, .timeline-time, .stat-val, .metric-value,
.term-line, .counter, code, kbd, .cmd-key, .cmd-esc-badge {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── 3. Safe Area Insets ── */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

nav.site-nav,
body > nav {
  padding-top: env(safe-area-inset-top, 0px);
}

.site-footer,
.term-dock-pill {
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

/* ── 4. Hit Slop (Accessible touch targets) ── */
#theme-btn,
#cmd-menu-btn,
.nav-hamburger,
.term-viewport-btn {
  position: relative;
  min-height: 38px;
  min-width: 38px;
}

#theme-btn::after,
#cmd-menu-btn::after,
.nav-hamburger::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* ── 5. View Transitions API ── */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 6. Command Menu Button in Navbar ── */
.cmd-trigger-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--sub);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-trigger-btn:hover {
  border-color: var(--nature);
  color: var(--nature-hi);
  background: rgba(var(--accent-rgb), 0.08);
  transform: translateY(-1px);
}

.cmd-k-icon {
  font-size: 11px;
  letter-spacing: 0.06em;
}

body.light .cmd-trigger-btn {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

body.light .cmd-trigger-btn:hover {
  background: rgba(var(--accent-dim-rgb), 0.08);
  border-color: var(--nature);
  color: var(--nature);
}

/* ── 7. Command Menu Overlay & Modal ── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 5, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cmd-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(var(--accent-rgb), 0.15);
  overflow: hidden;
  transform: scale(0.96) translateY(-8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.cmd-overlay.active .cmd-dialog {
  transform: scale(1) translateY(0);
}

body.light .cmd-dialog {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(var(--accent-dim-rgb), 0.2);
}

.cmd-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.cmd-search-icon {
  font-size: 15px;
  opacity: 0.7;
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.cmd-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.cmd-esc-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.cmd-esc-badge:hover {
  color: var(--text);
  border-color: var(--nature);
}

.cmd-results {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.cmd-category-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 10px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 2px;
}

.cmd-item:hover,
.cmd-item.selected {
  background: var(--surface-2);
  color: var(--text);
}

.cmd-item.selected {
  outline: 1px solid var(--nature);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-item-bullet {
  color: var(--nature);
  font-size: 11px;
}

.cmd-item-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.cmd-item-badge {
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--nature);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  margin-left: 6px;
  white-space: nowrap;
}

.cmd-key {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.cmd-highlight {
  color: var(--nature);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cmd-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.cmd-empty-icon {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

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

.cmd-footer-keys span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cmd-footer-keys kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--sub);
  font-size: 9.5px;
}

.cmd-footer-brand {
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* ── 8. Optimistic Action Toast ── */
.portfolio-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  background: var(--surface);
  border: 1px solid var(--nature);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}


/* ── 9. Bottom-of-Page Highlight Color Switcher ── */
.accent-picker-bar {
  width: 100%;
  max-width: var(--max-w);
  margin: 28px auto 0;
  padding: 20px var(--pad-x) 0;
  border-top: 1px solid var(--border);
}

.wrap .accent-picker-bar {
  padding-left: 0;
  padding-right: 0;
}

.accent-picker-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
}

.accent-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--sub);
}

.accent-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nature);
  box-shadow: 0 0 10px var(--nature);
  flex-shrink: 0;
}

.accent-swatches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.accent-swatch {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch-color);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.accent-swatch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 38px;
  min-height: 38px;
}

.accent-swatch:hover {
  transform: scale(1.16);
}

.accent-swatch.active {
  border-color: var(--text);
  transform: scale(1.14);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch-color);
}

.accent-custom-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accent-custom-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.accent-custom-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--sub);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.accent-custom-wrap:hover .accent-custom-btn {
  border-color: var(--nature);
  color: var(--nature);
  transform: scale(1.12);
}

.accent-picker-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.accent-hex-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--nature);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

.accent-reset-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.accent-reset-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.accent-reset-btn:hover {
  color: var(--nature);
  border-color: var(--nature);
}

@media (max-width: 640px) {
  .accent-picker-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ──────────────────────────────────────────────────────────────
   10. MOBILE & TOUCH EXPERIENCE SUITE
   Full viewport bounds, responsive modals, touch targets, and contrast
────────────────────────────────────────────────────────────── */
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative !important;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Ensure wide assets never push horizontal scroll */
img, svg, canvas, video, iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

#hero-mercury-canvas,
#cross-window-main-canvas,
.hero-mercury-canvas,
#hero-light-contour,
#prism-hero-canvas,
.prism-canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  /* Navbar Brand & Hit Targets */
  .nav-logo {
    font-size: 15px;
    letter-spacing: -0.01em;
  }

  .cmd-trigger-btn {
    padding: 6px 8px;
    font-size: 10.5px;
  }

  /* Command Menu Modal on Mobile */
  .cmd-overlay {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
  }

  .cmd-dialog {
    max-height: 84vh;
    border-radius: 12px;
    width: 100%;
  }

  .cmd-input {
    font-size: 16px; /* Prevents auto-zoom in mobile Safari */
  }

  .cmd-item {
    padding: 12px 14px;
    min-height: 44px;
  }

  .cmd-footer {
    display: none; /* Hide desktop keyboard hints on mobile devices */
  }

  /* Interactive Terminal Modal on Mobile */
  .tech-terminal-modal {
    padding: 0;
  }

  .tech-terminal-box {
    width: 100vw;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .tech-terminal-body {
    max-height: calc(100dvh - 52px);
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .tech-terminal-input,
  input.tech-terminal-input {
    font-size: 16px; /* Prevents auto-zoom on mobile focus */
  }

  /* Toast Notification */
  .portfolio-toast {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    left: 16px;
    text-align: center;
  }
}
