/* ===========================================================================
   TILETERRA SYSTEMS - DESIGN SYSTEM (v2 - production hardened)
   Mobile-first. Single source of truth.
   =========================================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */

:root {
  /* Color - base */
  --void: #0A0E1A;
  --surface: #13182A;
  --surface-elevated: #1A2038;
  --border: #1F2940;
  --border-strong: #2A3554;

  /* Color - text */
  --text-primary: #E5E9F0;
  --text-secondary: #8B95A8;
  --text-muted: #5A6478;
  --text-inverted: #0A0E1A;

  /* Color - signal */
  --signal: #00E5FF;
  --signal-dim: #00B8CC;
  --signal-glow: rgba(0, 229, 255, 0.15);
  --warning: #FFB800;
  --warning-dim: #CC9300;
  --success: #00FF85;
  --critical: #FF3B5C;

  /* Color - hex grid motif */
  --hex-line: rgba(0, 229, 255, 0.08);
  --hex-line-strong: rgba(0, 229, 255, 0.18);

  /* Typography - families */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Typography - scale (clamps for fluid sizing) */
  --fs-h1: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem);
  --fs-h3: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  --fs-h4: 1.0625rem;
  --fs-body: 1rem;
  --fs-body-lg: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.75rem;
  --fs-mono: 0.8125rem;

  /* Typography - weight */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Typography - leading */
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  /* Typography - tracking */
  --ls-tight: -0.02em;
  --ls-normal: 0;
  --ls-wide: 0.02em;
  --ls-eyebrow: 0.16em;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 5rem;
  --s-10: 6rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 880px;
  --container-prose: 720px;
  --container-pad: clamp(1rem, 4vw, 2rem);
  --nav-height: 60px;

  /* Border radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 16px;

  /* Shadow */
  --shadow-glow: 0 0 32px rgba(0, 229, 255, 0.12);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);

  /* Motion */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;
}

/* ---------- 2. RESET & BASE ---------- */

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

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--void);
  font-size: var(--fs-body);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(255, 184, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; vertical-align: middle; }

a {
  color: var(--signal);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--signal-dim); }

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

::selection { background: var(--signal); color: var(--void); }

/* ---------- 3. TYPOGRAPHY ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-medium); }

p { line-height: var(--lh-normal); color: var(--text-primary); overflow-wrap: break-word; }

.lead {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  max-width: 65ch;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: var(--s-3);
}

.eyebrow-muted {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--s-3);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-normal);
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-signal { color: var(--signal); }

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  position: relative;
}
.container-narrow { max-width: var(--container-narrow); }
.container-prose { max-width: var(--container-prose); }

.section { padding-top: var(--s-7); padding-bottom: var(--s-7); position: relative; }

@media (min-width: 720px) {
  .section { padding-top: var(--s-8); padding-bottom: var(--s-8); }
}

.section-lg { padding-top: var(--s-7); padding-bottom: var(--s-7); }

@media (min-width: 720px) {
  .section-lg { padding-top: var(--s-9); padding-bottom: var(--s-9); }
}

.section-tight { padding-top: var(--s-5); padding-bottom: var(--s-5); }

@media (min-width: 720px) {
  .section-tight { padding-top: var(--s-6); padding-bottom: var(--s-6); }
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: var(--s-7) 0;
}

/* Grids - mobile first single column, scale up */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }

@media (min-width: 600px) {
  .grid, .grid-2, .grid-3, .grid-4 { gap: var(--s-5); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 5. NAVIGATION ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--s-3) var(--container-pad);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--nav-height);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}

@media (min-width: 480px) {
  .nav-brand { font-size: 1.0625rem; }
}

.nav-brand:hover { color: var(--text-primary); }

.nav-brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-brand-mark svg { display: block; }

@media (max-width: 359px) {
  .nav-brand-text { display: none; }
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--s-5);
  align-items: center;
  margin: 0;
  padding: 0;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
    margin-right: var(--s-4);
  }
}

.nav-links a {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  transition: color var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-cta { display: none; }

@media (min-width: 900px) {
  .nav-cta { display: inline-flex; }
}

.nav-mobile-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

@media (min-width: 900px) {
  .nav-mobile-toggle { display: none; }
}

.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.nav-mobile-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  padding: var(--s-7) var(--s-5) var(--s-5);
  transform: translateX(100%);
  transition: transform var(--t-base);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-mobile-drawer[data-open="true"] {
  transform: translateX(0);
}

.nav-mobile-close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  padding: var(--s-2);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-mobile-close:hover { color: var(--text-primary); }

.nav-mobile-link {
  display: block;
  padding: var(--s-3) 0;
  font-size: 1.0625rem;
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

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

.nav-mobile-link:last-of-type { border-bottom: 0; }

body.nav-locked { overflow: hidden; }

/* ---------- 6. BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  min-height: 44px;
}

.btn-primary {
  background: var(--signal);
  color: var(--void);
  border-color: var(--signal);
}
.btn-primary:hover {
  background: var(--signal-dim);
  border-color: var(--signal-dim);
  color: var(--void);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.btn-arrow::after {
  content: '→';
  margin-left: var(--s-1);
  transition: transform var(--t-fast);
}
.btn-arrow:hover::after { transform: translateX(2px); }

.nav-cta {
  padding: 0.5rem 1rem;
  min-height: 38px;
  font-size: var(--fs-small);
}

/* ---------- 7. CARDS ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  transition: border-color var(--t-base), transform var(--t-base);
  position: relative;
  overflow: hidden;
}

@media (min-width: 720px) {
  .card { padding: var(--s-5); }
}

.card:hover { border-color: var(--border-strong); }

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.card-link:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-link:hover h3 { color: var(--signal); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
  gap: var(--s-3);
  flex-wrap: wrap;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-elevated);
  color: var(--signal);
  border: 1px solid var(--border);
  text-transform: uppercase;
  white-space: nowrap;
}

.card-tag-warning { color: var(--warning); }

.card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--s-2);
  transition: color var(--t-fast);
  line-height: 1.3;
}

.card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}

.card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-meta-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-meta-value {
  font-size: var(--fs-small);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  word-break: break-word;
}

/* ---------- 8. HERO ---------- */

.hero {
  padding: var(--s-7) 0 var(--s-6);
  position: relative;
  overflow: hidden;
}

@media (min-width: 720px) {
  .hero { padding: var(--s-9) 0 var(--s-8); }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  font-size: var(--fs-h1);
  margin-bottom: var(--s-4);
  max-width: 22ch;
}

.hero .lead {
  font-size: var(--fs-body-lg);
  max-width: 60ch;
  margin-bottom: var(--s-5);
}

.hero-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.hero-actions .btn {
  flex: 1 1 auto;
  min-width: max-content;
}

@media (min-width: 480px) {
  .hero-actions .btn { flex: 0 0 auto; }
}

.hero-meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: var(--s-6);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* ---------- 9. PRICING TABLE ---------- */

.pricing-table {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}

.pricing-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}

.pricing-row:last-child { border-bottom: 0; }
.pricing-row:hover { background: var(--surface-elevated); }

@media (min-width: 720px) {
  .pricing-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-5);
  }
}

.pricing-track-name {
  font-size: 1.0625rem;
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--s-1);
}

.pricing-track-desc {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: var(--lh-snug);
}

.pricing-amount {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: var(--fw-semibold);
  color: var(--signal);
}

.pricing-amount-prefix {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-right: var(--s-1);
}

.pricing-delivery {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--text-secondary);
}

/* ---------- 10. INCLUSION TABLE ---------- */

.inclusions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

@media (min-width: 600px) {
  .inclusions { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .inclusions { grid-template-columns: repeat(3, 1fr); }
}

.inclusion-item {
  background: var(--surface);
  padding: var(--s-4);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.inclusion-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--signal);
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
}

.inclusion-content { min-width: 0; }

.inclusion-content h4 {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.inclusion-content p {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: var(--lh-snug);
}

/* ---------- 11. CTA BLOCK ---------- */

.cta-block {
  position: relative;
  padding: var(--s-7) var(--container-pad);
  text-align: center;
  background:
    linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.04)),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

@media (min-width: 720px) {
  .cta-block { padding: var(--s-9) var(--container-pad); }
}

.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'><polygon fill='none' stroke='%2300E5FF' stroke-opacity='0.04' points='15,2 45,2 60,26 45,50 15,50 0,26'/></svg>");
  background-size: 60px 52px;
  pointer-events: none;
  opacity: 0.6;
}

.cta-block-inner {
  position: relative;
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.cta-block h2 { margin-bottom: var(--s-3); }

.cta-block .lead {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--s-5);
}

/* ---------- 12. FOOTER ---------- */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s-7) 0 var(--s-5);
  margin-top: var(--s-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}

@media (min-width: 600px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--s-6);
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}

.footer-tagline {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  margin-bottom: var(--s-4);
  max-width: 32ch;
  line-height: var(--lh-normal);
}

.footer-section-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  transition: color var(--t-fast);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text-primary); }

.footer-base {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-wide);
}

.footer-base-links {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.footer-base-links a { color: var(--text-muted); }
.footer-base-links a:hover { color: var(--signal); }

/* ---------- 13. BREADCRUMB ---------- */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  word-break: break-word;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--signal); }
.breadcrumb-sep { margin: 0 var(--s-2); color: var(--text-muted); }

/* ---------- 14. TECH STACK CHIPS ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  padding: 4px 10px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  white-space: nowrap;
}

/* ---------- 15. METRIC BLOCKS ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

@media (min-width: 720px) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
}

.metric {
  background: var(--surface);
  padding: var(--s-4);
  text-align: left;
}

@media (min-width: 720px) {
  .metric { padding: var(--s-5) var(--s-4); }
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: var(--fw-semibold);
  color: var(--signal);
  line-height: 1;
  margin-bottom: var(--s-2);
  word-break: break-word;
}

@media (min-width: 720px) {
  .metric-value { font-size: 1.625rem; }
}

.metric-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ---------- 16. FORM ---------- */

.form-field { margin-bottom: var(--s-4); }

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  transition: border-color var(--t-fast);
  min-height: 44px;
}

@media (max-width: 600px) {
  .form-input, .form-select, .form-textarea { font-size: 16px; }
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: 0;
  border-color: var(--signal);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-body);
}

.form-help {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--s-1);
  line-height: var(--lh-snug);
}

/* ---------- 17. UTILITIES ---------- */

.t-center { text-align: center; }
.t-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }
.mb-6 { margin-bottom: var(--s-6); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 18. PROSE (case studies) ---------- */

.prose {
  max-width: var(--container-prose);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--text-primary);
}

.prose h2 {
  margin-top: var(--s-7);
  margin-bottom: var(--s-3);
  scroll-margin-top: calc(var(--nav-height) + var(--s-3));
}

.prose h3 {
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
  scroll-margin-top: calc(var(--nav-height) + var(--s-3));
}

.prose p { margin-bottom: var(--s-4); }

.prose ul, .prose ol {
  margin: var(--s-3) 0 var(--s-4) var(--s-5);
}

.prose li { margin-bottom: var(--s-2); }

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--signal-dim);
  text-underline-offset: 2px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--signal);
  word-break: break-word;
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  overflow-x: auto;
  margin: var(--s-4) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: var(--lh-snug);
  color: var(--text-primary);
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  word-break: normal;
}

.prose blockquote {
  border-left: 2px solid var(--signal);
  padding: var(--s-2) var(--s-4);
  margin: var(--s-4) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--signal);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin: var(--s-5) 0;
}

.callout-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: var(--s-2);
}

/* ---------- 19. TOC ---------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  font-size: var(--fs-small);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  margin-bottom: var(--s-2);
  padding-left: var(--s-4);
  position: relative;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.toc a {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
  display: block;
  text-decoration: none;
}
.toc a:hover { color: var(--signal); }

/* ---------- 20. PORTFOLIO FILTER BAR ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  padding: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

@media (min-width: 480px) {
  .filter-btn { padding: 0.5rem 0.875rem; }
}

.filter-btn:hover { color: var(--text-primary); }

.filter-btn[aria-pressed="true"] {
  background: var(--surface-elevated);
  color: var(--signal);
  border-color: var(--border);
}

/* ---------- 21. STATUS PILLS ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-live {
  background: rgba(0, 255, 133, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 255, 133, 0.3);
}

.pill-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
}

.pill-data {
  background: rgba(0, 229, 255, 0.1);
  color: var(--signal);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

/* ---------- 22. CASE STUDY LAYOUT ---------- */

.case-study-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}

.case-study-layout .toc { display: none; }

@media (min-width: 1024px) {
  .case-study-layout {
    grid-template-columns: 240px 1fr;
    gap: var(--s-7);
  }
  .case-study-layout .toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + var(--s-3));
    align-self: start;
    max-width: 280px;
  }
}

/* ---------- 23. FAQ ACCORDION ---------- */

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-3);
  overflow: hidden;
}

.faq-summary {
  cursor: pointer;
  padding: var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
  list-style: none;
  user-select: none;
}

.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { display: none; content: ''; }

.faq-summary-text {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  font-size: var(--fs-body);
}

.faq-summary-icon {
  font-family: var(--font-mono);
  color: var(--signal);
  flex-shrink: 0;
  transition: transform 0.2s;
  font-size: 1.25rem;
  line-height: 1;
}

.faq-item[open] .faq-summary-icon { transform: rotate(45deg); }

.faq-answer {
  padding: 0 var(--s-4) var(--s-4);
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: var(--fs-small);
}

/* ---------- 24. INLINE GRID FALLBACKS ---------- */

@media (max-width: 720px) {
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- 25. PRINT-FRIENDLY ---------- */

@media print {
  .nav, footer, .cta-block, .nav-mobile-overlay, .nav-mobile-drawer { display: none; }
  body::before { display: none; }
  body { background: white; color: black; }
  .prose { max-width: 100%; }
}

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

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