/* ==========================================================================
   Typescriptz Design System
   White canvas · ink-navy type · one brand blue · six accent hues.
   Living reference: /design-system/

   1. Tokens          5. Components
   2. Hue theming     6. Landing (home) sections
   3. Base            7. Responsive
   4. Shell & layout  8. Motion preferences & print
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Neutrals (cool, slightly blue so they sit well next to the accents) */
  --white: #ffffff;
  --gray-25: #fbfcfe;
  --gray-50: #f8f9fc;
  --gray-100: #f2f4f9;
  --gray-200: #e6e9f1;
  --gray-300: #d3d8e3;
  --gray-400: #98a2b3;
  --gray-500: #5d6b82;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --ink: #0b1220;

  /* Accent hues — 50 wash · 100 tint · 200 border · 500 vivid · 600 solid · 700 text */
  --blue-50: #eff5ff;   --blue-100: #dce8ff;   --blue-200: #bfd3fe;   --blue-500: #3b82f6;   --blue-600: #2563eb;   --blue-700: #1d4ed8;
  --teal-50: #effcfa;   --teal-100: #ccf7f1;   --teal-200: #99ebe2;   --teal-500: #14b8a6;   --teal-600: #0d9488;   --teal-700: #0f766e;
  --amber-50: #fffaeb;  --amber-100: #fef0c7;  --amber-200: #fedf89;  --amber-500: #f59e0b;  --amber-600: #d97706;  --amber-700: #b45309;
  --orange-50: #fff7ed; --orange-100: #ffedd5; --orange-200: #fed7aa; --orange-500: #f97316; --orange-600: #ea580c; --orange-700: #c2410c;
  --rose-50: #fff1f2;   --rose-100: #ffe4e6;   --rose-200: #fecdd3;   --rose-500: #f43f5e;   --rose-600: #e11d48;   --rose-700: #be123c;
  --green-50: #ecfdf5;  --green-100: #d1fae5;  --green-200: #a7f3d0;  --green-500: #10b981;  --green-600: #059669;  --green-700: #047857;
  --red-50: #fef2f2;    --red-100: #fee2e2;    --red-200: #fecaca;    --red-500: #ef4444;    --red-600: #dc2626;    --red-700: #b91c1c;
  /* Cyan is a gradient partner only (blue → cyan → green); it is not a component hue. */
  --cyan-500: #06b6d4;  --cyan-600: #0891b2;   --cyan-700: #0e7490;
  /* The palette deliberately has no purple: every hue sits between rose (347°) and blue (221°)
     going the long way round through orange, amber, green and cyan. Never blend blue with a
     red or pink — the midpoint is purple. */

  /* Semantic roles */
  --color-bg: var(--white);
  --color-bg-subtle: var(--gray-50);
  --color-surface: var(--white);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-heading: var(--ink);
  --color-text: var(--gray-700);
  --color-text-soft: var(--gray-600);
  --color-muted: var(--gray-500);
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-link: var(--blue-700);

  /* Portfolio Blog Option A category tokens (native theme colors, WCAG AA >= 5.18:1 on #fff, zero green) */
  --blog-cat-study: var(--blue-700);
  --blog-cat-howto: var(--orange-700);
  --blog-cat-freebie: var(--rose-700);

  /* Signature gradients */
  --gradient-mark: linear-gradient(135deg, #2563eb 0%, #0891b2 55%, #059669 100%);
  --gradient-spectrum: linear-gradient(90deg, #2563eb 0%, #06b6d4 25%, #10b981 50%, #f59e0b 76%, #f43f5e 100%);
  --gradient-text: linear-gradient(92deg, #2563eb 0%, #0891b2 52%, #059669 100%);
  --gradient-cta: linear-gradient(120deg, #1d4ed8 0%, #0e7490 52%, #047857 100%);
  --gradient-mesh:
    radial-gradient(46% 54% at 8% 4%, rgba(37, 99, 235, 0.13) 0%, rgba(37, 99, 235, 0) 70%),
    radial-gradient(38% 46% at 92% 0%, rgba(6, 182, 212, 0.13) 0%, rgba(6, 182, 212, 0) 70%),
    radial-gradient(34% 40% at 76% 96%, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 70%),
    radial-gradient(30% 36% at 22% 100%, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0) 70%);

  /* Typography */
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  --text-4xl: clamp(1.875rem, 1.35rem + 2.3vw, 2.75rem);
  --text-display: clamp(2.375rem, 1.45rem + 4vw, 3.75rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --section-y: clamp(3.5rem, 2.2rem + 5.2vw, 6rem);
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 1.5rem);

  /* Shape */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --radius: var(--radius-lg);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 3px 8px -2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.04), 0 12px 24px -8px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 24px 48px -12px rgba(16, 24, 40, 0.16);
  --shadow-xl: 0 8px 16px -6px rgba(16, 24, 40, 0.06), 0 40px 80px -20px rgba(16, 24, 40, 0.22);
  --shadow-primary: 0 1px 2px rgba(29, 78, 216, 0.35), 0 8px 18px -8px rgba(37, 99, 235, 0.6);
  --ring: 0 0 0 4px rgba(37, 99, 235, 0.16);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;

  /* Layout */
  --shell-max: 1440px;
  --container-max: 1248px;
  --header-h: 68px;

  /* Legacy aliases — keep older markup and tool scripts on the new palette */
  --bg-canvas: var(--color-bg);
  --bg-card: var(--color-surface);
  --bg-subtle: var(--gray-50);
  --bg-hover: var(--gray-100);
  --border-light: var(--gray-200);
  --border-strong: var(--gray-300);
  --ink-primary: var(--ink);
  --ink-body: var(--gray-600);
  --ink-muted: var(--gray-500);
  --brand-blue: var(--blue-600);
  --brand-blue-hover: var(--blue-700);
  --brand-blue-soft: var(--blue-50);
  --brand-teal: var(--teal-700);
  --brand-teal-soft: var(--teal-50);
  --brand-amber: var(--amber-700);
  --brand-amber-soft: var(--amber-50);
  --success: var(--green-700);
  --success-soft: var(--green-50);
  --warning: var(--amber-700);
  --warning-soft: var(--amber-50);
  --danger: var(--red-700);
  --danger-soft: var(--red-50);
  --shadow-card: var(--shadow-sm);
}

/* 2. HUE THEMING ----------------------------------------------------------
   Put data-hue="blue|teal|amber|rose|orange|green" on any component (or a
   wrapper) and every accent-aware part inside picks up that colour. */
:root,
[data-hue="blue"] {
  --accent: var(--blue-600);
  --accent-vivid: var(--blue-500);
  --accent-text: var(--blue-700);
  --accent-wash: var(--blue-50);
  --accent-tint: var(--blue-100);
  --accent-border: var(--blue-200);
  --accent-glow: rgba(37, 99, 235, 0.32);
}
[data-hue="teal"] {
  --accent: var(--teal-600);
  --accent-vivid: var(--teal-500);
  --accent-text: var(--teal-700);
  --accent-wash: var(--teal-50);
  --accent-tint: var(--teal-100);
  --accent-border: var(--teal-200);
  --accent-glow: rgba(13, 148, 136, 0.32);
}
[data-hue="amber"] {
  --accent: var(--amber-600);
  --accent-vivid: var(--amber-500);
  --accent-text: var(--amber-700);
  --accent-wash: var(--amber-50);
  --accent-tint: var(--amber-100);
  --accent-border: var(--amber-200);
  --accent-glow: rgba(217, 119, 6, 0.32);
}
[data-hue="rose"] {
  --accent: var(--rose-600);
  --accent-vivid: var(--rose-500);
  --accent-text: var(--rose-700);
  --accent-wash: var(--rose-50);
  --accent-tint: var(--rose-100);
  --accent-border: var(--rose-200);
  --accent-glow: rgba(225, 29, 72, 0.3);
}
[data-hue="orange"] {
  --accent: var(--orange-600);
  --accent-vivid: var(--orange-500);
  --accent-text: var(--orange-700);
  --accent-wash: var(--orange-50);
  --accent-tint: var(--orange-100);
  --accent-border: var(--orange-200);
  --accent-glow: rgba(234, 88, 12, 0.3);
}
[data-hue="green"] {
  --accent: var(--green-600);
  --accent-vivid: var(--green-500);
  --accent-text: var(--green-700);
  --accent-wash: var(--green-50);
  --accent-tint: var(--green-100);
  --accent-border: var(--green-200);
  --accent-glow: rgba(5, 150, 105, 0.32);
}

/* Red is semantic (errors, over-limit) — themed so danger components can reuse hue-aware parts. */
[data-hue="red"] {
  --accent: var(--red-600);
  --accent-vivid: var(--red-500);
  --accent-text: var(--red-700);
  --accent-wash: var(--red-50);
  --accent-tint: var(--red-100);
  --accent-border: var(--red-200);
  --accent-glow: rgba(220, 38, 38, 0.3);
}

/* 3. BASE ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.layout-landing {
  --shell-max: var(--container-max);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); letter-spacing: -0.015em; }
h4 { font-size: var(--text-lg); letter-spacing: -0.01em; }

p { text-wrap: pretty; }

strong { font-weight: 700; color: var(--color-heading); }

a {
  color: var(--color-link);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration: underline; }

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

.icon { flex-shrink: 0; display: block; }

::selection { background: var(--blue-100); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

code {
  background: var(--gray-100);
  color: var(--ink);
  padding: 0.12rem 0.38rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-600);
  color: #fff;
  padding: 0.6rem 1.1rem;
  z-index: 200;
  font-weight: 700;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  border-radius: var(--radius-pill);
}

.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Semantic text colours */
.c-good { color: var(--green-700); }
.c-warn { color: var(--amber-700); }
.c-alert { color: var(--red-700); }
.c-data { color: var(--ink); }
.c-muted { color: var(--gray-500); }

/* 4. SHELL & LAYOUT --------------------------------------------------------- */

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(16, 24, 40, 0.07);
}

.header-inner {
  width: 100%;
  max-width: none;
  min-height: var(--header-h);
  margin: 0;
  padding: 0.6rem clamp(1rem, 3.2vw, 3rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-block:hover { text-decoration: none; }

/* Logo tile: the gradient is painted here, the "z" glyph is the inline SVG inside it.
   Geometry lives in src/templates/brand.mjs — 27% radius matches the 17/64 tile corner. */
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 27%;
  background: var(--gradient-mark);
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -6px rgba(8, 145, 178, 0.6);
}

.brand-mark svg { display: block; }

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.brand-title-accent {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--cyan-600);
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--gray-500);
  font-weight: 500;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.nav-tab:hover {
  color: var(--ink);
  background: var(--gray-100);
  text-decoration: none;
}

.nav-tab.active {
  color: var(--blue-700);
  background: var(--blue-50);
  font-weight: 600;
}

.nav-group { position: relative; }

.nav-group > summary { list-style: none; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .icon { transition: transform var(--dur-base) var(--ease-out); opacity: 0.7; }
.nav-group[open] > summary { color: var(--ink); background: var(--gray-100); }
.nav-group[open] > summary .icon { transform: rotate(180deg); }

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: -0.5rem;
  width: min(580px, calc(100vw - 2rem));
  padding: 0.6rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 70;
}

.nav-group[open] > .nav-menu { animation: menu-in var(--dur-base) var(--ease-out); }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.nav-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  color: inherit;
  transition: background-color var(--dur-fast) ease;
}

.nav-menu-item:hover,
.nav-menu-item.active {
  background: var(--accent-wash);
  text-decoration: none;
}

.nav-menu-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.3;
}

.nav-menu-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
  margin-top: 0.1rem;
}

.nav-menu-all {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
}

.nav-menu-all:hover,
.nav-menu-all.active { background: var(--gray-100); text-decoration: none; }
.nav-menu-all span { color: var(--gray-600); font-weight: 500; text-align: right; }

.nav-mobile-extras { display: none; }

.header-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn.mobile-menu-btn { display: none; }

/* Containers & sections */
.container {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: clamp(1rem, 3.2vw, 3rem);
}

.section { padding-block: var(--section-y); }

.section-tint {
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  border-top: 1px solid var(--gray-200);
}

.section-head {
  max-width: 46rem;
  margin: 0 auto clamp(2rem, 1.4rem + 2vw, 3rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.section-head h2 { font-size: var(--text-4xl); letter-spacing: -0.03em; line-height: 1.12; }

.section-head.align-start {
  margin-inline: 0;
  text-align: left;
  align-items: flex-start;
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--gray-600);
  line-height: 1.6;
  max-width: 40rem;
}

/* No eyebrows: nothing — no label, tag row or badge — sits above a headline anywhere on the
   site. Supporting tags go under the lead (.hero-tags) or in a card's footer. */

.display {
  font-size: var(--text-display);
  line-height: 1.05;
  letter-spacing: -0.038em;
  font-weight: 800;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.42vw, 1.25rem);
  line-height: 1.6;
  color: var(--gray-600);
  max-width: 54ch;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--cyan-600);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Highlighter mark — tints the lower half of a phrase in the current hue */
.hl {
  background: linear-gradient(transparent 58%, var(--accent-tint) 58%);
  color: var(--ink);
  font-weight: 700;
  padding: 0 0.12em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Workspace (inner pages): main column + 300px sticky rail */
.top-ad-band {
  max-width: var(--shell-max);
  margin: 1.1rem auto 0;
  padding: 0 var(--gutter);
}

.workspace-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

.main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.right-rail {
  width: 300px;
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rail-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.rail-panel-header {
  padding: 1rem 1.1rem 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

.rail-panel-body {
  padding: 0.35rem 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.rail-link:hover {
  background: var(--gray-100);
  color: var(--ink);
  text-decoration: none;
}

.rail-link.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}

/* Breadcrumbs & inner-page hero */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.breadcrumbs a { color: var(--gray-600); font-weight: 500; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gradient-mesh);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--gradient-spectrum);
}

/* Page tags: always rendered after the headline and lead, never above them */
.hero-tags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.page-h1 {
  font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.12;
}

.page-lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--gray-600);
  max-width: 68ch;
}

/* Footer */
.site-footer {
  position: relative;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-25);
  padding: 3.5rem clamp(1rem, 3.2vw, 3rem) 2rem;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto 0;
  height: 3px;
  background: var(--gradient-spectrum);
}

.footer-inner {
  width: 100%;
  max-width: none;
  margin: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-about {
  font-size: 0.9rem;
  color: var(--gray-600);
  max-width: 34ch;
  margin-top: 0.9rem;
}

.footer-heading {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.footer-links a { color: var(--gray-600); }
.footer-links a:hover { color: var(--blue-700); }

.footer-bottom {
  border-top: 1px solid var(--gray-200);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.footer-bottom a { color: var(--gray-600); }

/* 5. COMPONENTS ------------------------------------------------------------ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease,
    box-shadow var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}

.btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #ffffff;
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-soft {
  background: var(--accent-wash);
  border-color: var(--accent-border);
  color: var(--accent-text);
  box-shadow: none;
}

.btn-soft:hover { background: var(--accent-tint); border-color: var(--accent-border); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--gray-700);
  box-shadow: none;
}

.btn-ghost:hover { background: var(--gray-100); border-color: transparent; color: var(--ink); }

.btn-white {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(11, 18, 32, 0.45);
}

.btn-white:hover { background: var(--gray-50); border-color: var(--gray-50); transform: translateY(-1px); }

.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  box-shadow: none;
}

.btn-glass:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.7); }

.btn-success {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-700);
}

.btn-lg {
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
}

.btn .arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .btn-icon { width: 44px; min-height: 44px; }
  .nav-tab { min-height: 44px; }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.badge-success { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
.badge-warning { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
.badge-danger { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.badge-rose { background: var(--rose-50); color: var(--rose-700); border-color: var(--rose-200); }
.badge-orange { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-200); }
.badge-teal { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-200); }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.badge-accent { background: var(--accent-wash); color: var(--accent-text); border-color: var(--accent-border); }

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Icon tiles */
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-text) 100%);
  box-shadow: 0 8px 16px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.icon-tile-soft {
  background: var(--accent-tint);
  color: var(--accent-text);
  box-shadow: none;
}

.icon-tile-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: clamp(1.15rem, 0.9rem + 1vw, 1.6rem);
  box-shadow: var(--shadow-sm);
}

.card > h2,
.card > div > h2 {
  font-size: var(--text-xl);
  margin-bottom: 0.85rem;
}

.card > p { color: var(--gray-600); }

.card-elevated {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, box-shadow var(--dur-base) ease,
    transform var(--dur-base) var(--ease-out);
}

a.card-elevated { color: var(--ink); }

a.card-elevated:hover {
  background: var(--white);
  border-color: var(--blue-200);
  box-shadow: 0 12px 24px -14px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Feature card — hue-aware product tile */
.feature-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.35rem, 1rem + 1.4vw, 1.9rem);
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}

.feature-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  right: -120px;
  top: -150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-tint), rgba(255, 255, 255, 0));
  transition: transform 0.5s var(--ease-out);
}

a.feature-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 24px 44px -24px var(--accent-glow), var(--shadow-sm);
  transform: translateY(-4px);
  text-decoration: none;
}

a.feature-card:hover::before { transform: scale(1.25); }

.feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.feature-card h3 { font-size: 1.3rem; }

.feature-card p {
  color: var(--gray-600);
  font-size: 0.98rem;
  line-height: 1.6;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-text);
}

/* Card footer: the link on the left, the card's tag on the right (tags never sit above a title) */
.feature-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.25rem;
}

.feature-foot .feature-link { margin-top: 0; padding-top: 0; }

.feature-link .icon { transition: transform var(--dur-base) var(--ease-out); }
a:hover > .feature-link .icon,
.feature-link:hover .icon { transform: translateX(4px); }

/* Mini code / output sample */
.mini-code {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border);
  color: var(--gray-700);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mini-code b { color: var(--accent-text); font-weight: 700; }
.mini-code i { color: var(--gray-600); font-style: normal; }

/* Stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-vivid));
}

.stat dd {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--accent-text);
}

.stat dt {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-600);
  line-height: 1.4;
}

/* Form controls */
.input-field,
.select-field,
.textarea-field {
  width: 100%;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.85rem;
  font-size: 16px;
  line-height: 1.45;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.input-field.mono,
.textarea-field.mono { font-family: var(--font-mono); font-size: 0.9rem; }

.input-field::placeholder,
.textarea-field::placeholder { color: var(--gray-400); }

.input-field:hover,
.select-field:hover,
.textarea-field:hover { border-color: var(--gray-400); }

.input-field:focus,
.select-field:focus,
.textarea-field:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: var(--ring);
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.3rem;
}

input[type="checkbox"],
input[type="radio"] { accent-color: var(--blue-600); }

.check {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1.5px solid var(--gray-400);
  border-radius: 7px;
  background: var(--white) center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.check:hover { border-color: var(--green-600); }

.check:checked {
  background-color: var(--green-600);
  border-color: var(--green-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.search-bar-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-bar-form .input-field { flex: 1 1 260px; }

/* KPI tiles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  /* The value leads and its label sits underneath — no small label above big text */
  display: flex;
  flex-direction: column;
}

.kpi-label {
  order: 1;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  order: 0;
  line-height: 1.15;
  color: var(--ink);
}

.kpi-value.c-good { color: var(--green-700); }
.kpi-value.c-warn { color: var(--amber-700); }
.kpi-value.c-alert { color: var(--red-700); }

.kpi-sub {
  order: 2;
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.15rem;
  align-items: start;
}

/* Tabs */
.tab-strip {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.8rem;
  margin-bottom: 1.1rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.tab-btn:hover { background: var(--gray-100); color: var(--ink); }

.tab-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* Code output */
.code-output {
  background: var(--ink);
  border: 1px solid #1c2740;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e6eaf2;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 440px;
  overflow-y: auto;
}

/* Tables */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--gray-25); }

.hue-key {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.hue-key::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Long-form prose blocks */
.prose-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 0.9rem + 1.6vw, 2rem);
  box-shadow: var(--shadow-sm);
}

.prose-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 0.85rem;
}

.prose-section h3 {
  font-size: var(--text-lg);
  margin: 1.35rem 0 0.5rem;
}

.prose-section p {
  color: var(--gray-600);
  margin-bottom: 1rem;
  max-width: 72ch;
}

.prose-section ul,
.prose-section ol {
  margin: 0.5rem 0 1.1rem 1.35rem;
  color: var(--gray-600);
  max-width: 70ch;
}

.prose-section li { margin-bottom: 0.5rem; }
.prose-section li::marker { color: var(--blue-600); font-weight: 700; }

/* Google SERP preview (mirrors Google's own type and colours on purpose) */
.serp-preview-box {
  background: #ffffff;
  color: #202124;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  font-family: Arial, sans-serif;
  border: 1px solid #dadce0;
}

.serp-preview-box.mobile { max-width: 390px; }

.serp-site-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
}

.serp-favicon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8f0fe;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a73e8;
  flex-shrink: 0;
}

.serp-site-name {
  font-size: 13px;
  color: #202124;
  line-height: 1.2;
}

.serp-breadcrumb {
  font-size: 12px;
  color: #4d5156;
  line-height: 1.2;
}

.serp-title-link {
  font-size: 20px;
  line-height: 1.3;
  color: #1a0dab;
  font-weight: 400;
  margin: 0.18rem 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.serp-preview-box.mobile .serp-title-link {
  font-size: 18px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.serp-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #4d5156;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-base) ease;
}

.faq-item:hover { border-color: var(--gray-300); }

.faq-item[open] {
  border-color: var(--blue-200);
  box-shadow: 0 12px 28px -18px rgba(37, 99, 235, 0.4);
}

.faq-item summary {
  padding: 1rem 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

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

.faq-item summary::after {
  content: "";
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gray-100)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E")
    center / 14px 14px no-repeat;
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  background-color: var(--blue-50);
}

.faq-answer {
  padding: 0 1.15rem 1.1rem;
  color: var(--gray-600);
  font-size: 0.96rem;
  max-width: 72ch;
}

/* Callouts */
.answer-first-box {
  background: var(--white);
  border: 1px solid var(--blue-200);
  border-left: 4px solid var(--blue-600);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  color: var(--gray-700);
  font-size: 0.98rem;
  line-height: 1.6;
  box-shadow: var(--shadow-xs);
}

.action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.action-bar .action-status {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--green-700);
  margin-left: 0.25rem;
}

.author-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: var(--gray-600);
}

.hero-diagram-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.hero-diagram-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-diagram-caption {
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Promo / ad containers (fixed heights keep layout shift at zero) */
.ad-slot {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot[data-hue] {
  border-color: var(--accent-border);
  background: linear-gradient(120deg, var(--accent-wash) 0%, var(--white) 62%);
}

.ad-slot[data-hue]::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 280px;
  height: 280px;
  right: -90px;
  bottom: -170px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-tint), rgba(255, 255, 255, 0));
}

.ad-slot-leaderboard {
  width: 100%;
  max-width: 970px;
  min-height: 54px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem 0.8rem;
}

@media (min-width: 768px) {
  .ad-slot-leaderboard { min-height: 90px; }
}

.ad-slot-rail {
  width: 300px;
  min-height: 600px;
  flex-direction: column;
  padding: 1.75rem 1.35rem;
}

.ad-slot-incontent {
  width: 100%;
  min-height: 250px;
  padding: 1.75rem clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
}

.ad-label-pill {
  position: absolute;
  bottom: 9px;
  right: 14px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

.ad-house-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
}

.ad-slot-rail .ad-house-inner {
  flex-direction: column;
  text-align: center;
  justify-content: center;
  gap: 1.1rem;
}

.ad-house-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.3;
}

.ad-slot-incontent .ad-house-title,
.ad-slot-rail .ad-house-title { font-size: 1.3rem; }

.ad-house-copy {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
  max-width: 52ch;
}

/* Consent banner */
.consent-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 950;
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1.15rem;
}

.consent-banner[hidden] { display: none; }

.consent-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.consent-text {
  flex: 1 1 320px;
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.consent-toggle-link {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.consent-toggle-link:hover { color: var(--blue-700); }

.print-watermark { display: none; }

/* 6. LANDING (HOME) SECTIONS ------------------------------------------------ */
.landing { display: block; }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: clamp(2.75rem, 1.6rem + 5vw, 5.5rem) clamp(2.75rem, 2rem + 3.4vw, 4.75rem);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gradient-mesh);
  -webkit-mask-image: linear-gradient(#000 62%, transparent 100%);
  mask-image: linear-gradient(#000 62%, transparent 100%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(16, 24, 40, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 62% at 50% 34%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 62% at 50% 34%, #000 0%, transparent 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.97fr) minmax(0, 1.03fr);
  gap: clamp(2rem, 0.5rem + 4.4vw, 4rem);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.35rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.hero-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-600);
}

.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-trust .icon {
  color: #fff;
  background: var(--green-600);
  border-radius: 50%;
  padding: 3px;
  width: 18px;
  height: 18px;
}

.hero-visual { position: relative; }

/* Demo window (browser-style frame) */
.window {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -30px rgba(8, 145, 178, 0.45), var(--shadow-lg);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.window-dots { display: inline-flex; gap: 6px; }

.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red-500);
}

.window-dots i:nth-child(2) { background: var(--amber-500); }
.window-dots i:nth-child(3) { background: var(--green-500); }

.window-url {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--gray-200);
  font-size: 0.78rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-url .icon { color: var(--green-600); }

.window-body {
  padding: clamp(1.1rem, 0.8rem + 1.2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* The demo box is narrower than Google's 580px title line, so the title scales with the box:
   a headline that fits on Google stays on one line here, and only cut-off words wrap. */
.demo-serp { container-type: inline-size; }

.demo-serp .serp-title-link {
  font-size: 16px;
  font-size: clamp(15px, 3.42cqw, 20px);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.serp-cut {
  color: var(--red-700);
  background: var(--red-50);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  border-radius: 3px;
}

.meter { display: flex; flex-direction: column; gap: 0.4rem; }

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.meter-head strong { font-family: var(--font-mono); font-size: 0.86rem; }

.meter-track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  box-shadow: inset 0 0 0 1px var(--gray-200);
}

.meter-fill {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-500), var(--green-600));
  transition: width var(--dur-base) var(--ease-out);
}

.meter[data-state="warn"] .meter-fill { background: linear-gradient(90deg, var(--amber-500), var(--amber-600)); }
.meter[data-state="over"] .meter-fill { background: linear-gradient(90deg, var(--red-500), var(--red-600)); }

/* 580px limit marker sits at 80% of the track (track = 725px of title width) */
.meter-track::after {
  content: "";
  position: absolute;
  left: 80%;
  top: -4px;
  bottom: -4px;
  width: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.meter-scale {
  position: relative;
  height: 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
}

.meter-scale span { position: absolute; top: 0; }
.meter-scale span:last-child { left: 80%; transform: translateX(-50%); color: var(--ink); white-space: nowrap; }

.demo-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-height: 2rem;
  font-size: 0.88rem;
  color: var(--gray-600);
}

.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.demo-foot > span { flex: 1 1 220px; font-size: 0.84rem; line-height: 1.45; color: var(--gray-500); }

/* Floating chips around the demo */
.float-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem 0.5rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--accent-border);
  box-shadow: 0 14px 28px -14px var(--accent-glow), var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  animation: chip-float 7s ease-in-out infinite;
}

.float-chip .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-text);
}

.float-chip.pos-a { top: -32px; left: -26px; }
.float-chip.pos-b { top: 5px; right: -34px; animation-delay: -2.4s; }
.float-chip.pos-c { bottom: -28px; left: 34px; animation-delay: -4.6s; }

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

/* Summary statement + stats */
.statement-band { padding-block: clamp(0.5rem, 0.2rem + 1.2vw, 1.25rem) clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

.statement {
  max-width: 58rem;
  margin: 0 auto clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  text-align: center;
  font-size: clamp(1.1rem, 0.98rem + 0.62vw, 1.4rem);
  font-weight: 500;
  line-height: 1.6;
  color: var(--gray-700);
  text-wrap: balance;
}

.statement code { font-size: 0.86em; background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-200); }

.statement-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.45rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

/* Tools */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 0.7rem + 1.2vw, 1.5rem);
}

.compare-card {
  margin-top: clamp(1.25rem, 0.9rem + 1.4vw, 2rem);
  padding: clamp(1.25rem, 1rem + 1.2vw, 1.9rem);
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.compare-head p { color: var(--gray-600); font-size: 0.95rem; }

.compare-card .data-table { min-width: 680px; }

/* Launch checklist */
.checklist-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(2rem, 0.8rem + 4.4vw, 4.5rem);
  align-items: start;
}

.checklist-intro {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.checklist-intro .section-head { margin-bottom: 0; }
.checklist-intro .section-sub { font-size: var(--text-md); }

.diagram {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.diagram-stage { position: relative; }
.diagram-stage img { display: block; width: 100%; height: auto; }

/* Labels are pinned to the four bars baked into the diagram image */
.diagram-label {
  position: absolute;
  left: 16%;
  transform: translateY(-50%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.66rem, 0.3rem + 1.05vw, 0.92rem);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(11, 18, 32, 0.35);
}

.diagram-label:nth-of-type(1) { top: 29.5%; }
.diagram-label:nth-of-type(2) { top: 44.5%; }
.diagram-label:nth-of-type(3) { top: 57.5%; }
.diagram-label:nth-of-type(4) { top: 70.5%; }

.diagram figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.checklist-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(1.15rem, 0.9rem + 1.2vw, 1.75rem);
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.checklist-head strong { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -0.015em; }

.progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  box-shadow: inset 0 0 0 1px var(--gray-200);
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: inherit;
  background: var(--gradient-spectrum);
  transition: width 0.45s var(--ease-out);
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.check-item:hover { border-color: var(--gray-300); }

.check-item.is-done {
  background: var(--green-50);
  border-color: var(--green-200);
}

.check-item label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
}

.check-item .check { margin-top: 0.1rem; }

/* Each step's checkbox ring carries its tool hue until it is ticked */
.check-item .check:not(:checked) { border: 2px solid var(--accent); }

.check-label {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.check-item.is-done .check-label { color: var(--gray-600); }

.checklist-note {
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Lower zone: long-form content + sticky rail */
.split-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(2rem, 0.6rem + 4.6vw, 4.5rem);
  align-items: start;
  padding-block: clamp(1rem, 0.6rem + 1.6vw, 2rem) var(--section-y);
}

.layout-landing .main-column { gap: clamp(2.25rem, 1.8rem + 2vw, 3.5rem); }

.layout-landing .prose-section {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.layout-landing .prose-section > h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.028em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.layout-landing .prose-section > p { font-size: 1.04rem; line-height: 1.7; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border);
  color: var(--color-text);
  transition: box-shadow var(--dur-base) ease, transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) ease;
}

a.guide-card:hover {
  background: var(--white);
  box-shadow: 0 20px 36px -22px var(--accent-glow);
  transform: translateY(-3px);
  text-decoration: none;
}

.guide-card .icon-tile { margin-bottom: 0.25rem; }
.guide-card .badge { align-self: flex-start; background: var(--white); margin-top: auto; }
.guide-card h3 { font-size: 1.08rem; margin: 0; }
.layout-landing .guide-card p { font-size: 0.92rem; line-height: 1.55; color: var(--gray-600); margin: 0; }

.audience-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.4rem, 1rem + 1.8vw, 2.25rem);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.audience-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gradient-mesh);
}

.layout-landing .audience-panel.prose-section {
  padding: clamp(1.4rem, 1rem + 1.8vw, 2.25rem);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.layout-landing .audience-panel.prose-section > p:last-child { margin-bottom: 0; }

/* Closing call-to-action */
.cta-section { padding-block: 0 var(--section-y); }

.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(2.25rem, 1.4rem + 4.4vw, 4.25rem) clamp(1.25rem, 0.5rem + 4vw, 4rem);
  color: #ffffff;
  background: var(--gradient-cta);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 40px 80px -40px rgba(14, 116, 144, 0.6);
}

.cta-band::before,
.cta-band::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}

.cta-band::before { width: 420px; height: 420px; left: -140px; top: -220px; }
.cta-band::after { width: 520px; height: 520px; right: -180px; bottom: -330px; }

.cta-band h2 {
  color: #ffffff;
  font-size: var(--text-4xl);
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 22ch;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--text-lg);
  max-width: 46ch;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

/* Style-guide helpers (/design-system/) */
.ds-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.75rem;
}

.ds-swatch {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  font-size: 0.78rem;
}

.ds-swatch i {
  display: block;
  height: 56px;
  background: var(--swatch);
  border-bottom: 1px solid rgba(16, 24, 40, 0.06);
}

.ds-swatch span { display: block; padding: 0.45rem 0.65rem 0; font-weight: 600; color: var(--ink); }
.ds-swatch code { display: inline-block; margin: 0.2rem 0.65rem 0.55rem; padding: 0; background: none; color: var(--gray-600); }

.ds-ramp {
  display: grid;
  grid-template-columns: 5.5rem repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.ds-ramp i {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--swatch);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
}

.ds-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.ds-stack { display: flex; flex-direction: column; gap: 1rem; }

.ds-type-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.ds-type-row:last-child { border-bottom: 0; }
.ds-type-row > span { font-family: var(--font-mono); font-size: 0.76rem; color: var(--gray-500); }

.ds-gradient {
  height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.ds-logo-stage {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--white);
}

.ds-logo-stage svg { max-width: 100%; height: auto; }
.ds-logo-stage-dark { background: var(--ink); border-color: var(--ink); }

.ds-logo-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem;
}

.ds-logo-sizes figure { display: grid; justify-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--gray-500); }

.ds-shadow {
  display: grid;
  place-items: center;
  width: 120px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--gray-600);
}

/* 7. RESPONSIVE ------------------------------------------------------------- */
@media (max-width: 1120px) {
  .workspace-shell { grid-template-columns: minmax(0, 1fr); }

  .right-rail {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .ad-slot-rail {
    width: 100%;
    min-height: 250px;
  }

  .workbench-grid,
  .grid-2,
  .grid-3 { grid-template-columns: minmax(0, 1fr); }

  .split-zone { grid-template-columns: minmax(0, 1fr); }
}

/* Chips hang outside the demo window, so they need real margin around the container */
@media (max-width: 1240px) {
  .float-chip { display: none; }
}

@media (max-width: 1000px) {
  .hero-grid,
  .checklist-layout { grid-template-columns: minmax(0, 1fr); }

  .checklist-intro { position: static; }

  .hero-copy { align-items: center; text-align: center; }
  .hero-actions,
  .hero-trust { justify-content: center; }
  .hero .lead { margin-inline: auto; }
  .hero-visual { width: 100%; max-width: 640px; margin-inline: auto; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .btn.mobile-menu-btn {
    display: inline-flex;
    margin-left: auto;
    order: 3;
  }

  .header-inner { gap: 0.75rem; }

  .header-cta { order: 2; margin-left: auto; }
  .header-cta .btn-icon { display: none; }

  .page-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.75rem var(--gutter) 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .page-nav.open { display: flex; }

  .nav-tab {
    min-height: 48px;
    padding-inline: 0.85rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    justify-content: space-between;
  }

  .nav-menu {
    position: static;
    width: auto;
    grid-template-columns: 1fr;
    padding: 0.25rem 0 0.5rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-group[open] > .nav-menu { animation: none; }
  .nav-group > summary { display: flex; }
  .nav-menu-all { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .nav-menu-all span { text-align: left; }

  .nav-mobile-extras {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
  }
}

@media (max-width: 760px) {
  .feature-grid,
  .guide-grid { grid-template-columns: minmax(0, 1fr); }

  .hero-actions .btn { flex: 1 1 100%; }

  .check-item { align-items: flex-start; flex-wrap: wrap; }
  .check-item label { flex-basis: 100%; }
  .check-item .btn { margin-left: calc(22px + 0.8rem); }

  .ad-house-inner { flex-direction: column; align-items: flex-start; }
  .ad-slot-rail .ad-house-inner { align-items: center; }

  .ds-type-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (max-width: 560px) {
  .header-cta { display: none; }
  .btn.mobile-menu-btn { margin-left: auto; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .stat { padding: 1rem; }
  .window-bar .badge { display: none; }
  .cta-actions .btn { flex: 1 1 100%; }
}

/* 8. MOTION PREFERENCES & PRINT --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .top-header,
  .top-ad-band,
  .right-rail,
  .blog-rail,
  .ad-slot,
  .action-bar,
  .consent-banner,
  .site-footer,
  .cta-section,
  .float-chip,
  .hero-bg {
    display: none !important;
  }

  .workspace-shell,
  .blog-shell,
  .split-zone {
    display: block;
    padding: 0;
  }

  body { background: #ffffff; }

  .card,
  .prose-section,
  .page-hero,
  .window,
  .feature-card {
    box-shadow: none;
    border-color: #cbd5e1;
  }

  .print-watermark {
    display: block;
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #cbd5e1;
    font-size: 11px;
    color: #475569;
  }
}

/* ==========================================================================
   9. UNIFIED FULL-WIDTH RESPONSIVE PAGE SYSTEM
   ========================================================================== */
.ad-slot[hidden] {
  display: none !important;
}

.top-header .nav-tab {
  min-height: 44px;
}

.page-main {
  width: 100%;
}

.unified-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  padding-block: clamp(2.75rem, 2rem + 3vw, 5rem);
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  text-align: center;
}

.unified-hero .breadcrumbs {
  justify-content: center;
  margin-bottom: 0.9rem;
}

.unified-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.12;
  color: var(--ink);
  max-width: 26ch;
  margin-inline: auto;
}

.unified-lead {
  margin-top: 0.85rem;
  margin-inline: auto;
  font-size: clamp(1.05rem, 0.96rem + 0.4vw, 1.22rem);
  line-height: 1.62;
  color: var(--gray-600);
  max-width: 62ch;
}

.unified-hero .hero-actions {
  margin-top: 1.5rem;
  justify-content: center;
}

.unified-body {
  width: 100%;
}

.full-section {
  width: 100%;
  padding-block: clamp(2.5rem, 1.8rem + 2.6vw, 4.25rem);
}

.full-section + .full-section {
  border-top: 1px solid var(--gray-100);
}

.full-section-tint {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.35rem, 1rem + 1.2vw, 2rem);
}

.section-bar h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.025em;
}

.section-bar p {
  color: var(--gray-600);
  font-size: 1rem;
  margin-top: 0.35rem;
  max-width: 64ch;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1rem, 0.7rem + 1vw, 1.5rem);
  width: 100%;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.empty-state {
  width: 100%;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  text-align: center;
}

.empty-state h3 {
  font-size: 1.22rem;
  margin-bottom: 0.45rem;
}

.empty-state p {
  color: var(--gray-600);
  max-width: 52ch;
  margin: 0 auto;
}

.prose-wide {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
}

/* Live URL Site Checker & Report UI */
.hero-checker-wrap {
  max-width: 720px;
  margin: 1.65rem auto 0;
}

.url-check-form {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  background: var(--white);
  padding: 0.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-md);
}

.url-check-form .input-field {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 1.1rem;
  font-size: 1rem;
  min-width: 0;
  flex: 1;
}

.url-check-form .input-field:focus {
  outline: none;
  box-shadow: none;
}

.url-check-form:focus-within {
  border-color: var(--blue-600);
  box-shadow: var(--ring), var(--shadow-md);
}

.url-sample-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
  font-size: 0.84rem;
  color: var(--gray-500);
}

.sample-link-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.sample-link-btn:hover {
  background: var(--blue-50);
  border-color: var(--blue-200);
  color: var(--blue-700);
}

.checker-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  min-height: 1.3rem;
}

.checker-results-band[hidden] {
  display: none !important;
}

.checker-results-band {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.report-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.report-summary-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.65rem 1.05rem;
  border-radius: var(--radius-md);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
}

.score-num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.score-den {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.8;
}

.report-domain {
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--gray-600);
  margin: 0;
}

.report-summary-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.preview-head h3 {
  margin: 0;
}

.social-card-preview {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.social-card-img-wrap {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: var(--gray-100);
  overflow: hidden;
}

.social-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.social-card-img-empty {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.86rem;
  border-bottom: 1px solid var(--gray-200);
}

.social-card-body {
  padding: 0.9rem 1.05rem;
}

.social-card-domain {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.social-card-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.social-card-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.45;
}

.check-results-list {
  display: grid;
  gap: 0.7rem;
}

.check-result-row {
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: var(--gray-25);
}

.check-result-row[data-status="fail"] {
  background: var(--red-50);
  border-color: var(--red-200);
}

.check-result-row[data-status="warn"] {
  background: var(--amber-50);
  border-color: var(--amber-200);
}

.check-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.check-result-found {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--ink);
  margin-bottom: 0.2rem;
  word-break: break-word;
}

.check-result-advice {
  font-size: 0.88rem;
  color: var(--gray-700);
}

.snapshot-list {
  list-style: disc;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

@media (max-width: 640px) {
  .url-check-form {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
  }
  .url-check-form .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   10. BLOG ARTICLE 2-COLUMN SHELL + 300PX STICKY RIGHT RAIL
   ========================================================================== */
.blog-article-band {
  padding-block: clamp(2rem, 1.4rem + 2vw, 3.5rem);
}

.blog-container {
  max-width: var(--container-max);
  margin-inline: auto;
}

.blog-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(1.5rem, 2.4vw, 2.5rem);
  align-items: start;
}

.blog-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-main > .prose-section + .prose-section,
.blog-main > .card {
  margin: 0;
}

.blog-overview-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-quick-cite {
  background: var(--accent-wash);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.blog-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.blog-stat-grid .stat {
  padding: 0.95rem 1.05rem 1rem;
}

.blog-stat-grid .stat dd {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
}

.blog-stat-grid .stat dt {
  font-size: 0.82rem;
}

.blog-chart-card,
.blog-table-card {
  margin: 0 !important;
}

.why-matters-box {
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-wash) 0%, var(--white) 48%);
}

.blog-rail {
  width: 300px;
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
}

.blog-toc-links .rail-link {
  font-size: 0.86rem;
  line-height: 1.38;
  padding: 0.45rem 0.65rem;
}

.blog-rail-card {
  position: relative;
}

.blog-rail-card::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-vivid));
}

.blog-rail-card-body {
  padding: 0.45rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.blog-rail-card-body h3 {
  font-size: 1.02rem;
  line-height: 1.3;
  margin: 0;
}

.blog-rail-card-body h3 a {
  color: var(--ink);
}

.blog-rail-card-body p {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--gray-600);
  margin: 0;
}

.blog-rail-cta {
  width: 100%;
  margin-top: 0.25rem;
}

.blog-sources-summary {
  font-weight: 600;
  color: var(--ink) !important;
}

.blog-sources-links {
  list-style: none;
  padding: 0;
  margin: 0.15rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.83rem;
}

.blog-sources-jump {
  display: inline-flex;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--blue-700);
  margin-top: 0.2rem;
}

/* ==========================================================================
   11. PORTFOLIO BLOG OPTION A (3-COL GRID, FILTER TABS, HEADER COVERS, DOTS)
   ========================================================================== */
.blog-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.blog-filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.blog-filter-tab:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  color: var(--ink);
}

.blog-filter-tab.is-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}

.blog-filter-tab:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.blog-card,
.blog-hero-meta {
  --blog-cat: var(--blog-cat-study);
}

.blog-card[data-blog-type="data-study"],
.blog-hero-meta[data-blog-type="data-study"] {
  --blog-cat: var(--blog-cat-study);
  --blog-cat-border: var(--blue-200);
  --blog-cat-glow: rgba(29, 78, 216, 0.22);
}

.blog-card[data-blog-type="how-to"],
.blog-hero-meta[data-blog-type="how-to"] {
  --blog-cat: var(--blog-cat-howto);
  --blog-cat-border: var(--orange-200);
  --blog-cat-glow: rgba(194, 65, 12, 0.2);
}

.blog-card[data-blog-type="freebies"],
.blog-hero-meta[data-blog-type="freebies"] {
  --blog-cat: var(--blog-cat-freebie);
  --blog-cat-border: var(--rose-200);
  --blog-cat-glow: rgba(190, 18, 60, 0.2);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}

.blog-card:hover {
  border-color: var(--blog-cat-border, var(--blue-200));
  box-shadow: 0 22px 40px -24px var(--blog-cat-glow, rgba(29, 78, 216, 0.22)), var(--shadow-sm);
  transform: translateY(-4px);
  text-decoration: none;
}

.blog-card-media {
  width: 100%;
  height: 175px;
  overflow: hidden;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.blog-card-media img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  display: block;
  transition: transform 0.38s var(--ease-out);
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.03);
}

.blog-card-body {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.blog-card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.blog-type-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--blog-cat);
}

.blog-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.blog-card-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  transition: color var(--dur-fast) ease;
}

.blog-card:hover .blog-card-title {
  color: var(--blog-cat);
}

.blog-card-summary {
  font-size: 0.91rem;
  line-height: 1.56;
  color: var(--gray-600);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blog-cat);
}

.blog-card-arrow {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}

.blog-card:hover .blog-card-arrow {
  transform: translateX(3px);
}

.blog-hero-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.blog-hero-sep {
  color: var(--gray-400);
  font-weight: 600;
}

.blog-hero-date {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.blog-article-cover {
  margin: 0;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  box-shadow: var(--shadow-sm);
}

.blog-article-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .blog-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .blog-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .blog-rail {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 520px) {
  .blog-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


