/* LIVRY DESIGN SYSTEM V2 // KINETIC INDUSTRIAL
   Strict 8px Grid | Archivo + Space Mono | No glassmorphism
*/

:root {
  --bg: #050505;
  --surface: #0f0f0f;
  --surface-highlight: #1a1a1a;
  --border: #333333;
  --text-main: #eaeaea;
  --text-dim: #888888;
  --accent: #ff4500;
  --accent-glow: rgba(255, 69, 0, 0.18);

  --font-head: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-head);
  line-height: 1.5;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.text-accent {
  color: var(--accent);
}

.section-title {
  font-size: 1.8rem;
}

.section-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 460px;
}

/* NAVBAR */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  padding: 8px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 900;
  font-size: 1.3rem;
}

.logo-mark {
  letter-spacing: 0.18em;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-cta-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BUTTONS */

.btn {
  background: var(--text-main);
  color: var(--bg);
  border: none;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.1s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-main);
}

.btn-primary:hover {
  box-shadow: 0 0 22px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--text-main);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.7rem;
}

.btn-xsmall {
  padding: 4px 10px;
  font-size: 0.65rem;
}

/* HERO */

.hero-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-3) var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.hero-content {
  max-width: 580px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: 3rem;
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.hero-sub {
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-bottom: var(--space-4);
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.hero-microgrid {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.micro-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* HERO VISUAL */

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at center, #111 0%, #050505 100%);
}

#stvl-map {
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zone-tag {
  position: absolute;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.7rem;
  border: 1px solid var(--accent);
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.5);
}

.map-controls {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  pointer-events: auto;
}

.map-btn {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-map-caption {
  margin-top: 12px; /* <--- ADDED */
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caption-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* HERO MICRO PILL INTERACTION  */

.hero-microgrid {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.micro-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  transition:
    border-color 0.18s,
    background 0.18s,
    color 0.18s,
    transform 0.12s,
    box-shadow 0.18s;
}

.micro-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.4);
  transform: translateY(-1px);
}

.micro-pill.is-active {
  border-color: var(--accent);
  color: var(--text-main);
  background: radial-gradient(circle at top left, rgba(255,153,0,0.25), transparent 55%);
  box-shadow: 0 0 18px rgba(255, 153, 0, 0.45);
}

/* HERO DISPLAY FRAME */

.hero-display-frame {
  position: relative;
}

.hero-display {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}

.hero-display.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Shared shell for micro-demos */

.hero-demo-shell {
  position: relative;
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top, #161616 0%, #050505 55%, #000 100%);
  overflow: hidden;
}

.hero-demo-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* HUD / caption for micro-demos */

.hero-demo-hud {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-demo-hud .caption-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent); 
}

.hero-demo-hud .caption-text {
  color: var(--text-dim);
}

/* Reset button */

.hero-reset-btn {
  position: absolute;
  right: 10px;
  top: 360px; /* 400px height - ~30px button - 10px padding */
  bottom: auto; /* Remove bottom positioning */
  z-index: 3;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition:
    opacity 0.18s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s,
    transform 0.12s;
}

/* Hide reset when in STVL mode */
.hero-display-frame[data-hero-mode="stvl"] .hero-reset-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
}

.hero-display-frame:not([data-hero-mode="stvl"]) .hero-reset-btn {
  opacity: 1;
}

.hero-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 153, 0, 0.5);
  transform: translateY(-1px);
}

/* Responsive tweak: stack hero on narrow screens */

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr; /* Stack vertically */
  }

  /* REMOVED: .hero-visual { order: -1; } 
     Removing this allows the HTML order to dictate layout:
     1. Text/Selectors
     2. Visual (Canvas)
  */
  
  .hero-visual {
    margin-top: var(--space-4); /* Add spacing between selectors and canvas */
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .section-sub {
    max-width: 100%; /* Let text fill the screen width */
  }
}


/* GENERIC SECTION HELPERS */

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.section-header {
  max-width: 1200px;
  margin: 0 auto var(--space-3);
  padding: 0 var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-2);
}

/* OS SECTION */

.os-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3) var(--space-6);
}

.os-inner {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

.os-intro {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: var(--space-3);
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.os-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3);
}

.os-card h3 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  
}

/* MODULE ENGINE */

.modules-section {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.module-groups {
  display: grid;
  gap: var(--space-4);
}

.module-group-header {
  margin-bottom: var(--space-2);
}

.module-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
}

.module-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-2);
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.module-card h4 {
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--text-main);      /* <--- Default to White */
  transition: color 0.2s ease;  /* <--- Smooth color fade */
}

/* NEW RULE */
.module-card:hover h4 {
  color: var(--accent);         /* <--- Turn Red when card is hovered */
}

.module-card p {
  color: var(--text-dim);
}

.module-card:hover {
  border-color: var(--accent);
  background: #101010;
  transform: translateY(-1px);
}

/* STVL SECTION */

.stvl-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3) var(--space-6);
}

.stvl-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-4);
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

.stvl-copy {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 580px;
}

.stvl-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.stvl-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.stvl-bullet {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  margin-top: 6px;
}

.stvl-note {
  font-size: 0.8rem;
  opacity: 0.9;
}

.stvl-mini {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stvl-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.stvl-mini-tag {
  color: var(--text-dim);
}

.stvl-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.stvl-mini-zone {
  border-radius: 2px;
  border: 1px solid #222;
  background: #060606;
  padding: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stvl-mini-zone-top {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
}

.stvl-mini-bar {
  height: 6px;
  border-radius: 999px;
  background: #111;
  overflow: hidden;
}

.stvl-mini-fill {
  height: 100%;
  width: 20%;
  background: var(--accent);
  transition: width 0.2s ease-out;
}

/* Firefly */

.firefly-panel {
  border-radius: 2px;
  border: 1px solid #222;
  background: #060606;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.firefly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.firefly-copy {
  color: var(--text-dim);
}

.firefly-screen {
  border-radius: 2px;
  border: 1px solid #111;
  height: 60px;
  background: #050505;
  transition: background 0.2s;
}

.firefly-screen.flash {
  background: var(--accent);
}

/* LIVE PREVIEW (POLL / HECKLE / DECIBEL) */

.live-preview {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-4);
  border: 1px solid var(--border);
  background: var(--surface);
}

.preview-controls {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.control-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tab-btn.active {
  color: var(--text-main);
  border-bottom-color: var(--accent);
  background: var(--surface-highlight);
}

.control-panel {
  padding: var(--space-4);
  flex-grow: 1;
}

.panel-content {
  display: none;
}

.panel-content.active {
  display: block;
  animation: fadeInstant 0.2s;
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.panel-text {
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.preview-display {
  padding: var(--space-4);
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

.screen-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  position: relative;
  background: #111;
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.screen-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* Poll visuals */
.poll-visual {
  width: 100%;
}

.poll-bar-container {
  margin-bottom: 12px;
}

.poll-label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.poll-track {
  height: 16px;
  background: #222;
  width: 100%;
  margin-top: 4px;
}

.poll-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0, 1, 0.5, 1);
}

/* Heckle feed */
.heckle-feed {
  height: 200px;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.heckle-item {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px;
  background: var(--surface-highlight);
  border-left: 2px solid var(--accent);
  animation: slideIn 0.3s ease-out;
}

/* Decibel meter */
.decibel-meter {
  height: 40px;
  background: #222;
  width: 100%;
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
}

.decibel-bar {
  height: 100%;
  background: linear-gradient(90deg, green, yellow, var(--accent));
  width: 0%;
  transition: width 0.05s linear;
}

/* DIRECTOR MODE */

.director-section {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.director-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.director-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.director-card h3 {
  margin-bottom: 8px;
}

.director-timeline {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.director-timeline span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.trigger-grid {
  margin-top: var(--space-2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trigger-btn {
  background: #111;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* USE CASES */

.usecases-section {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.usecases-strip {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.usecase-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* MONETIZATION */

.monetization-section {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.monetization-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.mon-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.mon-card h3 {
  margin-bottom: 8px;
}

/* TECH & ARCHITECTURE */

.tech-section {
  max-width: 1200px;
  margin: var(--space-8) auto var(--space-6);
  padding: 0 var(--space-3);
}

.tech-diagram {
  margin: var(--space-6) 0 var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tech-node {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.node-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.tech-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  position: relative;
}

.tech-line::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  top: -2.5px;
  left: 0;
  animation: flow 2s infinite linear;
}

.tech-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.spec p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* COMPARISON TABLE */

.compare-section {
  max-width: 1200px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-3);
}

.compare-table-wrapper {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid #222;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.compare-table thead {
  background: #111;
}

.compare-table tbody tr:nth-child(even) {
  background: #101010;
}

/* CTA SECTION */

.cta-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: var(--space-6);
  background: #060606;
}

.cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* FOOTER */

footer {
  padding: var(--space-6) 0 var(--space-4);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: var(--accent);
}

.text-right {
  text-align: right;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.footer-dot {
  box-shadow: 0 0 0 1px #1b5e20;
}

.socials {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ANIMATIONS */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes fadeInstant {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes flow {
  0% { left: 0%; }
  100% { left: 100%; }
}

/* HERO DISPLAY FIXES */
.hero-display {
  display: none;              /* ⬅ prevents canvas from measuring 0px */
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.hero-display.is-active {
  display: block;             /* ⬅ allows this demo to actually exist */
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cta-buttons .btn {
  flex: 1;             /* 1. Makes both buttons try to take up equal space */
  min-width: 220px;    /* 2. Sets a baseline width that fits the longest text */
  text-align: center;  /* 3. Centers the text (crucial now that buttons are wider) */
  display: flex;       /* 4. Ensures vertical centering of text */
  justify-content: center;
  align-items: center;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .stvl-inner {
    grid-template-columns: 1fr;
  }

  .os-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-controls {
    border-right: none;
  }

  .tech-diagram {
    flex-direction: column;
    gap: 20px;
  }

  .tech-line {
    width: 1px;
    height: 50px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .text-right {
    text-align: left;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* MOBILE MENU STYLES */
.mobile-toggle {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.98);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2rem;
  cursor: pointer;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: center;
}

.mobile-link {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
}

/* RESPONSIVE TOGGLES */
@media (max-width: 900px) {
  .nav-links.desktop-only,
  .nav-cta-group.desktop-only {
    display: none;
  }
  
  .mobile-toggle {
    display: block;
  }
}

/* SCROLL OFFSET FIX */
html {
  scroll-behavior: smooth; /* Optional: makes the jump feel nicer */
}

/* Applies to any section with an ID (like #modules, #stvl).
   80px accounts for Header Height (~60px) + Breathing Room (20px).
*/
section[id] {
  scroll-margin-top: 80px; 
}

/* Mobile specific adjustment if header is smaller/larger on phone */
@media (max-width: 768px) {
  section[id] {
    scroll-margin-top: 70px;
  }
}
