/* =========================================================================
   Eternix Technologies — design system
   Approach: semantic tokens, dual themes, typography hierarchy, motion primitives.
   ========================================================================= */

/* ---------- Local display font (kept for headline personality only) ---------- */
@font-face {
  font-family: "URW Gothic";
  src: url("./assets/fonts/URWGothic-Demi.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Modern UI fonts via Google Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ---------- Tokens (dark default) ---------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #060810;
  --bg-soft: #0b0e18;
  --bg-elevated: rgba(14, 18, 30, 0.72);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text: #f3f4f7;
  --text-secondary: #b9bdc9;
  --text-muted: #7a7f8e;
  --text-faint: #4d5260;

  /* accent — single bold accent, neutral elsewhere */
  --accent: #7c5cff;
  --accent-hover: #9b80ff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-glow: rgba(124, 92, 255, 0.35);

  /* feedback */
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;

  /* sizing */
  --max: 1240px;
  --max-narrow: 920px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --t-slow: 600ms;

  /* shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 16px 48px rgba(124, 92, 255, 0.25);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #fafafa;
  --bg-soft: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --surface: rgba(0, 0, 0, 0.025);
  --surface-strong: rgba(0, 0, 0, 0.04);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  --text: #0a0c14;
  --text-secondary: #2a2e3a;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --accent: #5b3df5;
  --accent-hover: #7c5cff;
  --accent-soft: rgba(91, 61, 245, 0.1);
  --accent-glow: rgba(91, 61, 245, 0.18);

  --shadow-sm: 0 1px 2px rgba(10, 12, 20, 0.06);
  --shadow: 0 8px 24px rgba(10, 12, 20, 0.08);
  --shadow-lg: 0 30px 80px rgba(10, 12, 20, 0.12);
  --shadow-accent: 0 16px 48px rgba(91, 61, 245, 0.18);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
  overflow-x: hidden;
}

/* Subtle ambient grid behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%);
  opacity: 0.5;
}

/* Cursor spotlight (dark mode emphasis) */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    var(--accent-glow),
    transparent 40%
  );
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

body:hover .spotlight {
  opacity: 0.4;
}

[data-theme="light"] .spotlight {
  opacity: 0;
}

[data-theme="light"] body:hover .spotlight {
  opacity: 0.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Typography ---------- */
.brand-name,
h1,
h2,
h3,
h4 {
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  color: var(--text);
}

.display {
  font-family: "URW Gothic", "Inter", sans-serif;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  letter-spacing: -0.035em;
  font-weight: 700;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.03em;
  font-weight: 600;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
}

p {
  margin: 0;
  color: var(--text-secondary);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 60ch;
}

.eyebrow,
.mono,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

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

/* ---------- Layout primitives ---------- */
.container {
  width: min(var(--max), calc(100% - 3rem));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.container-narrow {
  width: min(var(--max-narrow), calc(100% - 3rem));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.section {
  position: relative;
  padding: clamp(4rem, 9vw, 8rem) 0;
}

.section-tight {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: end;
  margin-bottom: 3rem;
}

.section-head h2 {
  margin-top: 0.6rem;
}

.section-head p {
  color: var(--text-secondary);
}

@media (max-width: 880px) {
  .section-head {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease);
}

.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border);
}

.header-inner {
  width: min(var(--max), calc(100% - 3rem));
  margin-inline: auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 4s var(--ease) infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.brand-mark svg {
  width: 16px;
  height: 16px;
  position: relative;
  z-index: 1;
  color: white;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-shell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.site-nav a {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a.active {
  color: var(--text);
  background: var(--surface-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .sun,
.theme-toggle .moon {
  position: absolute;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}

[data-theme="dark"] .theme-toggle .sun,
:root:not([data-theme="light"]) .theme-toggle .sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-toggle .moon,
:root:not([data-theme="light"]) .theme-toggle .moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.theme-toggle {
  position: relative;
}

.menu-toggle {
  display: none;
}

.cta-header {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}

[data-theme="light"] .cta-header {
  color: white;
}

.cta-header:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.cta-header svg {
  width: 14px;
  height: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  position: relative;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}

[data-theme="light"] .btn-primary {
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(124, 92, 255, 0.4);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.7rem 0.95rem;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast) var(--ease);
}

.btn:hover svg.arrow {
  transform: translateX(3px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 6rem);
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-copy {
  display: grid;
  gap: 1.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: fit-content;
}

.hero-pill .dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--success);
  position: relative;
  display: grid;
  place-items: center;
}

.hero-pill .dot::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  animation: pulse-ring 2s var(--ease) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero h1 .accent-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-family: "URW Gothic", "Inter", sans-serif;
  font-weight: 700;
  /* URW Gothic ships only a normal-style face; the italic above is
     synthesized by the browser. Synthetic italic skews glyphs to the
     right, and the trailing letter (e.g. the "n" in "outgrown") extends
     past the inline line-box. That overhang gets clipped two ways: by
     `-webkit-background-clip: text` (the gradient mask is only as wide as
     the line-box), and by the parent .hero's `overflow: hidden`. A small
     right padding lets the skew render fully without disturbing word
     spacing (the inline space handles word distance, not the padding). */
  padding-right: 0.14em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.hero-meta-item {
  display: grid;
  gap: 0.2rem;
}

.hero-meta-item strong {
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-meta-item span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

/* ---------- Hero visual: animated dashboard mock ---------- */
.hero-visual {
  position: relative;
  aspect-ratio: 4 / 3.4;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--bg-soft), color-mix(in srgb, var(--bg-soft) 60%, var(--accent-soft)));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--border-strong), transparent 50%, var(--accent-soft));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.dash-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.dash-dots {
  display: flex;
  gap: 5px;
}

.dash-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--text-faint);
  opacity: 0.5;
}

.dash-dots span:nth-child(1) { background: #ff6058; opacity: 0.7; }
.dash-dots span:nth-child(2) { background: #febc2e; opacity: 0.7; }
.dash-dots span:nth-child(3) { background: #28c840; opacity: 0.7; }

.dash-url {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.dash-body {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  min-height: 0;
}

.dash-side {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  display: grid;
  align-content: start;
  gap: 6px;
}

.dash-side .dash-item {
  height: 22px;
  border-radius: 6px;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  gap: 6px;
}

.dash-side .dash-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
}

.dash-side .dash-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}

.dash-main {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 0;
}

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

.dash-stat {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
}

.dash-stat .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-stat .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.dash-stat .delta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--success);
  margin-top: 2px;
}

.dash-chart {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  min-height: 0;
}

.dash-chart svg {
  width: 100%;
  height: 100%;
}

.dash-chart .grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.dash-chart .area {
  fill: url(#area-grad);
  opacity: 0.85;
}

.dash-chart .grad-start { stop-color: var(--accent); }
.dash-chart .grad-end { stop-color: var(--accent); }

.dash-chart .line {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 3s var(--ease) forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.dash-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dash-foot .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
}

.dash-foot .live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* ---------- Trust bar (logo-less, copy-led) ---------- */
.trust {
  padding: 2.5rem 0;
  border-block: 1px solid var(--border);
}

.trust-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 880px) {
  .trust-grid { grid-template-columns: 1fr; }
}

.trust-grid > .mono {
  white-space: nowrap;
}

.trust-marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.trust-track {
  display: flex;
  gap: 2.5rem;
  animation: marquee 40s linear infinite;
  width: max-content;
}

.trust-track span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.trust-track span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Service cards ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

@media (max-width: 640px) {
  .service-grid { grid-template-columns: 1fr; }
}

.service-card {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--t-med) var(--ease);
  overflow: hidden;
  display: grid;
  gap: 1rem;
  isolation: isolate;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    var(--accent-soft),
    transparent 40%
  );
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.service-icon svg {
  width: 22px;
  height: 22px;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.service-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.service-card ul li {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  padding-left: 1.1rem;
  position: relative;
}

.service-card ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Sticky horizontal capability scroll ---------- */
.capability-stage {
  position: relative;
  height: 320vh;
}

.capability-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  overflow: hidden;
}

.capability-rail {
  display: flex;
  gap: 1.4rem;
  padding-inline: max(1.5rem, calc((100vw - var(--max)) / 2));
  will-change: transform;
}

.capability-card {
  flex: 0 0 clamp(280px, 32vw, 420px);
  height: clamp(360px, 56vh, 520px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.8rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.capability-card .step {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

.capability-card h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.capability-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.capability-card .visual {
  position: relative;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 0;
}

.capability-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.capability-card .tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.capability-progress {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 5;
}

.capability-progress .seg {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  transition: background var(--t-fast) var(--ease);
}

.capability-progress .seg.active {
  background: var(--accent);
}

@media (max-width: 880px) {
  .capability-stage {
    height: auto;
  }
  .capability-pin {
    position: static;
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }
  .capability-rail {
    padding-inline: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .capability-rail::-webkit-scrollbar { display: none; }
  .capability-card {
    scroll-snap-align: start;
  }
  .capability-progress { display: none; }
}

/* ---------- Code/terminal mock ---------- */
.code-mock {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  width: 100%;
  text-align: left;
  padding: 1rem;
  color: var(--text-secondary);
}

.code-mock .ln {
  display: block;
  white-space: pre;
}

.code-mock .key { color: var(--accent); }
.code-mock .str { color: #4ade80; }
.code-mock .com { color: var(--text-faint); font-style: italic; }
.code-mock .num { color: #f59e0b; }

/* ---------- Stacking process ---------- */
.process-stack {
  position: relative;
  display: grid;
  gap: 1.2rem;
}

.process-card {
  position: sticky;
  top: 90px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform var(--t-med) var(--ease);
}

@media (max-width: 880px) {
  .process-card { grid-template-columns: 1fr; }
}

.process-card .num {
  font-family: "URW Gothic", "Inter", sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(140deg, var(--accent), transparent 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.process-card h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
  margin-bottom: 0.7rem;
  letter-spacing: -0.02em;
}

.process-card p {
  color: var(--text-secondary);
}

.process-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.4rem;
}

.process-card ul li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
}

.process-card ul li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

/* ---------- Metric strip with count-up ---------- */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

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

.metric-cell {
  display: grid;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-left: 1px solid var(--border);
}

.metric-cell:first-child { border-left: 0; }

@media (max-width: 880px) {
  .metric-cell { border-left: 0; border-top: 1px solid var(--border); padding-top: 1rem; }
  .metric-cell:nth-child(-n+2) { border-top: 0; padding-top: 0.5rem; }
}

.metric-cell .value {
  font-family: "URW Gothic", "Inter", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.metric-cell .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Insights / blog cards ---------- */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 980px) { .insight-grid { grid-template-columns: 1fr; } }

.insight-card {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--t-med) var(--ease);
}

.insight-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
}

.insight-card .visual {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.insight-card .visual.v1 {
  background:
    radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-soft), var(--surface-strong));
}

.insight-card .visual.v2 {
  background:
    repeating-linear-gradient(45deg, var(--surface) 0 8px, transparent 8px 24px),
    var(--bg-soft);
}

.insight-card .visual.v3 {
  background:
    radial-gradient(circle at 70% 50%, var(--accent-glow), transparent 50%),
    var(--bg-soft);
}

.insight-card .visual::after {
  content: attr(data-label);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insight-card .meta {
  display: flex;
  gap: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insight-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.insight-card h3 a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size var(--t-med) var(--ease);
}

.insight-card:hover h3 a {
  background-size: 100% 1px;
}

.insight-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ---------- Contact section ---------- */
.contact-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.contact-frame {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, var(--accent-soft), transparent 60%),
    var(--bg-soft);
  border: 1px solid var(--border);
  padding: clamp(1.6rem, 4vw, 3rem);
  overflow: hidden;
}

.contact-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.4), transparent 60%);
  pointer-events: none;
  opacity: 0.5;
}

.contact-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 2.5rem;
  z-index: 1;
}

@media (max-width: 980px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.contact-intro h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.6rem 0 1rem;
  letter-spacing: -0.03em;
}

.contact-intro p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 36ch;
}

.contact-channels {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.channel {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--t-fast) var(--ease);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
}

.channel:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateX(2px);
}

.channel-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.channel-icon svg {
  width: 18px;
  height: 18px;
}

.channel-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.channel-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.channel-action {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--t-fast) var(--ease);
}

.channel:hover .channel-action {
  color: var(--accent);
}

.contact-form {
  display: grid;
  gap: 1rem;
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

.field {
  display: grid;
  gap: 0.4rem;
  position: relative;
}

.field label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: all var(--t-fast) var(--ease);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-soft);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-top: 0.4rem;
}

.contact-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.2rem;
}

.contact-status[data-state="success"] { color: var(--success); }
.contact-status[data-state="error"] { color: var(--danger); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 100px);
  z-index: 100;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform var(--t-med) var(--ease-spring), opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast .check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
}

.toast .check svg { width: 12px; height: 12px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.8rem;
  max-width: 32ch;
}

.footer-col h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color var(--t-fast) var(--ease);
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.footer-legal a,
.footer-legal-btn {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: inherit;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.footer-legal a:hover,
.footer-legal-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.footer-legal-btn {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.footer-legal-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Cookie policy table ---------- */
.cookie-table-wrap {
  margin: 1.2rem 0 1.8rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cookie-table thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border);
}

.cookie-table tbody td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-secondary);
}

.cookie-table tbody tr:first-child td {
  border-top: 0;
}

.cookie-table code {
  background: var(--surface-strong);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

/* ---------- Page banners (sub pages) ---------- */
.page-hero {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(2rem, 4vw, 4rem);
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  margin: 0.6rem 0 1rem;
  max-width: 18ch;
}

.page-hero p {
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

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

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}

.reveal-stagger.in > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 300ms; }

/* Scramble text targets get a stable width while animating */
.scramble {
  display: inline-block;
}

/* ---------- Article (blog post) ---------- */
.article {
  width: min(720px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.article header {
  margin-bottom: 2rem;
}

.article h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.article .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  gap: 1rem;
}

.article .visual {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  background:
    radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-soft), var(--surface-strong));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.article .visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.4), transparent 70%);
  opacity: 0.6;
}

.article .visual span {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.6rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.article-content {
  display: grid;
  gap: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-content h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 1.5rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.article-content p,
.article-content li {
  color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
  margin: 0;
  padding-left: 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.article-back:hover { color: var(--accent); }

/* ---------- Mobile nav ---------- */
@media (max-width: 880px) {
  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .site-nav {
    display: none;
    /* Use explicit physical properties + dvh so the drawer always fills
       the visible viewport beneath the header, even with mobile browser
       chrome (address bar) collapsing/expanding. `100vh` historically
       overshoots on mobile Safari/Chrome; `100dvh` tracks the *dynamic*
       viewport. The vh fallback covers the rare older browser. */
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 68px);
    height: calc(100dvh - 68px);
    /* Above the page; below toast (100) and cookie banner (90). */
    z-index: 80;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    align-items: stretch;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
  }

  body.nav-open .site-nav {
    display: flex;
  }

  /* Lock the page beneath the drawer so swipes do not bleed through to
     the page underneath. Keeps the scroll position; restored on close. */
  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .site-nav a {
    /* Compact enough that all 5 items fit on the shortest mobile viewport
       without the drawer needing to scroll. ~46px per item × 5 + drawer
       padding ~36px = ~266px total, well inside any modern phone height. */
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    font-size: 0.98rem;
    line-height: 1.2;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    color: var(--text);
  }

  .site-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
  }

  .cta-header span:not(.sr) {
    display: none;
  }
}

/* ---------- Narrow viewport polish (≤ 640px) ---------- */
@media (max-width: 640px) {
  /* Tighter container padding so content breathes */
  .container,
  .container-narrow,
  .header-inner {
    width: min(var(--max), calc(100% - 2rem));
  }

  /* Hero typography re-tuned for small screens */
  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 3.6rem);
    line-height: 1.04;
  }
  .hero .lead {
    font-size: 1rem;
  }
  .hero-meta {
    gap: 1rem;
  }
  .hero-meta-item strong {
    font-size: 0.98rem;
  }

  /* Dashboard mockup: hide decorative sidebar, simplify stats to 2 cols */
  .dash-body {
    grid-template-columns: 1fr;
  }
  .dash-side {
    display: none;
  }
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-stat .label {
    font-size: 0.58rem;
  }
  .dash-url {
    font-size: 0.68rem;
  }

  /* Header CTA: icon-only on small screens to free space */
  .cta-header span {
    display: none;
  }
  .cta-header {
    padding: 0.5rem;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    justify-content: center;
  }

  /* Channels: prevent long email/URL from breaking layout */
  .channel {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }
  .channel-value {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.9rem;
  }
  .channel-action {
    font-size: 0.7rem;
  }

  /* Section vertical rhythm tighter */
  .section {
    padding: clamp(2.8rem, 8vw, 4.5rem) 0;
  }
  .section-tight {
    padding: clamp(2rem, 6vw, 3rem) 0;
  }

  /* Form: stack send + status cleanly */
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-actions .btn {
    width: 100%;
  }
  .contact-status {
    text-align: center;
  }

  /* Service / process / metric cards: tighter padding */
  .service-card {
    padding: 1.3rem;
  }
  .process-card {
    padding: 1.4rem;
  }
  .metric-strip {
    padding: 1.2rem;
  }
  .metric-cell .value {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  /* Eyebrow line decoration shorter to save room */
  .eyebrow::before {
    width: 1rem;
  }

  /* Page hero tighter */
  .page-hero h1 {
    font-size: clamp(2rem, 8vw, 3.4rem);
  }
}

/* ---------- Very small viewports (≤ 380px) ---------- */
@media (max-width: 380px) {
  .hero h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.6rem);
  }
  h2 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }
  .brand-name {
    display: none;
  }
  /* Hero meta to single column for clarity */
  .hero-meta {
    flex-direction: column;
    gap: 0.8rem;
  }
  /* Container even tighter so content always has air */
  .container,
  .container-narrow,
  .header-inner {
    width: calc(100% - 1.5rem);
  }
  /* Capability card minimum width fits in viewport */
  .capability-card {
    flex: 0 0 88vw;
  }
}

/* ---------- 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;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent);
  color: white;
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.cookie-banner-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(880px, 100%);
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transform: translateY(140%);
  opacity: 0;
  transition:
    transform var(--t-slow) var(--ease-spring),
    opacity var(--t-med) var(--ease);
}

.cookie-banner.show .cookie-banner-inner {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-text {
  flex: 1;
  min-width: 0;
}

.cookie-banner-text strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.cookie-banner-text a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}

.cookie-banner-text a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-banner .btn {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.btn-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.btn-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem;
  }
  .cookie-banner-actions {
    justify-content: flex-end;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .footer, .toast, .spotlight, .cookie-banner, body::before { display: none; }
}
