:root {
  /* DARK THEME (DEFAULT) */
  --bg-deep: #050508;
  --bg-card: rgba(12, 12, 18, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(51, 111, 183, 0.5);
  --text-pure: #ffffff;
  --text-primary: #f2f2f7;
  --text-muted: #828292;
  --blue-brand: #336fb7;
  --slate-brand: #6b7c96;
  --danger-red: #ef4444;
  --stealth-gold: #f59e0b;
  --matrix-green: #10b981;
  --grid-line: rgba(255, 255, 255, 0.02);
  --spotlight-color: rgba(51, 111, 183, 0.12);
  --card-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
  --pill-bg: rgba(255, 255, 255, 0.04);
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
}

/* WHITE / LIGHT THEME */
[data-theme="light"] {
  --bg-deep: #f7f8fa;
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-highlight: rgba(51, 111, 183, 0.65);
  --text-pure: #09090b;
  --text-primary: #18181b;
  --text-muted: #64748b;
  --blue-brand: #2563eb;
  --slate-brand: #475569;
  --danger-red: #dc2626;
  --stealth-gold: #d97706;
  --matrix-green: #059669;
  --grid-line: rgba(0, 0, 0, 0.035);
  --spotlight-color: rgba(37, 99, 235, 0.07);
  --card-shadow: 0 14px 38px rgba(0, 0, 0, 0.06);
  --pill-bg: rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
}

body.cyber-bg {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Technical Grid */
body.cyber-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 50% 15%, #000 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 15%, #000 65%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Cursor Spotlight */
.cursor-spotlight {
  position: fixed;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--spotlight-color) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Header & Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-aura {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
}

.nav-logo {
  width: 20px;
  height: 20px;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--text-pure);
}

.sys-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--slate-brand);
  background: var(--pill-bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--pill-bg);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: var(--text-pure);
  border-color: var(--border-highlight);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.link-num {
  color: var(--blue-brand);
  font-size: 0.7rem;
}

.nav-fail:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger-red);
}

.nav-stealth {
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--stealth-gold);
}

.nav-stealth:hover {
  border-color: rgba(245, 158, 11, 0.6);
}

.stealth-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stealth-gold);
  box-shadow: 0 0 8px var(--stealth-gold);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-highlight);
  transform: scale(1.05);
}

/* Why it works: Widens the stage to 1200px to utilize desktop screen real estate and tightens vertical hero spacing so Section 01 cards appear cleanly above the fold. */
.main-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 8px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.pulse-ring {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-brand);
  box-shadow: 0 0 10px var(--blue-brand);
}

.badge-txt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--blue-brand);
  font-weight: 600;
}

.logo-matrix-container {
  width: 100px;
  height: 100px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-matrix-container:hover {
  transform: scale(1.12);
}

.hero-master-logo {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 0 35px rgba(51, 111, 183, 0.3));
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-pure);
  line-height: 1;
  margin-bottom: 6px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--slate-brand);
  font-weight: 600;
  margin-bottom: 14px;
}

.hero-slogan {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 580px;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.tele-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tele-key { color: var(--text-muted); }
.tele-val { color: var(--text-pure); font-weight: 600; }
.tele-val.val-green { color: var(--matrix-green); }
.tele-val.val-blue { color: var(--blue-brand); }

.tele-divider {
  width: 1px;
  height: 12px;
  background: var(--border-subtle);
}

/* Section Header Labels */
.section-title-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.section-prefix {
  color: var(--blue-brand);
  font-weight: 700;
}

/* HALF-TYPE SPLIT GRID ARCHITECTURE */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.split-grid.trio-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* HALF-TYPE INTEL CARDS (ZOOM & SHINE ON CURSOR) */
.intel-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 30px 26px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: default;
  /* Hardware-accelerated zoom transition */
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
}

/* Cursor Zoom & Elevation */
.intel-card:hover {
  transform: scale(1.03) translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 25px var(--spotlight-color);
}

/* Dynamic Shine Beam that sweeps through the card on hover */
.card-glow-beam {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: skewX(-25deg);
  pointer-events: none;
  transition: left 0.75s ease;
}

.intel-card:hover .card-glow-beam {
  left: 140%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue-brand);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.card-hash {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.card-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.pillar-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.card-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure);
  margin-bottom: 12px;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 10px;
}
.card-body p:last-child {
  margin-bottom: 0;
}

/* Text Highlights */
.highlight-text {
  color: var(--text-pure);
  font-weight: 600;
}

.highlight-blue {
  color: var(--blue-brand);
  font-weight: 600;
}

/* PROJECT CARDS (DIRECT LINKS) */
.project-card {
  text-decoration: none;
  cursor: pointer;
}

.direct-link-icon {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.project-card:hover .direct-link-icon {
  transform: translate(3px, -3px);
  color: var(--blue-brand);
}

.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tech-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--pill-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Clean High-Tech Footer */
.bottom-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border-subtle);
  padding: 28px 32px;
  background: var(--bg-card);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-mono {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-nav-link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav-link:hover {
  color: var(--text-pure);
}

.dot {
  color: var(--border-subtle);
}

@media (max-width: 820px) {
  .split-grid, .split-grid.trio-grid {
    grid-template-columns: 1fr;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 18px;
  }
  .nav-menu {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-menu::-webkit-scrollbar {
    display: none;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .telemetry-bar {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  .tele-divider {
    display: none;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}