/* Self-hosted Outfit + Inter + JetBrains Mono (latin subset, variable weight). SIL OFL 1.1 — see assets/fonts/. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   InsightsMastery Academy — design tokens
   Mirrors the parent site (www.insightsmastry.in): slate neutrals, cyan/teal
   brand, Outfit display type over Inter, 8–12px radii, quiet shadows.
   Light theme = :root defaults. Dark theme = [data-theme="dark"].
   ========================================================================== */

:root {
  /* --- Font families ----------------------------------------------------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Outfit", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular,
    Consolas, "Liberation Mono", monospace;

  /* --- Fluid type scale (clamp: min, preferred, max) --------------------- */
  --step--2: clamp(0.694rem, 0.68rem + 0.07vw, 0.75rem);
  --step--1: clamp(0.833rem, 0.81rem + 0.11vw, 0.9rem);
  --step-0: clamp(0.975rem, 0.95rem + 0.13vw, 1.05rem);
  --step-1: clamp(1.17rem, 1.12rem + 0.25vw, 1.31rem);
  --step-2: clamp(1.4rem, 1.31rem + 0.44vw, 1.64rem);
  --step-3: clamp(1.68rem, 1.53rem + 0.75vw, 2.05rem);
  --step-4: clamp(2.02rem, 1.77rem + 1.24vw, 2.56rem);
  --step-5: clamp(2.42rem, 2.03rem + 1.95vw, 3.2rem);
  --step-6: clamp(2.9rem, 2.29rem + 3.05vw, 4rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;
  --tracking-tight: -0.025em;
  --tracking-wide: 0.02em;
  --tracking-eyebrow: 0.1em;

  /* --- Space scale ------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-11: 6.5rem;
  --space-12: 8rem;

  /* --- Radii ------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* --- Layout ------------------------------------------------------------ */
  --container: 1152px;
  --container-narrow: 760px;
  --header-h: 80px;
  --reader-measure: 72ch;

  /* --- Motion ------------------------------------------------------------ */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 520ms;
  --dur-5: 800ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z layers ---------------------------------------------------------- */
  --z-canvas: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-toast: 400;

  /* --- Brand ramp (parent site: cyan + deep teal) ------------------------ */
  --cyan-50: #ecfeff;
  --cyan-100: #cffafe;
  --cyan-200: #a5f3fc;
  --cyan-300: #67e8f9;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --cyan-700: #0e7490;
  --cyan-800: #155e75;
  --cyan-900: #164e63;
  --teal-deep: #166387;
  /* The parent site's header banner. */
  --banner-gradient: linear-gradient(89.43deg, #5b9bb9 0.84%, #70acc8 30.78%, #599ab8 65.8%, #166387 85.55%);

  /* --- Neutral ramp (slate) --------------------------------------------- */
  --slate-0: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* --- Semantic surface / text (LIGHT) ---------------------------------- */
  --bg: var(--slate-50);
  --bg-deep: var(--slate-100);
  --surface: var(--slate-0);
  --surface-2: var(--slate-50);
  --surface-3: var(--slate-100);
  --surface-inset: var(--slate-50);
  --border: var(--slate-200);
  --border-strong: var(--slate-300);
  --text: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-500);
  --text-subtle: var(--slate-400);
  --text-inverse: var(--slate-0);

  --accent: var(--cyan-600);
  --accent-hover: var(--cyan-500);
  --accent-text: var(--cyan-700);
  --accent-soft: var(--cyan-50);
  --accent-soft-strong: var(--cyan-100);
  --accent-border: var(--cyan-100);
  --accent-contrast: #ffffff;

  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --info: #0369a1;
  --info-soft: #f0f9ff;

  /* --- Glass / gradients (LIGHT) ---------------------------------------- */
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-bg-strong: rgba(255, 255, 255, 0.97);
  --glass-border: var(--slate-200);
  --glass-blur: 12px;

  --grad-accent: linear-gradient(0deg, var(--cyan-600), var(--cyan-600));
  --grad-accent-soft: linear-gradient(135deg, rgba(8, 145, 178, 0.08) 0%, rgba(22, 99, 135, 0.05) 100%);
  --grad-text: linear-gradient(0deg, var(--cyan-700), var(--cyan-700));
  --orb-1: rgba(8, 145, 178, 0.12);
  --orb-2: rgba(22, 99, 135, 0.1);
  --orb-3: rgba(34, 211, 238, 0.1);
  --grid-line: rgba(15, 23, 42, 0.035);

  /* --- Elevation (LIGHT) ------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --ring: 0 0 0 3px rgba(22, 99, 135, 0.25);

  color-scheme: light;
}

/* ==========================================================================
   Dark theme
   ========================================================================== */
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-deep: #070d18;
  --surface: #111a2b;
  --surface-2: #152035;
  --surface-3: #1b2940;
  --surface-inset: #0e1626;
  --border: #22314a;
  --border-strong: #2f4260;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0b1220;

  --accent: var(--cyan-500);
  --accent-hover: var(--cyan-400);
  --accent-text: var(--cyan-300);
  --accent-soft: rgba(6, 182, 212, 0.12);
  --accent-soft-strong: rgba(6, 182, 212, 0.2);
  --accent-border: rgba(34, 211, 238, 0.28);
  --accent-contrast: #ffffff;

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);

  --glass-bg: rgba(17, 26, 43, 0.92);
  --glass-bg-strong: rgba(17, 26, 43, 0.97);
  --glass-border: var(--border);

  --grad-accent: linear-gradient(0deg, var(--cyan-600), var(--cyan-600));
  --grad-accent-soft: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(22, 99, 135, 0.1) 100%);
  --grad-text: linear-gradient(0deg, var(--cyan-300), var(--cyan-300));
  --orb-1: rgba(8, 145, 178, 0.2);
  --orb-2: rgba(22, 99, 135, 0.22);
  --orb-3: rgba(34, 211, 238, 0.12);
  --grid-line: rgba(255, 255, 255, 0.035);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 8px 10px -6px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(34, 211, 238, 0.35);

  color-scheme: dark;
}

/* ==========================================================================
   InsightsMastery Academy — base layer
   Reset · typography scale · layout primitives · utilities · motion system.
   Every value comes from tokens.css; no raw colors live in this file.
   Declarations are grouped per line to keep the file compact and scannable.
   ========================================================================== */

/* --- 1. Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--space-5)); }
}

body {
  min-height: 100dvh; overflow-x: hidden;
  background-color: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: var(--step-0); font-weight: 400;
  line-height: var(--leading-normal); font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}

html.has-nav-open { overflow: hidden; }

img, svg, video, canvas, audio, iframe, embed, object { display: block; max-width: 100%; }
img, video { height: auto; }
svg { fill: none; flex: none; }

input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul[class], ol[class] { list-style: none; padding: 0; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hover); }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display); font-weight: 600; line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight); text-wrap: balance;
}

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); }
[hidden] { display: none !important; }

/* --- 2. Typography scale -------------------------------------------------- */
.display-1 {
  font-family: var(--font-display); font-size: var(--step-6); font-weight: 600;
  line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
}
.display-2 {
  font-family: var(--font-display); font-size: var(--step-5); font-weight: 600;
  line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
}
.display-3 {
  font-family: var(--font-display); font-size: var(--step-4); font-weight: 600;
  line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
}
.h2 {
  font-family: var(--font-display); font-size: var(--step-3); font-weight: 600;
  line-height: var(--leading-snug); letter-spacing: var(--tracking-tight);
}
.h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; line-height: var(--leading-snug); }
.h4 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: var(--leading-snug); }

.lede {
  max-width: 60ch; color: var(--text-secondary); font-size: var(--step-1);
  line-height: var(--leading-relaxed); text-wrap: pretty;
}
.muted { color: var(--text-muted); }

.eyebrow {
  display: inline-block; color: var(--accent);
  font-size: var(--step--2); font-weight: 500; line-height: var(--leading-snug);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
}

/* Brand highlight inside headings: flat teal, like the parent site's accents. */
.text-gradient { color: var(--accent-text); }

/* --- 3. Layout primitives ------------------------------------------------- */
.container {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-8));
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(var(--space-8), 7vw, var(--space-11)); }
.section--tight { padding-block: clamp(var(--space-6), 4vw, var(--space-9)); }

.section__head {
  display: grid; gap: var(--space-3);
  max-width: 62ch; margin-bottom: var(--space-7);
}
.section__head--center { margin-inline: auto; justify-items: center; text-align: center; }

.grid { display: grid; gap: var(--space-5); }
.grid--2, .grid--3 { grid-template-columns: 1fr; }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(clamp(260px, 30vw, 340px), 1fr)); }

@media (min-width: 720px) {
  .grid--2, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.stack { display: grid; gap: var(--stack-gap, var(--space-4)); align-content: start; }
.cluster {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

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

/* --- 4. Utilities --------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: var(--space-2); left: var(--space-2); z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
  background: var(--accent); color: var(--accent-contrast);
  font-size: var(--step--1); font-weight: 600; box-shadow: var(--shadow-lg);
  transform: translateY(calc(-100% - var(--space-4)));
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); color: var(--accent-contrast); }

.mark {
  padding: 0.05em 0.28em; border-radius: var(--radius-xs);
  background: var(--accent-soft-strong); color: var(--accent-text); font-weight: 600;
}

.full-bleed { width: 100vw; margin-inline: calc(50% - 50vw); }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
.is-hidden { display: none !important; }
/* Without JavaScript nothing will replace loading skeletons — hide them. */
html:not(.js) .skeleton, html:not(.js) .reader-skeleton { display: none; }

/* --- 5. Motion system ----------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(14px); will-change: opacity, transform;
  transition: opacity var(--dur-4) var(--ease-out) var(--reveal-delay, 0ms),
    transform var(--dur-4) var(--ease-out) var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-revealed { opacity: 1; transform: none; will-change: auto; }

html.js:not(.is-ready) body { opacity: 0; }
html.is-ready body {
  opacity: 1;
  transition: opacity var(--dur-3) var(--ease-out),
    background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}

@keyframes float-slow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.04); }
}
@keyframes pulse-ring {
  0% { opacity: 0.55; transform: scale(0.85); }
  70%, 100% { opacity: 0; transform: scale(1.55); }
}
@keyframes shimmer {
  0% { background-position: -160% 0; }
  100% { background-position: 260% 0; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- 6. Focus, selection, scrollbar --------------------------------------- */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
::selection { background: var(--accent-soft-strong); color: var(--accent-text); }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent; border-radius: var(--radius-full);
  background-clip: content-box; background-color: var(--border-strong);
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-subtle); }

/* --- 7. Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  html.js [data-reveal], html.js [data-reveal].is-revealed { opacity: 1; transform: none; }
  html.js:not(.is-ready) body { opacity: 1; }
}

/* --- 8. Print ------------------------------------------------------------- */
@media print {
  .site-header, .site-header__panel, .site-footer, .skip-link,
  .toast-host, .progress-top, .dialog, .nav-toggle, [data-no-print] { display: none !important; }

  body { background: white; color: black; }
  .text-gradient, .stat__value { background: none; color: black; -webkit-text-fill-color: black; }
  .container { max-width: none; padding-inline: 0; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}

/* ==========================================================================
   InsightsMastery Academy — component layer
   Buttons · cards · chips · forms · header · footer · states · overlays.
   Token-driven only, so both themes work with no extra rules.
   ========================================================================== */

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.625rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font-size: var(--step-0); font-weight: 500; line-height: 1.2;
  text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.btn > svg { width: 1.1em; height: 1.1em; }
.btn__icon { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-3); color: var(--text); }

.btn--primary {
  background: var(--accent); border-color: transparent;
  color: var(--accent-contrast); box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }

.btn--outline {
  background: var(--surface); border-color: var(--border); color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

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

.btn--sm { min-height: 40px; padding: 0.5rem 1rem; font-size: var(--step--1); }
.btn--lg { min-height: 48px; padding: 0.75rem 1.5rem; font-size: var(--step-0); }
.btn--block { display: flex; width: 100%; }

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.icon-btn > svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }

/* Structural: only one of the two theme glyphs may be visible at a time. */
.theme-toggle__moon { display: none; }
[data-theme='dark'] .theme-toggle__sun { display: none; }
[data-theme='dark'] .theme-toggle__moon { display: block; }

/* --- Cards ---------------------------------------------------------------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}

.card--interactive:hover, .card--interactive:focus-within {
  border-color: var(--border-strong); box-shadow: var(--shadow-md);
}

.card--glass {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}

.card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
}
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm);
}
.card__icon > svg { width: 22px; height: 22px; }

.card__title {
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  line-height: var(--leading-snug); letter-spacing: -0.01em;
}
.card__text {
  color: var(--text-secondary); font-size: var(--step-0);
  line-height: var(--leading-normal); text-wrap: pretty;
}
.card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  color: var(--text-muted); font-size: var(--step--1);
}
.card__meta > :not(:first-child)::before {
  content: '·'; margin-right: var(--space-2); color: var(--text-subtle);
}

/* z-index keeps footer controls clickable above the stretched .card__link. */
.card__footer {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-top: auto; padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.card__link { color: var(--accent); font-weight: 500; }
.card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }

/* --- Badges, chips, tags, kbd -------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 0.25rem var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-secondary);
  font-size: var(--step--2); font-weight: 600;
  letter-spacing: var(--tracking-wide); white-space: nowrap;
}
.badge--accent {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text);
}
.badge--muted { background: transparent; color: var(--text-muted); }

.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; }
.tag {
  display: inline-flex; align-items: center; padding: 0.15rem var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface-inset); color: var(--text-muted);
  font-size: var(--step--2); font-weight: 500;
}

.chip-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-secondary);
  font-size: var(--step--1); font-weight: 600; cursor: pointer;
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.chip:hover { transform: translateY(-1px); border-color: var(--border-strong); color: var(--text); }
.chip:active { transform: translateY(0); }
.chip[aria-pressed='true'] {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text);
}
.chip__count { color: var(--text-muted); font-size: var(--step--2); font-variant-numeric: tabular-nums; }
.chip[aria-pressed='true'] .chip__count { color: var(--accent-text); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.65em; padding: 0.1em 0.45em;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-xs);
  background: var(--surface-2); color: var(--text-secondary);
  font-family: var(--font-mono); font-size: var(--step--2); line-height: 1.5;
}

/* --- Forms ---------------------------------------------------------------- */
.field { display: grid; gap: var(--space-2); }
.field__label { color: var(--text-secondary); font-size: var(--step--1); font-weight: 600; }

.input, .select {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: var(--step-0);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.input:hover, .select:hover { border-color: var(--accent-border); }
.input:focus-visible, .select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.input::placeholder { color: var(--text-subtle); }
textarea.input { min-height: 8rem; line-height: var(--leading-normal); resize: vertical; }

.select-wrap { position: relative; display: block; }
.select { appearance: none; -webkit-appearance: none; padding-right: var(--space-8); cursor: pointer; }
.select__icon {
  position: absolute; top: 50%; right: var(--space-4); width: 16px; height: 16px;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}

.search { position: relative; display: flex; align-items: center; }
.search__icon {
  position: absolute; left: var(--space-4); width: 18px; height: 18px;
  color: var(--text-muted); pointer-events: none;
}
.search__input {
  width: 100%; min-height: 48px;
  padding: var(--space-3) calc(var(--space-9) + var(--space-2)) var(--space-3) calc(var(--space-6) + var(--space-4));
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text); font-size: var(--step-0);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.search__input::placeholder { color: var(--text-subtle); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__input:hover { border-color: var(--accent-border); }
.search__input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.search__hint {
  position: absolute; right: var(--space-4); pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out);
}
.search__clear {
  position: absolute; right: var(--space-2);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--surface-3); color: var(--text-muted);
  opacity: 0; visibility: hidden; cursor: pointer;
  transition: opacity var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.search__clear > svg { width: 15px; height: 15px; }
.search__clear:hover { color: var(--accent-text); }
.search.has-value .search__clear { opacity: 1; visibility: visible; }
.search.has-value .search__hint { opacity: 0; }

.segmented {
  display: inline-flex; gap: var(--space-1); padding: var(--space-1);
  border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface-2);
}
.segmented__btn {
  min-width: 40px; min-height: 32px; padding: 0 var(--space-3);
  border-radius: var(--radius-full); color: var(--text-muted);
  font-size: var(--step--1); font-weight: 600; cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn[aria-pressed='true'] {
  background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-xs);
}

.switch {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 40px; padding: 0; background: none; color: var(--text-secondary);
  font-size: var(--step--1); font-weight: 600; cursor: pointer;
}
.switch__label { transition: color var(--dur-2) var(--ease-out); }
.switch__track {
  position: relative; display: inline-flex; align-items: center;
  width: 42px; height: 24px; flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--surface-3);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.switch__knob {
  position: absolute; left: 2px; width: 18px; height: 18px;
  border-radius: var(--radius-full); background: var(--surface); box-shadow: var(--shadow-xs);
  transition: transform var(--dur-2) var(--ease-spring);
}
.switch:hover .switch__track { border-color: var(--accent-border); }
.switch[aria-pressed='true'] { color: var(--accent-text); }
.switch[aria-pressed='true'] .switch__track { background: var(--accent); border-color: var(--accent); }
.switch[aria-pressed='true'] .switch__knob { transform: translateX(18px); }

/* --- Header / nav --------------------------------------------------------- */
/* The header wears the parent site's banner in both themes; text is always white. */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--banner-gradient); color: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  transition: box-shadow var(--dur-3) var(--ease-out);
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-4); height: var(--header-h); }

.brand {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  margin-right: auto; color: #ffffff; text-decoration: none;
}
.brand:hover { color: #ffffff; }
.brand__row { display: flex; align-items: center; gap: var(--space-2); }
.brand__mark {
  display: inline-flex; width: 44px; height: 44px; flex: none;
  border-radius: var(--radius-sm); overflow: hidden;
}
.brand__mark > img { width: 100%; height: 100%; object-fit: contain; }
.brand__text {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  letter-spacing: var(--tracking-tight); line-height: 1.1;
}
.brand__sub {
  display: flex; align-items: center; width: 100%; margin-top: 2px; padding-left: 3.25rem;
  color: rgba(255, 255, 255, 0.7); font-size: 9px; font-weight: 500;
  letter-spacing: 0.3em; text-transform: uppercase;
}
.brand__sub::before, .brand__sub::after { content: ''; height: 1px; background: rgba(255, 255, 255, 0.6); }
.brand__sub::before { flex: 1; margin-right: var(--space-2); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6)); }
.brand__sub::after { width: 1rem; margin-left: var(--space-2); }

/* Footer variant: dark wordmark, "Insights" in brand teal. */
.site-footer .brand, .site-footer .brand:hover { color: var(--text); }
.site-footer .brand__accent { color: var(--accent-text); }
.site-footer .brand__sub { color: var(--text-muted); }
.site-footer .brand__sub::before { background: linear-gradient(90deg, transparent, var(--accent)); }
.site-footer .brand__sub::after { background: var(--accent); }

.site-nav { display: none; align-items: center; gap: var(--space-1); }
.nav-link {
  position: relative; display: inline-flex; align-items: center;
  min-height: 40px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.9); font-size: var(--step--1); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.nav-link.is-active { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.nav-link--external::after { content: '↗'; margin-left: 0.3em; font-size: 0.85em; opacity: 0.75; }

.site-header__actions { display: flex; align-items: center; gap: var(--space-2); }
.site-header .icon-btn {
  border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #ffffff;
}
.site-header .icon-btn:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.2); color: #ffffff; }
.site-header__cta { display: none; }
.site-header .site-header__cta {
  background: #ffffff; color: var(--cyan-800); box-shadow: var(--shadow-sm);
}
.site-header .site-header__cta:hover { background: var(--slate-100); color: var(--cyan-800); }

.nav-toggle {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 40px; height: 40px; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1); cursor: pointer;
}
.nav-toggle span {
  display: block; width: 17px; height: 2px;
  border-radius: var(--radius-full); background: #ffffff;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.nav-toggle[aria-expanded='true'] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.site-header__panel {
  position: absolute; top: 100%; left: 0; right: 0;
  display: grid; gap: var(--space-2); max-height: 0; overflow: hidden;
  padding: 0 clamp(var(--space-4), 4vw, var(--space-8));
  border-bottom: 1px solid transparent; background: var(--surface); color: var(--text);
  opacity: 0; visibility: hidden;
  transition: max-height var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out),
    padding var(--dur-3) var(--ease-out), visibility var(--dur-3) var(--ease-out);
}
.site-header__panel .nav-link { color: var(--text-secondary); }
.site-header__panel .nav-link:hover { background: var(--surface-3); color: var(--text); }
.site-header__panel .nav-link.is-active { background: var(--accent-soft); color: var(--accent-text); }
.site-header__panel.is-open {
  max-height: 26rem; padding-block: var(--space-4) var(--space-5);
  border-bottom-color: var(--border); box-shadow: var(--shadow-lg);
  opacity: 1; visibility: visible;
}

@media (min-width: 560px) { .site-header__cta { display: inline-flex; } }
@media (min-width: 1200px) {
  .site-nav { display: flex; }
  .nav-toggle, .site-header__panel { display: none; }
}

/* --- Footer --------------------------------------------------------------- */
.site-footer { margin-top: var(--space-11); border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__inner {
  display: grid; grid-template-columns: 1fr; gap: var(--space-7); padding-block: var(--space-9) var(--space-8);
}
.site-footer__brand { display: grid; align-content: start; gap: var(--space-4); max-width: 34ch; }
.site-footer__brand .muted { font-size: var(--step--1); line-height: var(--leading-normal); }

.site-footer__nav {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3);
}
.site-footer__nav a {
  color: var(--text-secondary); font-size: var(--step--1); text-decoration: none;
  transition: color var(--dur-2) var(--ease-out);
}
.site-footer__nav a:hover { color: var(--accent-text); }
.site-footer__heading { color: var(--text); font-size: var(--step--1); font-weight: 500; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding-block: var(--space-6); border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: var(--step--1);
}

.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-footer__links a { color: var(--text-muted); }
.site-footer__links a:hover { color: var(--accent-text); }

@media (min-width: 720px) { .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* --- States --------------------------------------------------------------- */
.skeleton {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background-color: var(--surface-3);
  background-image: linear-gradient(90deg, transparent 0%, var(--glass-bg) 45%, transparent 90%);
  background-size: 220% 100%; background-repeat: no-repeat;
  animation: shimmer var(--dur-5) linear infinite;
}
.skeleton--text { height: 0.85rem; }
.skeleton--title { height: 1.35rem; width: 62%; }
.skeleton--card { height: 180px; border-radius: var(--radius-lg); }

.empty {
  display: grid; justify-items: center; gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface-2); text-align: center;
}
.empty__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: var(--radius-full);
  background: var(--accent-soft); color: var(--accent-text);
}
.empty__icon > svg { width: 26px; height: 26px; }
.empty__title { font-size: var(--step-1); font-weight: 700; }
.empty__text { max-width: 46ch; color: var(--text-muted); font-size: var(--step--1); }

.alert {
  display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-secondary); font-size: var(--step--1);
}
.alert__title { color: var(--text); font-size: var(--step-0); font-weight: 700; }
.alert__text { color: inherit; text-wrap: pretty; }
.alert code {
  padding: 0.1em 0.35em; border-radius: var(--radius-xs);
  background: var(--surface-inset); color: var(--text);
}
.alert--error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert--error .alert__title { color: var(--danger); }
.alert--info { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.alert--info .alert__title { color: var(--info); }

/* --- Data display --------------------------------------------------------- */
.stat { display: grid; gap: var(--space-1); }
.stat__value {
  color: var(--text); font-family: var(--font-display);
  font-size: var(--step-3); font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
}
.stat__label { color: var(--text-muted); font-size: var(--step--1); font-weight: 400; }

.progress-top {
  position: fixed; top: 0; left: 0; z-index: var(--z-toast);
  width: 100%; height: 3px; background: var(--grad-accent);
  transform: scaleX(var(--progress, 0)); transform-origin: 0 50%; will-change: transform;
}

/* --- Overlays ------------------------------------------------------------- */
.dialog {
  width: min(100% - var(--space-6), 30rem); max-width: 30rem; padding: var(--space-6);
  border: none; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-xl);
}
.dialog[open] { animation: dialog-in var(--dur-3) var(--ease-out); }
.dialog::backdrop {
  background: rgb(0 0 0 / 45%);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.dialog__inner { display: grid; gap: var(--space-5); }
.dialog__title { font-size: var(--step-2); font-weight: 700; }

.shortcut-list {
  display: grid; list-style: none; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.shortcut-list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) var(--space-4); color: var(--text-secondary); font-size: var(--step--1);
}
.shortcut-list li + li { border-top: 1px solid var(--border); }
.shortcut-toggle {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-secondary); font-size: var(--step--1); cursor: pointer;
}
.shortcut-toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

.toast-host {
  position: fixed; bottom: var(--space-6); left: 50%; z-index: var(--z-toast);
  display: grid; justify-items: center; transform: translateX(-50%); pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text);
  font-size: var(--step--1); font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--success { border-color: var(--success); color: var(--success); }
.toast--error { border-color: var(--danger); color: var(--danger); }

/* ==========================================================================
   Page styles — home, about, 404.
   Layout + page-specific composition only. Components live in components.css.
   Tokens only: never hard-code a color here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-9) var(--space-8);
  background: var(--bg);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
  overflow: hidden;
}

.hero__canvas::after {
  /* Fade the canvas into the page so the section below never hard-edges. */
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

/* Quiet brand wash, like the parent site's hero — no motion. */
.orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(70px);
}

.orb--1 {
  inset-block-start: -20%;
  inset-inline-start: 10%;
  inline-size: min(70vw, 620px);
  block-size: min(70vw, 620px);
  background: radial-gradient(circle, var(--orb-1), transparent 70%);
}

.orb--2 {
  inset-block-start: 5%;
  inset-inline-end: 0;
  inline-size: min(60vw, 520px);
  block-size: min(60vw, 520px);
  background: radial-gradient(circle, var(--orb-2), transparent 70%);
}

.orb--3 {
  display: none;
}

.grid-lines {
  display: none;
}

/* The parent site's "Trusted by…" pill. */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--step--2);
  font-weight: 500;
}
.hero__badge > svg { width: 12px; height: 12px; }

.hero__content {
  position: relative;
  z-index: var(--z-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
  max-inline-size: 60ch;
  margin-inline: auto;
}

.hero__content .lede {
  max-inline-size: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* Divided stat strip: a 1px grid gap over a border-coloured backdrop. */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  inline-size: 100%;
  max-inline-size: 48rem;
  margin-block-start: var(--space-5);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
  box-shadow: var(--shadow-sm);
}

.hero__stats .stat {
  padding: var(--space-5) var(--space-3);
  background: var(--surface);
}

@media (min-width: 48em) {
  .hero {
    padding-block: var(--space-11) var(--space-10);
  }
}

/* --------------------------------------------------------------------------
   Latest notes
   -------------------------------------------------------------------------- */

.home-notes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 42em) {
  .home-notes {
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  }
}

.home-notes .alert {
  grid-column: 1 / -1;
}

.home-notes__more {
  display: flex;
  justify-content: center;
  margin-block-start: var(--space-6);
}

/* --------------------------------------------------------------------------
   How it works — numbered steps
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
  /* Equal-height grid items must not spread their rows apart. */
  align-content: start;
}

.step__num {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--grad-accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: var(--step-0);
  box-shadow: var(--shadow-glow);
}

.step__body > * + * {
  margin-block-start: var(--space-2);
}

.step__title {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
}

.step::after {
  /* Connector between steps — vertical on mobile. */
  content: "";
  position: absolute;
  inset-inline-start: 1.375rem;
  inset-block-start: 3.25rem;
  inline-size: 1px;
  block-size: calc(100% - 1.5rem);
  background: linear-gradient(to bottom, var(--accent-border), transparent);
}

.step:last-child::after {
  display: none;
}

@media (min-width: 48em) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-7);
  }

  .step {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .step::after {
    inset-block-start: 1.375rem;
    inset-inline-start: 3.5rem;
    inline-size: calc(100% - 1rem);
    block-size: 1px;
    background: linear-gradient(to right, var(--accent-border), transparent);
  }
}

/* --------------------------------------------------------------------------
   Closing CTA band
   -------------------------------------------------------------------------- */

.cta-band {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--space-5);
  justify-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    var(--grad-accent-soft),
    var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg);
}

.cta-band__text {
  max-inline-size: 48ch;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

@media (min-width: 48em) {
  .cta-band {
    padding: var(--space-10) var(--space-8);
  }
}

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */

.about-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-8) var(--space-7);
  text-align: center;
}

.about-prose > * + * {
  margin-block-start: var(--space-4);
}

.about-list {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}

.about-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  color: var(--text-secondary);
}

.about-list li::before {
  content: "";
  inline-size: 0.5rem;
  block-size: 0.5rem;
  margin-block-start: 0.5em;
  border-radius: var(--radius-full);
  background: var(--grad-accent);
}

.about-figure {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}

.about-figure__value {
  font-size: var(--step-4);
  font-weight: 750;
  letter-spacing: var(--tracking-tight);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-figure__label {
  color: var(--text-muted);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
  list-style: none;
}

.about-tag {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--step--1);
  font-weight: 550;
}

/* --------------------------------------------------------------------------
   Feedback form (layout only — controls come from components.css)
   -------------------------------------------------------------------------- */

.feedback-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feedback-form__row {
  display: grid;
  gap: var(--space-4);
}

.feedback-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.feedback-form__note {
  color: var(--text-muted);
  font-size: var(--step--1);
}

@media (min-width: 40em) {
  .feedback-form {
    padding: var(--space-6);
  }

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

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.error-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-block-size: calc(100svh - var(--header-h) - var(--space-11));
  padding-block: var(--space-9);
  text-align: center;
}

.error-page__inner {
  position: relative;
  z-index: var(--z-raised);
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  max-inline-size: 46ch;
}

.error-page__code {
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .orb {
    animation: none;
  }
}
