/* ==========================================================================
   AgentOffice — Cyberpunk Design System
   Shared stylesheet for all pages.
   Linked as: <link rel="stylesheet" href="css/cyberpunk.css">
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --------------------------------------------------------------------------
   1.5 TYPEFACE (self-hosted — see /fonts, keeps CSP at default-src 'self')
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-grotesk-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* Background scale */
  --bg:  #030507;
  --bg1: #07090F;
  --bg2: #0A0F18;
  --bg3: #0E1520;
  --bg4: #141E2C;

  /* Accent colors — usage tiers (issue #012/#013): pick ONE dominant accent
     per section instead of mixing all four. Intended roles:
       --neon   primary brand accent — CTAs, active nav, primary highlights.
                Default choice when in doubt.
       --neon2  narrative accent — reserved for the recursive "team of teams"
                motif (issues #004/#005). Not a general-purpose second color.
       --green  semantic success/positive status only (e.g. terminal ✓ lines).
       --amber  semantic caution/optional status only (e.g. "optional" tags).
     Existing pages predate this convention and mix accents freely — issues
     #014-#018 bring page content in line with it; tokens are unchanged so
     that work can land incrementally. */
  --neon:     #00FFE5;
  --neon-dim: rgba(0, 255, 229, .12);
  --neon2:    #FF0080;
  --green:    #00FF41;
  --amber:    #FFAB00;

  /* Text */
  --text:  #C4D8E2;
  --text2: #6090A8;
  --muted: #3A5060;

  /* Borders */
  --border:  rgba(0, 255, 229, .10);
  --border2: rgba(0, 255, 229, .22);

  /* Typography — deliberate pairing (issue #013):
       --mono  code, terminal, nav, labels, eyebrows, data/stat values.
               The "hacker" signal — kept exactly where it already worked.
       --sans  headings (h1-h6) and running prose. Space Grotesk, self-hosted
               (see @font-face above) — a display/grotesk face distinct from
               generic system-ui, giving headings contrast against the mono
               body without diluting the terminal identity. */
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Courier New', monospace;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Glows */
  --glow-sm:   0 0 8px rgba(0, 255, 229, .6);
  --glow:      0 0 15px rgba(0, 255, 229, .5), 0 0 35px rgba(0, 255, 229, .15);
  --glow-lg:   0 0 20px rgba(0, 255, 229, .7), 0 0 60px rgba(0, 255, 229, .25);
  --glow-pink: 0 0 15px rgba(255, 0, 128, .5), 0 0 35px rgba(255, 0, 128, .15);

  /* Spacing */
  --section-pad: 96px;
  --card-pad: 28px;
  --nav-h: 64px;

  /* Bento grid (issue #013 — tokens only, applied by #016/#018).
     Tiles span multiples of 1 column/row on a 4-column base grid, letting
     flagship content (2x2/2x1) sit next to secondary content (1x1) instead
     of a uniform card grid. */
  --tile-gap: 24px;

  /* Glass (issue #013 — tokens only, applied selectively by #014+).
     Blur kept inside the 10-20px practical range from the design research
     (#012) — outside it, legibility suffers on busy backgrounds. */
  --glass-blur:   14px;
  --glass-bg:     rgba(10, 15, 24, .55);
  --glass-border: rgba(0, 255, 229, .18);

  /* Motion — shared easing/duration for hover & interactive microinteractions.
     Ambient decorative animations (glitch, scan, flicker, float, reveal) are
     intentionally excluded — different purpose, tuned independently. */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --transition-fast: .2s;
  --transition-base: .25s;
}

/* --------------------------------------------------------------------------
   3. BASE BODY
   -------------------------------------------------------------------------- */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: var(--section-pad) 0;
}

/* Grid background */
.grid-bg {
  background-image:
    linear-gradient(rgba(0, 255, 229, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 229, .04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  opacity: .25;
  margin: 48px 0;
}

/* Bento grid (issue #013 — tokens/utilities only; applied to page content by
   #016/#018). 4-column base grid; tile classes span multiples of it so
   flagship items can sit larger than secondary ones instead of a uniform
   card grid. Falls back to a single column below 640px regardless of span. */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tile-gap);
}

.tile-sm { grid-column: span 1; }
.tile-md { grid-column: span 2; }
.tile-lg { grid-column: span 2; grid-row: span 2; }
.tile-xl { grid-column: span 4; }

/* Grid items default to min-width:auto, so a tile containing a .code-block's
   unbroken code lines refuses to shrink below that content's min-content
   width — forcing the whole tile (and the page) wider than the viewport
   instead of letting the code block's own overflow-x:auto scroll it
   internally (e.g. features.html's CHAINS/SCHEDULES tiles). */
.tile-sm,
.tile-md,
.tile-lg,
.tile-xl {
  min-width: 0;
}

@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .tile-sm,
  .tile-md,
  .tile-lg,
  .tile-xl {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* Glass panel (issue #013 — token-backed utility; applied selectively by
   #014+, not meant to replace the plain .card surface everywhere). */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 16px; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1rem; }

p {
  color: var(--text);
  line-height: 1.7;
}

.lead {
  color: var(--text2);
  font-size: 1.1rem;
  max-width: 560px;
  line-height: 1.75;
}

/* Eyebrow label */
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--neon);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   6. KEYFRAME ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes glitch {
  0%,
  88%,
  100% { transform: translate(0); filter: none; }
  89%  { transform: translate(-3px, 1px); }
  91%  { transform: translate(3px, -1px); filter: hue-rotate(90deg); }
  93%  { transform: translate(-2px, 2px); }
  95%  { transform: translate(2px, -2px); }
}

@keyframes neonPulse {
  0%,
  100% { box-shadow: 0 0 5px rgba(0, 255, 229, .3), 0 0 15px rgba(0, 255, 229, .1); }
  50%  { box-shadow: 0 0 15px rgba(0, 255, 229, .6), 0 0 40px rgba(0, 255, 229, .25); }
}

@keyframes scan {
  from { top: -3%; }
  to   { top: 103%; }
}

@keyframes flicker {
  0%, 94%, 96%, 98%, 100% { opacity: 1; }
  95% { opacity: .75; }
  97% { opacity: .9; }
}

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

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

@keyframes float {
  0%,  100% { transform: translateY(0); }
  50%        { transform: translateY(-8px); }
}

/* --------------------------------------------------------------------------
   7. ANIMATION UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* Scanline overlay — place inside a position:relative ancestor */
.scanline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(transparent, rgba(0, 255, 229, .07), transparent);
  animation: scan 8s linear infinite;
  pointer-events: none;
  z-index: 5;
}

/* Glitch effect — set data-text on the element */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--neon2);
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
  animation: glitch 6s .15s infinite;
  opacity: .8;
}

.glitch::after {
  color: var(--neon);
  clip-path: polygon(0 65%, 100% 65%, 100% 80%, 0 80%);
  animation: glitch 6s .3s infinite;
  opacity: .8;
}

/* Neon pulse */
.neon-pulse {
  animation: neonPulse 2.5s ease-in-out infinite;
}

/* Flicker */
.flicker {
  animation: flicker 4s linear infinite;
}

/* Float */
.float {
  animation: float 4s ease-in-out infinite;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children reveal delays — 9 slots to cover the routing pipeline's
   5 stage boxes + 4 arrows (issue #019), not just the original 6-card grid. */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: .1s; }
.stagger-children > *:nth-child(3) { transition-delay: .2s; }
.stagger-children > *:nth-child(4) { transition-delay: .3s; }
.stagger-children > *:nth-child(5) { transition-delay: .4s; }
.stagger-children > *:nth-child(6) { transition-delay: .5s; }
.stagger-children > *:nth-child(7) { transition-delay: .6s; }
.stagger-children > *:nth-child(8) { transition-delay: .7s; }
.stagger-children > *:nth-child(9) { transition-delay: .8s; }

/* --------------------------------------------------------------------------
   8. NAVIGATION
   -------------------------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(3, 5, 7, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-bracket {
  color: var(--neon);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.logo-name {
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text2);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast) var(--ease), text-shadow var(--transition-fast) var(--ease), border-color var(--transition-fast) var(--ease);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--neon);
  text-shadow: var(--glow-sm);
}

.nav-link.active {
  color: var(--neon);
  border-bottom-color: var(--neon);
}

/* Language switcher */
.lang-switch {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  border: 1px solid var(--border2);
  padding: 6px 10px;
  margin-right: 12px;
  display: inline-block;
  transition: color var(--transition-fast) var(--ease), border-color var(--transition-fast) var(--ease);
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--neon);
  border-color: var(--neon);
}

.nav-mobile .lang-switch {
  margin: 8px 32px 0;
  align-self: flex-start;
}

/* Hamburger button — visible only on mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text2);
  transition: transform var(--transition-base) var(--ease), opacity var(--transition-base) var(--ease), background var(--transition-fast) var(--ease);
}

.hamburger:hover span {
  background: var(--neon);
}

/* Mobile nav overlay */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(3, 5, 7, .97);
  border-bottom: 1px solid var(--border2);
  padding: 16px 0 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile .nav-link {
  padding: 12px 32px;
  font-size: 14px;
  border-bottom: none;
  border-left: 2px solid transparent;
  display: block;
}

.nav-mobile .nav-link.active,
.nav-mobile .nav-link:hover {
  border-left-color: var(--neon);
}

.nav-mobile .nav-cta {
  margin: 12px 32px 0;
  display: block;
  text-align: center;
}

/* Open state — toggled by main.js */
.nav-open .nav-mobile {
  display: flex;
}

/* Hamburger open-state transforms */
.nav-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .hamburger span:nth-child(2) {
  opacity: 0;
}

.nav-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   9. HERO SECTION
   -------------------------------------------------------------------------- */

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 64px;
  width: 100%;
}

.hero-left {
  flex: 1 1 0;
  min-width: 0;
}

.hero-right {
  flex: 0 0 auto;
  max-width: 460px;
  width: 100%;
}

.hero-eyebrow {
  animation: fadeInUp .6s ease both;
}

.hero-h1 {
  animation: fadeInUp .6s .1s ease both;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-lead {
  animation: fadeInUp .6s .2s ease both;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp .6s .3s ease both;
}

/* --------------------------------------------------------------------------
   10. BUTTONS
   -------------------------------------------------------------------------- */

.btn-primary {
  display: inline-block;
  background: var(--neon);
  color: #000;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 30px;
  border: none;
  cursor: pointer;
  transition: filter var(--transition-fast) var(--ease), box-shadow var(--transition-fast) var(--ease);
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.15);
  box-shadow: var(--glow);
  outline: none;
}

.btn-outline {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--neon);
  color: var(--neon);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 30px;
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease), box-shadow var(--transition-fast) var(--ease);
  text-decoration: none;
  line-height: 1;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: rgba(0, 255, 229, .08);
  box-shadow: var(--glow-sm);
  outline: none;
}

/* --------------------------------------------------------------------------
   11. CARDS
   -------------------------------------------------------------------------- */

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: var(--card-pad);
  position: relative;
  min-width: 0; /* grid/flex items default to min-width:auto — without this,
                   a card holding wide content (e.g. a .code-block) refuses
                   to shrink below that content's width, blowing out its
                   grid/flex container instead of letting the content's own
                   overflow-x:auto scroll it internally. */
  transition: border-color var(--transition-base) var(--ease), box-shadow var(--transition-base) var(--ease);
}

/* Corner bracket — top left */
.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-color: var(--neon);
  border-width: 2px;
  border-style: solid none none solid;
}

/* Corner bracket — bottom right */
.card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-color: var(--neon);
  border-width: 2px;
  border-style: none solid solid none;
}

.card:hover {
  border-color: var(--border2);
  box-shadow: 0 0 20px rgba(0, 255, 229, .10);
}

/* --------------------------------------------------------------------------
   12. CODE BLOCKS
   -------------------------------------------------------------------------- */

.code-block {
  background: #000;
  border: 1px solid var(--border2);
  border-left: 3px solid var(--neon);
  border-radius: 0;
  overflow-x: auto;
}

.code-header {
  background: var(--bg3);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.code-filename {
  color: var(--text2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
}

.copy-btn {
  color: var(--neon);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  transition: background var(--transition-fast) var(--ease);
  letter-spacing: .04em;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  background: rgba(0, 255, 229, .1);
  outline: none;
}

.code-block pre {
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  display: block;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 16px 20px;
  white-space: pre;
}

/* Syntax highlighting spans inside code blocks */
.code-block code .p  { color: var(--amber); }   /* $ prompt */
.code-block code .c  { color: var(--muted); }   /* # comment */
.code-block code .k  { color: var(--neon); }    /* keyword / flag */
.code-block code .s  { color: rgba(0, 255, 229, .7); } /* string */

/* --------------------------------------------------------------------------
   13. TERMINAL
   -------------------------------------------------------------------------- */

.terminal {
  border: 1px solid var(--border2);
  background: #000;
  overflow: hidden;
}

.terminal-bar {
  background: var(--bg3);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.red    { background: #FF5F57; }
.dot.yellow { background: #FFBD2E; }
.dot.green  { background: #28CA42; }

.term-title {
  color: var(--text2);
  font-family: var(--mono);
  font-size: 12px;
  margin-left: 8px;
  letter-spacing: .04em;
}

.terminal-body {
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  line-height: 1.7;
}

.cursor::after {
  content: '▮';
  color: var(--neon);
  animation: blink 1s step-end infinite;
}

/* --------------------------------------------------------------------------
   14. TABS
   -------------------------------------------------------------------------- */

.tabs-wrap {
  /* container — no extra padding needed */
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 24px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: color var(--transition-fast) var(--ease), border-color var(--transition-fast) var(--ease);
  flex-shrink: 0;
  margin-bottom: -1px; /* sit on top of tab-bar border */
}

.tab-btn:hover {
  color: var(--neon);
}

.tab-btn.active {
  color: var(--neon);
  border-bottom-color: var(--neon);
}

.tab-btn:focus-visible {
  outline: 1px solid var(--neon);
  outline-offset: -2px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   15. CALLOUTS
   -------------------------------------------------------------------------- */

.callout {
  padding: 14px 20px;
  margin: 20px 0;
  border-left: 3px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout-info {
  border-color: var(--neon);
  background: rgba(0, 255, 229, .05);
}

.callout-warn {
  border-color: var(--amber);
  background: rgba(255, 171, 0, .06);
}

.callout-danger {
  border-color: var(--neon2);
  background: rgba(255, 0, 128, .06);
}

.callout-icon {
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  line-height: 1;
}

.callout-body {
  font-size: .9rem;
  color: var(--text2);
  line-height: 1.6;
}

.callout-info   .callout-body strong { color: var(--neon); }
.callout-warn   .callout-body strong { color: var(--amber); }
.callout-danger .callout-body strong { color: var(--neon2); }

/* --------------------------------------------------------------------------
   16. METRICS
   -------------------------------------------------------------------------- */

.metric {
  text-align: center;
}

.metric-num {
  display: block;
  font-family: var(--mono);
  font-size: 3rem;
  color: var(--neon);
  text-shadow: var(--glow-sm);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  display: block;
  color: var(--text2);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   17. BADGES
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.badge-get {
  background: rgba(0, 255, 65, .12);
  color: var(--green);
  border: 1px solid rgba(0, 255, 65, .25);
}

.badge-post {
  background: var(--neon-dim);
  color: var(--neon);
  border: 1px solid var(--border2);
}

.badge-put {
  background: rgba(255, 171, 0, .12);
  color: var(--amber);
  border: 1px solid rgba(255, 171, 0, .25);
}

.badge-delete {
  background: rgba(255, 0, 128, .12);
  color: var(--neon2);
  border: 1px solid rgba(255, 0, 128, .25);
}

/* Semantic color variants (issue #014) — consolidates ~28 repeated
   inline-styled <span> tags (feature tags like "SSE streaming",
   "at-least-once") that were scattered across the 8 pages with tiny
   variations in padding/property order. Same visual language as the
   HTTP-method badges above; color follows the #013 usage tiers: neon =
   primary/default, neon2 = narrative accent, green = positive status,
   amber = optional/caution status. */
.badge-neon {
  background: var(--neon-dim);
  color: var(--neon);
  border: 1px solid var(--border2);
}

.badge-neon2 {
  background: rgba(255, 0, 128, .1);
  color: var(--neon2);
  border: 1px solid rgba(255, 0, 128, .2);
}

.badge-green {
  background: rgba(0, 255, 65, .08);
  color: var(--green);
  border: 1px solid rgba(0, 255, 65, .2);
}

.badge-amber {
  background: rgba(255, 171, 0, .1);
  color: var(--amber);
  border: 1px solid rgba(255, 171, 0, .2);
}

/* --------------------------------------------------------------------------
   18. TABLE
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--neon);
  text-transform: uppercase;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(0, 255, 229, .03);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   19. FOOTER
   -------------------------------------------------------------------------- */

.footer {
  background: var(--bg1);
  border-top: 1px solid var(--border2);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand {
  /* First column — logo + description */
}

.footer-brand .nav-logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text2);
  font-size: .875rem;
  line-height: 1.65;
  max-width: 260px;
}

.footer-col h4 {
  font-family: var(--mono);
  color: var(--neon);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col a {
  color: var(--text2);
  display: block;
  margin-bottom: 8px;
  font-size: .875rem;
  transition: color var(--transition-fast) var(--ease);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--neon);
}

.footer-bottom {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom a {
  color: var(--muted);
  transition: color var(--transition-fast) var(--ease);
}

.footer-bottom a:hover {
  color: var(--neon);
}

/* --------------------------------------------------------------------------
   20. SECTION HEADING PATTERN
   -------------------------------------------------------------------------- */

.section-head {
  margin-bottom: 56px;
}

.section-head h2 {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--text);
  margin-bottom: 16px;
}

.section-head h2 span {
  color: var(--neon);
}

.section-head .lead {
  color: var(--text2);
}

/* --------------------------------------------------------------------------
   21. GRID HELPERS
   -------------------------------------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
}

/* --------------------------------------------------------------------------
   22. MISC UTILITIES
   -------------------------------------------------------------------------- */

/* Push content below fixed nav */
.page-offset {
  padding-top: var(--nav-h);
}

/* Neon accent text */
.accent { color: var(--neon); }

/* Mono utility */
.mono { font-family: var(--mono); }

/* Muted text */
.muted { color: var(--muted); }

/* Dim text */
.dim { color: var(--text2); }

/* Focus ring */
:focus-visible {
  outline: 1px solid var(--neon);
  outline-offset: 2px;
}

/* Skip link for a11y */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--neon);
  color: #000;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 13px;
  z-index: 200;
  transition: top var(--transition-fast) var(--ease);
}

.skip-link:focus {
  top: 8px;
}

/* Selection */
::selection {
  background: rgba(0, 255, 229, .25);
  color: var(--text);
}

/* Scrollbar (Chromium) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg1);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text2);
}

/* --------------------------------------------------------------------------
   22.5 RESPONSIVE — 900px tablet tier
   Between the mobile stack (≤768px) and desktop, .hero-right's fixed 460px
   max-width left too little room for .hero-left's text, cramming headings
   and paragraphs into a narrow column on tablets like iPad portrait (~820px).
   Shrinking the visual panel here (before it stacks below) keeps the hero
   readable through that gap.
   -------------------------------------------------------------------------- */

@media (max-width: 900px) and (min-width: 769px) {
  .hero-right {
    max-width: 320px;
  }
}

/* --------------------------------------------------------------------------
   23. RESPONSIVE — 768px breakpoint
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --section-pad: 64px;
    --card-pad: 20px;
  }

  .container {
    padding: 0 20px;
  }

  /* Nav: hide desktop links, show hamburger */
  .nav-links {
    display: none;
  }

  .nav-actions {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Hero stacks vertically */
  .hero-inner {
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
  }

  .hero-right {
    max-width: 100%;
    width: 100%;
  }

  /* Grids collapse to single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Footer grid collapses to 2 columns */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

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

  /* Hero heading */
  .hero-h1 {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  /* Reduce metric size */
  .metric-num {
    font-size: 2.25rem;
  }

  /* Tabs scroll horizontally */
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   24. RESPONSIVE — 480px breakpoint
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  :root {
    --section-pad: 48px;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    text-align: center;
  }

  h2 { font-size: 1.6rem; }
}

/* --------------------------------------------------------------------------
   25. RESPONSIVE — 1100px container cap
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   26. REDUCED MOTION
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .scanline,
  .glitch::before,
  .glitch::after,
  .cursor::after,
  .neon-pulse,
  .flicker,
  .float {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-eyebrow,
  .hero-h1,
  .hero-lead,
  .hero-actions {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
