/* ============================================================
   INSIDE EARTH — SHARED SUB-PAGE STYLES
   Mobile-first. Matches the design system used on index.html.
   ============================================================ */

:root {
  --bg: #fafaf7;
  --bg-2: #f3f1ea;
  --surface: #ffffff;
  --surface-alt: #f7f5ef;
  --ink: #0f1d2e;
  --ink-2: #2d3f55;
  --ink-muted: #6b7a8c;
  --ink-faint: #9aa5b3;

  --line: rgba(15, 29, 46, 0.08);
  --line-strong: rgba(15, 29, 46, 0.16);

  --primary: #2d5f6e;
  --primary-dark: #1f4752;
  --primary-light: #4a7a8c;
  --primary-tint: rgba(45, 95, 110, 0.08);

  --accent: #d47638;
  --accent-dark: #b8601f;
  --accent-light: #e89a5a;
  --accent-tint: rgba(212, 118, 56, 0.1);

  --success: #4a8a5f;
  --danger: #b84a3a;

  --navy: #0a1724;
  --navy-2: #13283d;

  --shadow-sm: 0 1px 3px rgba(15, 29, 46, .06);
  --shadow: 0 4px 16px rgba(15, 29, 46, .08);
  --shadow-lg: 0 12px 32px rgba(15, 29, 46, .12);

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

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: 20px;
  --section-y: 72px;
  --safe-bottom: env(safe-area-inset-bottom);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::selection { background: var(--accent); color: #fff; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 80px;
}
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a, button, [role="button"] { min-height: 44px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
section { position: relative; }

/* Typography */
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.eyebrow::before { content: ''; width: 24px; height: 1.5px; background: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-optical-sizing: auto;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--primary); font-weight: 300; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(250, 250, 247, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-size: 20px; font-weight: 500;
  letter-spacing: -0.015em; color: var(--ink);
}
.logo-mark {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-light) 0%, var(--accent) 50%, var(--accent-dark) 100%);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,.2), 0 2px 8px rgba(212, 118, 56, .3);
  flex-shrink: 0;
  overflow: hidden;
}
.logo-mark::before {
  content: ''; position: absolute; inset: 20%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.5);
  animation: spin 20s linear infinite;
}
.logo-mark::after {
  content: ''; position: absolute;
  left: 10%; right: 10%; top: 48%; height: 1px;
  background: rgba(255,255,255,.5);
  transform: rotate(-8deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

.nav-links { display: none; list-style: none; }

.menu-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: none; border: none; cursor: pointer;
  z-index: 102; position: relative;
  transition: background .3s var(--ease);
}
.menu-btn:active { background: var(--line); }
.menu-btn-bar {
  display: block; width: 22px; height: 1.8px;
  background: var(--ink); position: relative;
  transition: background .2s var(--ease);
}
.menu-btn-bar::before, .menu-btn-bar::after {
  content: ''; position: absolute; left: 0;
  width: 100%; height: 1.8px; background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-btn-bar::before { top: -7px; }
.menu-btn-bar::after { top: 7px; }
.menu-open .menu-btn-bar { background: transparent; }
.menu-open .menu-btn-bar::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-btn-bar::after { top: 0; transform: rotate(-45deg); }

.menu-drawer {
  position: fixed; inset: 0;
  background: var(--surface);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  overflow-y: auto;
  padding: 80px var(--gutter) 40px;
  -webkit-overflow-scrolling: touch;
}
.menu-open .menu-drawer { transform: translateX(0); }
.menu-drawer ul { list-style: none; border-top: 1px solid var(--line); }
.menu-drawer li { border-bottom: 1px solid var(--line); }
.menu-drawer a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  font-family: var(--display); font-size: 26px; font-weight: 400;
  color: var(--ink); letter-spacing: -0.015em; line-height: 1.1;
}
.menu-drawer a::after { content: '→'; color: var(--accent); font-family: var(--body); font-size: 20px; transition: transform .3s var(--ease); }
.menu-drawer a:active::after { transform: translateX(4px); }
.menu-drawer .btn { margin-top: 28px; width: 100%; justify-content: center; }
.menu-drawer-footer {
  margin-top: 40px; padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.menu-drawer-footer div { margin-bottom: 6px; }
.menu-drawer-footer strong { color: var(--ink); font-family: var(--body); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 14px; font-weight: 600;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  white-space: nowrap;
  border: 1.5px solid transparent;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); transform: scale(0.98); }
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-dark); box-shadow: 0 8px 24px rgba(212, 118, 56, .3); transform: translateY(-1px); }
}
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:active { background: var(--primary-tint); }
@media (hover: hover) {
  .btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
}
.nav .btn { display: none; }

/* ============================================================
   VISUAL PRIMITIVES — grain, strata, contours, depth markers
   ============================================================ */

/* Grain/noise overlay. Apply via `.has-grain` or stacked on section. */
.grain::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .5;
  mix-blend-mode: multiply;
  z-index: 1;
}
.section-dark.grain::after,
.cta-band.grain::after { mix-blend-mode: overlay; opacity: .25; }

/* Topographic contour pattern — as a subtle background layer */
.topo-bg {
  position: relative;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%232d5f6e' stroke-opacity='.08' stroke-width='0.8'%3E%3Cpath d='M -50 220 Q 120 180 280 220 T 620 200 M -50 290 Q 150 260 300 295 T 620 275 M -50 360 Q 130 320 290 360 T 620 340 M -50 430 Q 160 400 310 435 T 620 415 M -50 500 Q 140 470 300 505 T 620 485'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 600px 600px;
}

/* Topographic divider — thin wavy lines between sections */
.topo-divider {
  height: 64px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='1'%3E%3Cpath d='M0 20 Q360 8 720 20 T1440 16' stroke='%232d5f6e' stroke-opacity='.22'/%3E%3Cpath d='M0 30 Q360 42 720 30 T1440 34' stroke='%23d47638' stroke-opacity='.18'/%3E%3Cpath d='M0 44 Q360 32 720 44 T1440 40' stroke='%232d5f6e' stroke-opacity='.15'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  position: relative;
  margin: 0;
  pointer-events: none;
}
.section-dark + .topo-divider,
.cta-band + .topo-divider,
.topo-divider.on-dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='1'%3E%3Cpath d='M0 20 Q360 8 720 20 T1440 16' stroke='%23e89a5a' stroke-opacity='.32'/%3E%3Cpath d='M0 30 Q360 42 720 30 T1440 34' stroke='%234a7a8c' stroke-opacity='.32'/%3E%3Cpath d='M0 44 Q360 32 720 44 T1440 40' stroke='%23e89a5a' stroke-opacity='.2'/%3E%3C/g%3E%3C/svg%3E");
}

/* Scan-line animation — appears as a sweeping line on hero/stat areas */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .75;
  pointer-events: none;
  animation: scanSweep 6s var(--ease) infinite;
  z-index: 2;
}
@keyframes scanSweep {
  0%   { top: 10%;  opacity: 0; }
  10%  { opacity: .75; }
  90%  { opacity: .75; }
  100% { top: 90%;  opacity: 0; }
}

/* Signal pulse dot — reusable live-indicator */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(74, 138, 95, .6);
  animation: pulseDot 2.2s var(--ease) infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 138, 95, .5); }
  70%      { transform: scale(.9); box-shadow: 0 0 0 10px rgba(74, 138, 95, 0); }
}

/* Depth-gauge tick marks (reusable) */
.depth-ticks {
  position: absolute;
  top: 12%; bottom: 12%; left: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.14em; color: var(--ink-muted);
  opacity: .6;
  pointer-events: none;
}
.depth-ticks span { position: relative; padding-left: 18px; }
.depth-ticks span::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 12px; height: 1px;
  background: currentColor;
}

/* Stroke-draw animation setup (applied to SVG paths with .draw-me) */
.draw-me { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.draw-me.in, .in .draw-me { animation: drawStroke 2.2s var(--ease) forwards; }
.draw-me.in:nth-child(2), .in .draw-me:nth-child(2) { animation-delay: .2s; }
.draw-me.in:nth-child(3), .in .draw-me:nth-child(3) { animation-delay: .4s; }
.draw-me.in:nth-child(4), .in .draw-me:nth-child(4) { animation-delay: .6s; }
.draw-me.in:nth-child(5), .in .draw-me:nth-child(5) { animation-delay: .8s; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }

/* Floating parallax decorations */
.deco-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.deco-orb.teal    { background: radial-gradient(circle, rgba(45,95,110,.22), transparent 65%); }
.deco-orb.amber   { background: radial-gradient(circle, rgba(212,118,56,.18), transparent 65%); }
.deco-orb.navy    { background: radial-gradient(circle, rgba(15,29,46,.18), transparent 65%); }

/* Kicker label with accent bar */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.kicker::before {
  content: ''; width: 20px; height: 1.5px;
  background: currentColor;
}

/* ============ SUB-PAGE HERO ============ */
.page-hero {
  padding: 118px 0 60px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface-alt) 100%);
  border-bottom: none;
}

/* Animated subsurface strata background in hero */
.page-hero-strata {
  position: absolute; inset: 0;
  z-index: 0;
  opacity: .85;
  pointer-events: none;
}
.page-hero-strata svg { width: 100%; height: 100%; display: block; }
.page-hero-strata .stratum {
  fill: none; stroke-width: 1.1;
  stroke-dasharray: 2400; stroke-dashoffset: 2400;
  animation: drawStroke 2.6s var(--ease) forwards;
}
.page-hero-strata .stratum:nth-child(1) { stroke: rgba(45, 95, 110, .28);  animation-delay: .15s; }
.page-hero-strata .stratum:nth-child(2) { stroke: rgba(212, 118, 56, .22); animation-delay: .30s; }
.page-hero-strata .stratum:nth-child(3) { stroke: rgba(45, 95, 110, .18);  animation-delay: .45s; }
.page-hero-strata .stratum:nth-child(4) { stroke: rgba(212, 118, 56, .16); animation-delay: .60s; }
.page-hero-strata .stratum:nth-child(5) { stroke: rgba(45, 95, 110, .14);  animation-delay: .75s; }

.page-hero::before {
  content: ''; position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(45,95,110,.18), transparent 62%);
  filter: blur(40px); pointer-events: none; z-index: 0;
  animation: orbFloat 14s var(--ease) infinite alternate;
}
.page-hero::after {
  content: ''; position: absolute;
  bottom: -120px; left: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(212,118,56,.15), transparent 65%);
  filter: blur(40px); pointer-events: none; z-index: 0;
  animation: orbFloat 16s var(--ease) infinite alternate-reverse;
}
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-30px, 20px) scale(1.12); }
}
.page-hero .container { position: relative; z-index: 3; }

.breadcrumbs {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-hidden] { color: var(--ink-faint); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; }

.page-hero h1 {
  font-size: clamp(36px, 8vw, 62px);
  max-width: 780px;
  margin-top: 14px;
  margin-bottom: 22px;
}
.page-hero .lede {
  max-width: 640px;
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 28px;
}
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.page-hero-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  max-width: 820px;
  position: relative;
}
.page-hero-stats::before {
  content: '';
  position: absolute;
  left: 0; top: -1px;
  width: 80px; height: 2px;
  background: var(--accent);
}
.page-hero-stat {
  position: relative;
  padding-left: 2px;
}
.page-hero-stat::before {
  content: '';
  position: absolute;
  left: -2px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--line-strong) 30%, transparent);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.page-hero-stat:hover::before { opacity: 1; }
.page-hero-stat .k {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 6.4vw, 46px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.page-hero-stat .k em {
  color: var(--accent);
  font-style: normal;
  font-weight: 300;
  font-size: .7em;
}
.page-hero-stat .v {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex; align-items: center; gap: 8px;
}
.page-hero-stat .v::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .5;
}

/* ============ SECTION LAYOUTS ============ */
.section { padding: var(--section-y) 0; }
.section-alt { background: var(--surface-alt); }
.section-dark { background: var(--navy); color: #e7eef4; }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-dark h2 em, .section-dark h3 em { color: var(--accent-light); }
.section-dark .eyebrow { color: var(--accent-light); }
.section-dark .eyebrow::before { background: var(--accent-light); }

.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 6vw, 46px); margin-top: 14px; }
.section-head .lede { margin-top: 16px; color: var(--ink-2); font-size: 17px; }
.section-dark .section-head .lede { color: #b9c7d3; }

/* Prose blocks */
.prose { max-width: 720px; }
.prose p { margin-bottom: 16px; color: var(--ink-2); font-size: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 { font-size: clamp(22px, 4vw, 28px); margin: 32px 0 14px; }
.prose h2 { font-size: clamp(26px, 5vw, 34px); margin: 40px 0 16px; }
.prose ul { list-style: none; margin: 16px 0; }
.prose ul li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--ink-2);
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: 16px;
  width: 14px; height: 2px; background: var(--accent); border-radius: 2px;
}
.prose strong { color: var(--ink); font-weight: 600; }

/* Feature grids (2 or 3 column) */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 720px) {
  .feature-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 29, 46, .08), 0 2px 8px rgba(15, 29, 46, .04);
  border-color: var(--line-strong);
}
.feature-card:hover::after { transform: scaleX(1); }
.feature-card .ico {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-tint), rgba(212,118,56,.08));
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  margin-bottom: 18px;
  transition: transform .35s var(--ease), color .25s var(--ease);
  border: 1px solid rgba(45, 95, 110, 0.1);
}
.feature-card:hover .ico {
  transform: rotate(-4deg) scale(1.06);
  color: var(--accent-dark);
}
.feature-card .ico svg { width: 22px; height: 22px; }
.feature-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: -0.012em;
}
.feature-card p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* Stat row — instrument-panel style with depth lines */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 40px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-row::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--primary) 80%, transparent);
  opacity: .6;
}
.stat-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--line) calc(50% - 0.5px), var(--line) calc(50%), transparent calc(50%));
  pointer-events: none; opacity: .8;
}
@media (min-width: 720px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .stat-row::after {
    background-image:
      linear-gradient(90deg, transparent calc(25% - 0.5px), var(--line) calc(25% - 0.5px), var(--line) calc(25%), transparent calc(25%)),
      linear-gradient(90deg, transparent calc(50% - 0.5px), var(--line) calc(50% - 0.5px), var(--line) calc(50%), transparent calc(50%)),
      linear-gradient(90deg, transparent calc(75% - 0.5px), var(--line) calc(75% - 0.5px), var(--line) calc(75%), transparent calc(75%));
  }
}
.stat-row > div { padding: 0 16px; position: relative; z-index: 1; }
.stat-row .s-k {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.stat-row .s-k em { color: var(--accent); font-style: normal; font-weight: 300; font-size: .65em; }
.stat-row .s-v {
  margin-top: 12px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-muted);
  display: flex; align-items: center; gap: 8px;
}
.stat-row .s-v::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(212,118,56,.5);
}

/* Two-column split (media + text) */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 880px) {
  .split { grid-template-columns: 1.1fr 1fr; gap: 56px; }
  .split.reverse .split-media { order: 2; }
}
.split-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  background: var(--surface-alt);
}
.split-media img { width: 100%; height: 100%; object-fit: cover; }

/* Related / internal links */
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-card {
  display: block;
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.related-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, rgba(212,118,56,.12), transparent 70%);
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(15, 29, 46, .08);
}
.related-card:hover::before { opacity: 1; }
.related-card:hover .rc-arrow svg { transform: translateX(4px); }
.related-card .rc-arrow svg { transition: transform .3s var(--ease); }
.related-card .rc-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.related-card h4 { font-size: 20px; margin-bottom: 6px; }
.related-card p { color: var(--ink-muted); font-size: 14px; }
.related-card .rc-arrow {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-size: 13px; font-weight: 600;
}

/* CTA Band */
.cta-band {
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(212,118,56,.28), transparent 60%),
    radial-gradient(ellipse 80% 120% at 0% 100%, rgba(45,95,110,.25), transparent 60%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: var(--section-y) 0;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 500' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='1'%3E%3Cpath d='M0 120 Q360 90 720 120 T1440 100' stroke='%23e89a5a' stroke-opacity='.18'/%3E%3Cpath d='M0 200 Q360 230 720 200 T1440 220' stroke='%234a7a8c' stroke-opacity='.22'/%3E%3Cpath d='M0 300 Q360 270 720 300 T1440 280' stroke='%23e89a5a' stroke-opacity='.12'/%3E%3Cpath d='M0 400 Q360 430 720 400 T1440 420' stroke='%234a7a8c' stroke-opacity='.18'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  opacity: .85;
}
.cta-band::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  transform: translateX(-50%);
  animation: scanSweepH 8s var(--ease) infinite;
}
@keyframes scanSweepH {
  0%   { transform: translateX(-120%); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(calc(100vw + 50%)); opacity: 0; }
}
.cta-band .container { position: relative; z-index: 2; }
.cta-band .eyebrow { color: var(--accent-light); }
.cta-band .eyebrow::before { background: var(--accent-light); }
.cta-band h2 {
  color: #fff;
  font-size: clamp(28px, 5vw, 42px);
  max-width: 720px;
  margin: 14px 0 18px;
}
.cta-band h2 em { color: var(--accent-light); }
.cta-band p { color: #b9c7d3; max-width: 620px; margin-bottom: 26px; font-size: 17px; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.2); }
.cta-band .btn-ghost:hover { border-color: var(--accent-light); color: var(--accent-light); }

/* Form (contact) */
.form-wrap {
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-field { display: flex; flex-direction: column; }
.form-field label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 8px; font-weight: 500;
}
.form-field .req { color: var(--accent); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  background: var(--surface-alt);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 13px; color: var(--ink-muted); }
.form-consent input { margin-top: 4px; }
.form-consent a { color: var(--accent); text-decoration: underline; }
.form-submit {
  width: 100%; margin-top: 8px;
  background: var(--accent); color: #fff;
  padding: 15px 20px; border-radius: 100px;
  font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; border: none;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.form-submit:hover { background: var(--accent-dark); }
.form-submit:active { transform: scale(0.98); }
.form-message { margin-top: 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

/* ============ FOOTER ============ */
.footer {
  background: var(--navy);
  color: #8fa1b3;
  padding: 64px 0 40px;
}
.footer a { color: #c0ccd6; transition: color .2s var(--ease); }
.footer a:hover { color: var(--accent-light); }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 420px; margin-bottom: 28px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; margin-bottom: 32px; }
@media (min-width: 720px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
.footer-col h5 {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; margin-bottom: 14px; font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; font-size: 14px; }
.footer-bottom {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 14px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

/* Insights / blog listing */
.post-list { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .post-list { grid-template-columns: repeat(2, 1fr); } .post-list .post-card.featured { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .post-list { grid-template-columns: repeat(3, 1fr); } .post-list .post-card.featured { grid-column: 1 / -1; } }
.post-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.post-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.post-card .p-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); display: flex; gap: 10px; flex-wrap: wrap; }
.post-card .p-meta .sep { color: var(--ink-faint); }
.post-card h3 { font-size: 22px; color: var(--ink); line-height: 1.25; }
.post-card .p-excerpt { color: var(--ink-2); font-size: 14px; line-height: 1.6; flex-grow: 1; }
.post-card .p-read { color: var(--accent); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.post-card.featured { padding: 36px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-color: transparent; }
.post-card.featured h3 { color: #fff; font-size: 28px; }
.post-card.featured .p-excerpt { color: #b9c7d3; font-size: 16px; }
.post-card.featured .p-meta { color: var(--accent-light); }
.post-card.featured .p-read { color: var(--accent-light); }

/* Article body */
article.post {
  max-width: 760px;
  margin: 0 auto;
}
article.post .post-header { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
article.post .post-header .post-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
article.post .post-header .post-meta strong { color: var(--accent); font-weight: 500; }
article.post h1 { font-size: clamp(32px, 6vw, 48px); margin-bottom: 16px; letter-spacing: -0.025em; }
article.post .post-subtitle { color: var(--ink-2); font-size: clamp(16px, 2.4vw, 20px); line-height: 1.45; }
article.post .post-body { color: var(--ink-2); font-size: 17px; line-height: 1.72; }
article.post .post-body h2 { font-size: clamp(24px, 4vw, 30px); margin: 42px 0 16px; color: var(--ink); letter-spacing: -0.02em; }
article.post .post-body h3 { font-size: clamp(19px, 3vw, 22px); margin: 30px 0 12px; color: var(--ink); }
article.post .post-body p { margin-bottom: 18px; }
article.post .post-body ul, article.post .post-body ol { margin: 12px 0 20px 24px; }
article.post .post-body li { margin-bottom: 8px; }
article.post .post-body blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 24px 0; font-style: italic; color: var(--ink); background: var(--surface-alt); }
article.post .post-body strong { color: var(--ink); font-weight: 600; }
article.post .post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
article.post .post-tags { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
article.post .post-tags a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; font-size: 12px; color: var(--ink-muted); transition: color .2s var(--ease), border-color .2s var(--ease); }
article.post .post-tags a:hover { color: var(--accent); border-color: var(--accent); }

/* FAQ accordion (<details>) */
.faq-list { max-width: 820px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.faq-item[open] {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(212, 118, 56, 0.08);
  transform: translateY(-1px);
}
.faq-item:hover:not([open]) { border-color: var(--line-strong); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--display);
  font-size: 18px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--body);
  font-weight: 300;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer {
  padding: 0 22px 22px;
  color: var(--ink-2);
  font-size: 15px; line-height: 1.65;
}
.faq-answer p { margin-bottom: 10px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a { color: var(--accent); text-decoration: underline; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ DESKTOP NAV ============ */
@media (min-width: 960px) {
  .nav { padding: 18px 0; }
  .nav .btn { display: inline-flex; }
  .menu-btn { display: none; }
  .nav-links {
    display: flex; list-style: none; gap: 28px; align-items: center;
  }
  .nav-links > li { position: relative; }
  .nav-links a {
    font-size: 14px; font-weight: 500; color: var(--ink-2);
    transition: color .2s var(--ease);
    padding: 10px 0;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .nav-links a:hover { color: var(--accent); }

  /* Dropdown */
  .nav-links .has-dropdown > a::after {
    content: '';
    width: 6px; height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-1px,-1px);
    display: inline-block;
    margin-left: 2px;
    transition: transform .2s var(--ease);
  }
  .nav-links .has-dropdown:hover > a::after,
  .nav-links .has-dropdown:focus-within > a::after {
    transform: rotate(-135deg) translate(-2px,-2px);
  }
  .nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
    z-index: 110;
  }
  .nav-links .has-dropdown:hover .nav-dropdown,
  .nav-links .has-dropdown:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s;
  }
  .nav-dropdown li { margin: 0; }
  .nav-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ink);
    border-radius: var(--radius-sm);
    min-height: auto;
  }
  .nav-dropdown a:hover { background: var(--primary-tint); color: var(--accent); }
  .nav-dropdown .nd-sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-top: 2px;
    display: block;
    font-weight: 500;
  }

  :root { --section-y: 112px; }
  .container { padding: 0 32px; }
  .footer-cols { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .footer { padding: 88px 0 48px; }
  .page-hero { padding: 150px 0 80px; }
  .page-hero-stats { grid-template-columns: repeat(4, 1fr); }
}

/* On mobile, dropdown items appear flat (no JS needed) */
@media (max-width: 959px) {
  .nav-links .nav-dropdown {
    display: contents;
  }
  .nav-links .has-dropdown > a::after { display: none; }
}

body.menu-open { overflow: hidden; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .page-hero-strata .stratum { stroke-dashoffset: 0 !important; }
  .draw-me { stroke-dashoffset: 0 !important; }
  .scan-line, .cta-band::after { animation: none !important; opacity: 0 !important; }
  .pulse-dot { animation: none !important; }
}

/* ============ MOBILE TOUCH ENHANCEMENTS ============ */
@media (hover: none) and (pointer: coarse) {
  /* Beefier tap feedback on mobile */
  .btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(212,118,56,.4); }
  .feature-card:active { transform: scale(0.99); }
  .related-card:active { transform: scale(0.99); }

  /* Larger tap targets for small text links in prose */
  article.post .post-body a { padding: 2px 0; }

  /* Disable parallax-ish heavy animations on touch devices by default */
  .page-hero::before, .page-hero::after { animation-duration: 24s; }
}

/* Fine-tune dense mobile layout */
@media (max-width: 720px) {
  .page-hero { padding: 100px 0 40px; }
  .page-hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .page-hero .lede { font-size: 16px; }
  .page-hero-stats { gap: 18px; padding-top: 24px; margin-top: 32px; }
  .page-hero-stat .k { font-size: clamp(28px, 8vw, 38px); }
  .stat-row { padding: 28px 20px; }
  .stat-row > div { padding: 0 10px; }
  .section-head { margin-bottom: 32px; }
  .section-head h2 { font-size: clamp(26px, 7vw, 34px); }
  .cta-band h2 { font-size: clamp(26px, 7vw, 34px); }
  .feature-card { padding: 22px 20px; }
  .related-card { padding: 22px 18px; }
  .faq-item summary { padding: 18px 18px; font-size: 16px; }
  .faq-answer { padding: 0 18px 18px; }
  .topo-divider { height: 40px; }
}

@supports (scrollbar-gutter: stable) {
  :root { scrollbar-gutter: stable; }
}
