/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  --bg-root: #090d16;
  --bg-card: rgba(16, 24, 39, 0.75);
  --bg-card-hover: rgba(22, 33, 54, 0.85);
  --bg-elevated: #0d1525;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.3);
  --border-glow: rgba(56, 189, 248, 0.15);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-teal: #2dd4bf;
  --accent-emerald: #34d399;
  --accent-blue: #3b82f6;

  --font-sans: var(--xt-text);
  --font-mono: var(--xt-mono);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Dynamic background canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(9, 13, 22, 0.8);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-symbol {
  color: var(--accent-cyan);
  font-size: 1.25rem;
  animation: rotateGear 16s linear infinite;
  display: inline-block;
}

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

.accent-dot {
  color: var(--accent-cyan);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.05rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-cyan);
}

.nav-btn {
  text-decoration: none;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  background: var(--accent-cyan);
  color: #030712;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.75rem;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.hero-title {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-teal) 50%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 780px;
  line-height: 1.7;
  margin-bottom: 2.2rem;
  font-family: var(--xt-text);
}

/* Intro text beside the JM3.5 showcase on wide screens (video : text ≈ 2 : 1); stacked, text first, below 960 px */
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 2.2rem;
}

.hero-row > .hero-subtitle {
  margin-bottom: 0;
}

@media (min-width: 960px) {
  .hero-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    column-gap: 2.2rem;
    align-items: start;
  }
  .hero-row > .embedded-showcase {
    grid-column: 1;
    grid-row: 1;
  }
  .hero-row > .hero-subtitle {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    font-size: 1.1rem;
  }
}

.code-tag {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #040914;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   Sections General
   ========================================================================== */
.section {
  padding: 5.5rem 0;
  position: relative;
}

.bg-elevated {
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
}

/* ==========================================================================
   Embedded Live Simulator Showcase
   ========================================================================== */
.embedded-showcase {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 25px var(--border-glow);
}

.embed-topbar {
  background: #060a12;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.embed-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.embed-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.embed-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

.embed-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.embed-btn:hover {
  background: var(--accent-cyan);
  color: #030712;
}

.embed-frame-wrapper {
  width: 100%;
  height: 600px;
  background: #0b0f19;
  position: relative;
}

@media (max-width: 768px) {
  .embed-frame-wrapper {
    height: 720px;
  }
}

/* ==========================================================================
   Project Grid & Cards
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.65rem;
}

.grid-subhead {
  grid-column: 1 / -1;
  margin-top: 2.5rem;
}

/* ==========================================================================
   Technical Design Project Folder (#technical-design)
   ========================================================================== */
.tech-folder {
  background: rgba(9, 14, 24, 0.72);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 24px rgba(56, 189, 248, 0.08);
  overflow: hidden;
}

.tech-folder-header {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.4rem;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14) 0%, rgba(16, 24, 39, 0.95) 60%);
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}

.tech-folder:not([open]) .tech-folder-header {
  border-bottom: none;
}

.tech-folder-header::-webkit-details-marker {
  display: none;
}

.tech-folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.folder-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 9999px;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--accent-teal);
}

.tech-folder-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.folder-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

.tech-folder:not([open]) .folder-chevron {
  transform: rotate(-90deg);
}

.tech-folder-body {
  padding: 1.35rem 1.4rem 1.6rem;
}

.tech-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.45rem;
}

.projects-grid + .grid-subhead {
  margin: 3rem 0 1.25rem;
}

@media (max-width: 640px) {
  .tech-folder-body { padding: 1rem 0 1.25rem; }
}

/* ==========================================================================
   Vertical Tab Deck (.tab-deck)
   Project titles as a list on the left, the selected card on the right.
   Below 700 px the same markup is an accordion: the card opens under its title.
   main.js builds the tab buttons from each card's serial code and title
   (breakpoint mirrored there as deckMq); the code then shows on the tab only,
   not again on the card. Scoped to html.js (inline script in
   <head>): without JavaScript the cards stay the plain grid of their container.
   ========================================================================== */
.js .tab-deck {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  /* one auto row per title, the last row takes whatever the card needs beyond the list */
  grid-template-rows: repeat(var(--n, 7), auto) 1fr;
  gap: 0.45rem 1.6rem;
  align-items: start;
}

.js .tab-deck > .deck-tab { grid-column: 1; }

.js .tab-deck > .project-card {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
}

/* All cards share one grid cell, the hidden ones stay invisible there: the panel keeps
   the height of the tallest card, so switching tabs never moves the page below. */
.js .tab-deck > .project-card:not(.is-active) {
  visibility: hidden;
  pointer-events: none;
}

.js .tab-deck > .project-card.is-active { animation: deckIn 0.28s ease both; }

.js .tab-deck .card-serial-strip {
  flex-wrap: wrap;
  row-gap: 6px;
}

/* The tab already carries the serial code; main.js still reads it from here. */
.js .tab-deck .card-serial-strip > .serial-code { display: none; }

@keyframes deckIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.deck-tab {
  --card-accent: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 58px;
  padding: 0.55rem 0.75rem 0.55rem 0.85rem;
  text-align: left;
  font: inherit;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.deck-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.055);
}

.deck-tab.is-active {
  color: var(--text-primary);
  background: linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 16%, transparent), rgba(255, 255, 255, 0.03));
  border-color: color-mix(in srgb, var(--card-accent) 45%, transparent);
  border-left-color: var(--card-accent);
}

.deck-tab:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.deck-tab-no {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1.4rem;
}

.deck-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.deck-tab-code {
  font-family: var(--xt-small);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-tab-title {
  font-family: var(--xt-sub);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.deck-tab-chev {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.5;
  transition: transform var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}

.deck-tab.is-active .deck-tab-no,
.deck-tab.is-active .deck-tab-chev {
  color: var(--card-accent);
  opacity: 1;
}

/* Wide screens: the selected card lies on its side, picture left, text right */
@media (min-width: 1100px) {
  .js .tab-deck > .project-card { flex-direction: row; }
  .js .tab-deck > .project-card > .project-media {
    flex: 0 0 42%;
    height: auto;
    min-height: 280px;
  }
  .js .tab-deck > .project-card > .project-media.has-art::after {
    inset: 0 0 0 auto;
    width: 64px;
    height: auto;
    background: linear-gradient(90deg, transparent 0%, rgba(8, 12, 23, 0.96) 100%);
  }
  .js .tab-deck > .project-card > .project-content { padding: 1.4rem 1.6rem 1.5rem 1.1rem; }
}

@media (max-width: 1099px) {
  .js .tab-deck { grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); column-gap: 1.2rem; }
}

/* Phones: accordion, every title in one column, the open card right under its title */
@media (max-width: 699px) {
  .js .tab-deck {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 0.5rem;
  }
  .js .tab-deck > .deck-tab,
  .js .tab-deck > .project-card {
    grid-column: auto;
    grid-row: auto;
  }
  .js .tab-deck > .project-card { margin-bottom: 0.6rem; }
  .js .tab-deck > .project-card:not(.is-active) { display: none; }
  .deck-tab { min-height: 60px; }
  .deck-tab.is-active .deck-tab-chev { transform: rotate(90deg); }
}

@media (max-width: 640px) {
  .js .tech-folder-body > .tab-deck { margin-inline: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .tab-deck > .project-card.is-active { animation: none; }
}

/* ==========================================================================
   Lively 3D Collector Cards (Seven Principles Studio Inspired)
   ========================================================================== */
.project-card {
  --card-accent: #38bdf8;
  --card-sec: #8b5cf6;
  --mx: 50%;
  --my: 50%;
  --hyp: 0;
  --foil-angle: 132deg;
  --pan-x: 0px;
  --pan-y: 0px;

  position: relative;
  background: linear-gradient(155deg, rgba(16, 23, 41, 0.90) 0%, rgba(8, 12, 23, 0.97) 100%);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(212, 175, 55, 0.24);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
  box-shadow:
    0 14px 34px -8px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--card-accent) 55%, #d4af37 45%);
  box-shadow:
    0 24px 48px -10px rgba(0, 0, 0, 0.8),
    0 0 32px color-mix(in srgb, var(--card-accent) 22%, transparent),
    0 0 0 1px rgba(212, 175, 55, 0.35) inset;
}

.card-filigree-frame {
  position: absolute;
  inset: 7px;
  border-radius: 13px;
  border: 1px solid rgba(212, 175, 55, 0.30);
  z-index: 8;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.28s ease, border-color 0.28s ease;
}

.project-card:hover .card-filigree-frame {
  opacity: 1;
  border-color: rgba(212, 175, 55, 0.58);
}

.cf-c {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(212, 175, 55, 0.72);
}

.cf-tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.cf-tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.cf-bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.cf-br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }

.card-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background-image:
    linear-gradient(
      var(--foil-angle, 132deg),
      transparent 16%,
      rgba(139, 92, 246, 0.16) 36%,
      color-mix(in srgb, var(--card-accent) 24%, transparent) 52%,
      rgba(212, 175, 55, 0.16) 68%,
      transparent 88%
    ),
    radial-gradient(
      circle at var(--mx) var(--my),
      color-mix(in srgb, var(--card-accent) 22%, transparent) 0%,
      rgba(139, 92, 246, 0.10) 35%,
      transparent 65%
    );
  background-size: 220% 220%, 140% 140%;
  mix-blend-mode: screen;
  opacity: 0.12;
  transition: opacity 0.25s ease;
}

.card-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.65) 0.6px, transparent 1.6px),
    radial-gradient(circle at 82% 18%, rgba(212, 175, 55, 0.7) 0.7px, transparent 1.8px),
    radial-gradient(circle at 66% 58%, rgba(56, 189, 248, 0.65) 0.6px, transparent 1.6px),
    radial-gradient(circle at 28% 82%, rgba(249, 115, 22, 0.55) 0.6px, transparent 1.6px);
  background-size: 130px 130px;
  mix-blend-mode: screen;
  opacity: calc(var(--hyp, 0) * 0.42);
}

.card-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-media {
  height: 198px;
  background: radial-gradient(circle at 50% 40%, #11192e 0%, #050811 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
}

.project-media.has-art::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 54px;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 12, 23, 0.96) 100%);
  pointer-events: none;
  z-index: 4;
}

.art-scene {
  position: absolute;
  inset: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(var(--pan-x, 0px), var(--pan-y, 0px), 0px) scale(1.03);
  transition: transform 0.14s linear;
  z-index: 2;
}

.art-svg-bg {
  width: 100%;
  height: 100%;
  display: block;
}

.geo-spin-slow {
  animation: slowOrbitSpin 38s linear infinite;
}

.geo-spin-reverse {
  animation: slowOrbitSpinReverse 28s linear infinite;
}

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

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

.pla-carriage-anim {
  animation: plaSlide 4s ease-in-out infinite alternate;
}

@keyframes plaSlide {
  0% { transform: translateX(-28px); }
  100% { transform: translateX(28px); }
}

.card-serial-strip {
  position: absolute;
  top: 13px;
  left: 15px;
  right: 15px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.serial-code {
  font-family: var(--xt-small);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff3c4;
  background: rgba(6, 10, 19, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.36);
  padding: 2px 8px;
  border-radius: 99px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.preview-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}

.preview-badge {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.42);
  color: var(--accent-emerald);
  font-family: var(--xt-small);
  font-size: 0.67rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.project-content {
  position: relative;
  z-index: 5;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.7rem;
}

.card-kicker {
  font-family: var(--xt-sub);
  font-style: italic;
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.25;
  color: var(--card-accent, var(--accent-cyan));
  margin-top: 2px;
}

.card-crest-gem {
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 3px;
  transform: rotate(45deg);
  border: 1.5px solid #fff3c4;
  background: linear-gradient(135deg, var(--card-accent), var(--card-sec));
  box-shadow: 0 0 12px color-mix(in srgb, var(--card-accent) 65%, transparent);
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.project-card:hover .card-crest-gem {
  transform: rotate(135deg) scale(1.12);
  box-shadow: 0 0 16px var(--card-accent);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.tag {
  font-family: var(--xt-small);
  font-size: 0.69rem;
  background: rgba(255, 255, 255, 0.045);
  color: var(--accent-cyan);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.card-title {
  font-family: var(--xt-title);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
  line-height: 1.28;
}

.card-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.58;
  margin-bottom: 1.05rem;
  padding-left: 0.8rem;
  border-left: 2px solid color-mix(in srgb, var(--card-accent) 45%, rgba(212, 175, 55, 0.3));
  flex-grow: 1;
}

.card-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 1.05rem;
  background: rgba(6, 9, 17, 0.72);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-cell > span {
  font-family: var(--xt-small);
  font-size: 0.54rem;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-cell .m-track {
  width: 100%;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 99px;
  overflow: hidden;
}

.metric-cell .m-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--card-sec), var(--card-accent), #d4af37);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  position: relative;
  z-index: 10;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.54rem 0.92rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.card-btn.primary {
  background: color-mix(in srgb, var(--card-accent) 16%, transparent);
  color: color-mix(in srgb, var(--card-accent) 70%, #ffffff 30%);
  border: 1px solid color-mix(in srgb, var(--card-accent) 42%, transparent);
}

.card-btn.primary:hover {
  background: var(--card-accent);
  color: #050a14;
  box-shadow: 0 0 18px color-mix(in srgb, var(--card-accent) 45%, transparent);
}

.card-btn.secondary {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 175, 55, 0.4);
  color: #fff3c4;
}

/* ==========================================================================
   CSS Schematic Illustrations for Cards
   ========================================================================== */
.schematic-vis {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cycloid / Wankel Visual */
.cycloid-vis {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.cycloid-vis .vis-wankel-housing {
  width: 96px;
  height: 68px;
  border: 3px solid #38bdf8;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}
.cycloid-vis .vis-wankel-rotor {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 2px solid #2dd4bf;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform: rotate(25deg);
  background: rgba(45, 212, 191, 0.15);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.5);
}

/* CAD Studio Visual */
.cad-vis {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #1e2430 0%, #0d0f14 100%);
}
.cad-vis .vis-cad-grid {
  position: absolute;
  inset: 16px;
  background-image: linear-gradient(to right, rgba(56, 189, 248, 0.1) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(56, 189, 248, 0.1) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: 6px;
  border: 1px dashed rgba(56, 189, 248, 0.2);
}
.cad-vis .vis-cad-icon {
  font-size: 2.8rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.5));
  animation: cadSpin 16s linear infinite;
}
@keyframes cadSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* PLA-100 Linear Axis Visual */
.pla100-vis {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #0d1e33 0%, #060a12 100%);
}
.pla100-vis .vis-pla-base {
  width: 170px;
  height: 24px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
  position: relative;
}
.pla100-vis .vis-pla-screw {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 4px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #94a3b8, #94a3b8 3px, #475569 3px, #475569 6px);
  border-radius: 2px;
}
.pla100-vis .vis-pla-carriage {
  position: absolute;
  top: -8px;
  left: 58px;
  width: 54px;
  height: 40px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--xt-small);
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  animation: carriageSlide 3s ease-in-out infinite alternate;
}
@keyframes carriageSlide {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(40px); }
}


/* Technical Design Card Visual */
.tbb-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #0d2847 0%, #05101f 100%);
}
.tbb-vis .vis-tbb-badge {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  z-index: 2;
  background: rgba(14, 43, 77, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tbb-vis .vis-tbb-badge .vis-tbb-page {
  background: #b91c1c;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 900;
}
.tbb-vis .vis-tbb-symbol {
  font-size: 2.2rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.6));
  animation: tbbRotate 16s linear infinite;
}
.tbb-vis .vis-tbb-formula {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #facc15;
  z-index: 2;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(250, 204, 21, 0.4);
}
@keyframes tbbRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Engineering Graphics & Math Studio — 1967 Drafting Plate Card Visual */
.eng-plate-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 38px 12px 12px;
  width: 100%;
  height: 100%;
  background-color: #f6efe0;
  background-image:
    linear-gradient(to right, rgba(24, 23, 21, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 23, 21, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  border-bottom: 1px solid rgba(24, 23, 21, 0.16);
}
.eng-plate-vis .vis-ep-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
.eng-plate-vis .vis-ep-plate {
  background: #181715;
  color: #faf5e8;
  font-family: var(--xt-small);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.eng-plate-vis .vis-ep-std {
  background: rgba(217, 68, 38, 0.12);
  color: #a9321b;
  border: 1px solid rgba(217, 68, 38, 0.38);
  font-family: var(--xt-small);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.eng-plate-vis .vis-ep-svg {
  width: 210px;
  max-width: 92%;
  height: 62px;
  background: #fffcf4;
  border: 1px solid rgba(24, 23, 21, 0.22);
  border-radius: 7px;
  box-shadow: 0 3px 10px rgba(24, 23, 21, 0.08);
}
.eng-plate-vis .vis-ep-caption {
  font-family: var(--xt-small);
  font-size: 0.7rem;
  font-weight: 600;
  color: #4b463e;
  background: rgba(255, 252, 244, 0.88);
  border: 1px solid rgba(24, 23, 21, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

/* BeamLab Structural Visual */
.beam-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #082f49 0%, #030712 100%);
  gap: 8px;
}
.beam-vis .vis-beam-badge {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.beam-vis .vis-beam-symbol {
  font-size: 2.2rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.6));
}
.beam-vis .vis-beam-formula {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(56, 189, 248, 0.4);
}

/* City QR Visual */
.cityqr-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #030712 100%);
  gap: 8px;
  overflow: hidden;
}
.cityqr-vis .vis-cityqr-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(168, 85, 247, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.15) 1px, transparent 1px);
  background-size: 14px 14px;
}
.cityqr-vis .vis-cityqr-badge {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  z-index: 2;
}
.cityqr-vis .vis-cityqr-skyline {
  font-size: 2.3rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.75));
  animation: pulseCity 2.5s ease-in-out infinite alternate;
}
@keyframes pulseCity {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.6)); }
  100% { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.9)); }
}
.cityqr-vis .vis-cityqr-tagline {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(168, 85, 247, 0.5);
}

/* KfzDyn Visual */
.kfz-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #3b2506 0%, #030712 100%);
  gap: 8px;
  padding-top: 34px;  /* Space for top-right badge */
  overflow: hidden;
}
.kfz-vis .vis-kfz-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(245, 158, 11, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.kfz-vis .vis-kfz-badge {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  z-index: 2;
}
.kfz-vis .vis-kfz-symbol {
  font-size: 2.3rem;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.6));
}
.kfz-vis .vis-kfz-formula {
  font-family: var(--xt-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(245, 158, 11, 0.45);
}

/* Cartesian Chart Visual */
.tbb58-vis {
  padding-top: 40px;  /* Space for top-right badge */
  gap: 2px;
  overflow: hidden;
}
.tbb58-vis .vis-tbb-badge { margin-bottom: 2px; }
.tbb58-vis .vis-tbb-formula { margin-top: 2px; }
.tbb58-vis .vis-tbb58-plot {
  width: 135px;
  height: 86px;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.35));
}
.tbb58-vis .vis-tbb58-plot .ax { stroke: #cbd5e1; stroke-width: 1.5; fill: none; }
.tbb58-vis .vis-tbb58-plot .head { fill: #cbd5e1; }
.tbb58-vis .vis-tbb58-plot .curve { stroke: #f87171; stroke-width: 2.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tbb58-vis .vis-tbb58-plot .read { stroke: #facc15; stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; }
.tbb58-vis .vis-tbb58-plot .pt { fill: #05101f; stroke: #e2e8f0; stroke-width: 1.3; }
.tbb58-vis .vis-tbb58-plot .pt.a { stroke: #facc15; stroke-width: 1.8; }

/* Polar Chart Visual */
.tbb59-vis .vis-tbb58-plot .ring { stroke: #cbd5e1; stroke-width: 0.8; fill: none; opacity: 0.55; }
.tbb59-vis .vis-tbb58-plot .spoke { stroke: #cbd5e1; stroke-width: 0.6; fill: none; opacity: 0.4; }
.tbb59-vis .vis-tbb58-plot .curve { stroke-width: 2.4; }


/* ==========================================================================
   Wide Feature (pdf-toc-injector)
   ========================================================================== */
.wide-feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.wide-feature-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.feature-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.feature-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.feature-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.8rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.feature-checklist li strong {
  color: var(--text-primary);
}

.badge-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  align-self: center;
}

/* Terminal Mockup */
.wide-feature-terminal {
  background: #050811;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
}

.terminal-bar {
  padding: 0.8rem 1.2rem;
  background: #090e1a;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.t-dot.red { background: #ef4444; }
.t-dot.yellow { background: #f59e0b; }
.t-dot.green { background: #10b981; }

.t-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.6rem;
}

.terminal-body {
  padding: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #cbd5e1;
  overflow-x: auto;
}

.term-dim { color: var(--text-muted); }
.term-cyan { color: var(--accent-cyan); }
.term-green { color: var(--accent-emerald); }

/* ==========================================================================
   Dossiers Grid (Publications)
   ========================================================================== */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.dossier-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.dossier-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.dossier-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.dossier-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.dossier-subtitle {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-bottom: 0.8rem;
}

.dossier-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.dossier-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.8rem;
}

.tag-sm {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Skills Matrix
   ========================================================================== */
.skills-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.6rem;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.cat-icon {
  font-size: 1.3rem;
}

.cat-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.skill-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.skill-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-spec {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Contact Box
   ========================================================================== */
.contact-container {
  max-width: 800px;
}

.contact-box {
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.8) 0%, rgba(9, 13, 22, 0.95) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2.5rem;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--border-glow);
}

.contact-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0 1rem;
}

.contact-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.contact-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.footer-meta {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
/* Below ~1080px the nine menu items no longer fit beside the logo:
   the menu becomes a sideways-scrolling strip under it */
@media (max-width: 1100px) {
  .nav-container {
    flex-wrap: wrap;
    row-gap: 0.45rem;
    padding: 0.65rem 1rem 0.55rem;
  }
  .nav-menu {
    width: 100%;
    gap: 1.1rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.15rem 1.5rem 0.25rem 0;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }
  .nav-menu::-webkit-scrollbar {
    display: none;
  }
  .nav-btn {
    padding: 0.3rem 0.8rem;
    white-space: nowrap;
  }
  section[id] {
    scroll-margin-top: 64px;
  }
}

@media (max-width: 900px) {
  .wide-feature-card {
    grid-template-columns: 1fr;
  }
  .wide-feature-terminal {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .section {
    padding: 3.5rem 0;
  }
  .contact-box {
    padding: 2.5rem 1.5rem;
  }
}
