/* Floom design system — locked from v5/02 (refraction).
   Imported by every page in /design-final/.
   Federico's note: previous variants felt flat — fix via parallax + floating motion + layered shadows. */

/* Display: Bricolage Grotesque (variable axes for opsz/wdth/wght) — original modern grotesque, free.
   Body: Inter. Code: JetBrains Mono. */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,200..800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Whiter base — closer to ChatGPT reference, away from cream cardboard */
  --bg:        #fbfaf3;
  --bg-2:      #f7f5ec;
  --paper:     #ffffff;
  --ink:       #1a2520;
  --ink-soft:  #5a6259;
  --ink-mute:  #8a9088;
  --emerald:   #0a5230;
  --emerald-dark: #053a22;
  --sage:      #b8c8b1;
  --sage-tint: rgba(149,169,142,0.14);
  --line:      rgba(26,37,32,0.08);
  --line-soft: rgba(26,37,32,0.04);
  --glass-bg:        rgba(255,255,255,0.45);
  --glass-bg-strong: rgba(255,255,255,0.62);
  --glass-edge:      rgba(255,255,255,0.96);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { overflow-x: hidden; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ── AURORA BG — visible sage corners, near-white base ── */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    /* sage aurora upper-right — visibly present */
    radial-gradient(60% 55% at 100% -8%, rgba(149,169,142,0.55), rgba(149,169,142,0.10) 40%, transparent 70%),
    /* sage aurora lower-left */
    radial-gradient(65% 60% at -10% 110%, rgba(149,169,142,0.42), rgba(149,169,142,0.08) 45%, transparent 75%),
    /* near-white base wash */
    linear-gradient(165deg, #fbfaf6 0%, #f5f3e8 100%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='3' seed='5'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

/* ── NAV ── */
nav.brand-nav {
  position: relative; z-index: 5;
  padding: 24px 36px 0;
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
}

/* ── NAV-APP: canonical sticky nav for logged-in product pages
   (Library, Library-skill, Settings, Docs)
   Apply via <nav class="brand-nav brand-nav-app"> on those pages.
   Overrides the base brand-nav to be sticky + frosted. ── */
nav.brand-nav.brand-nav-app {
  position: sticky; top: 0;
  padding: 0 36px;
  max-width: 100%; margin: 0;
  height: 52px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: rgba(251,250,243,0.88);
  border-bottom: 0.5px solid var(--line);
  box-shadow: none;
}
/* Remove the MCP pill from app nav */
nav.brand-nav.brand-nav-app .nav-mcp { display: none !important; }
/* Active page indicator — underline on the current nav link */
nav.brand-nav.brand-nav-app .nav-right a.nav-current {
  color: var(--ink);
  border-bottom: 1.5px solid var(--emerald);
  padding-bottom: 3px;
}
/* Nav links in app nav: pill hover instead of underline */
nav.brand-nav.brand-nav-app .nav-right a:not(.nav-profile):not(.nav-gh) {
  padding: 5px 10px; border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
nav.brand-nav.brand-nav-app .nav-right a:not(.nav-profile):not(.nav-gh):hover {
  color: var(--ink); background: rgba(149,169,142,0.10);
}
/* ── PAGE-HEADER-APP: canonical page header for all logged-in Pattern A pages.
   (Library, Library-skill, Settings, Docs)
   Law: H1 must sit at THE SAME y-position from the top of the viewport on
   every Pattern A page at 1440px desktop.

   Vertical rhythm (below the 52px sticky nav):
     Case A — page has an eyebrow or breadcrumb ABOVE the H1:
       padding-top: 52px
       eyebrow/breadcrumb: ~12–14px rendered height + 14px margin-bottom = ~26px pre-H1 offset
       H1 baseline: nav-bottom + 52 + 26 = 130px from viewport top

     Case B — page has NO eyebrow or breadcrumb (Settings, Library):
       padding-top: 78px   (= 52 + 26px compensation)
       H1 baseline: nav-bottom + 78 = 130px from viewport top

   Use .page-header-app for Case B (no pre-H1 row).
   Use .page-header-app.has-pre-row for Case A (eyebrow or breadcrumb present). ── */
.page-header-app {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto;
  /* Case B default: no eyebrow/breadcrumb — add 26px compensation */
  padding: 78px 32px 40px;
}
/* Case A: has eyebrow or breadcrumb — 52px is the right top pad */
.page-header-app.has-pre-row {
  padding-top: 52px;
}

/* ── Eyebrow (10px JetBrains Mono, uppercase, emerald) ── */
.page-header-app .ph-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; font-weight: 600; letter-spacing: 0.20em;
  text-transform: uppercase; color: var(--emerald);
  line-height: 1.2;
  margin-bottom: 14px;
}

/* ── Breadcrumb (12px JetBrains Mono, ink-mute) ── */
.page-header-app .ph-breadcrumb {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace; font-size: 11.5px;
  line-height: 1.2;
  color: var(--ink-mute);
  /* margin-bottom tuned to match eyebrow total height: 12px line + 14px gap ≈ same 26px */
  margin-bottom: 12px;
}
.page-header-app .ph-breadcrumb a {
  color: var(--ink-mute); padding: 1px 4px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.page-header-app .ph-breadcrumb a:hover { color: var(--emerald); background: var(--sage-tint); }
.page-header-app .ph-breadcrumb .sep { color: var(--ink-mute); opacity: 0.4; padding: 0 2px; }
.page-header-app .ph-breadcrumb .current { color: var(--ink-soft); padding: 1px 4px; }

/* ── H1 — identical across all Pattern A pages ── */
.page-header-app h1 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.0;
  margin: 0;
}
.page-header-app h1 em { font-style: normal; color: var(--emerald); letter-spacing: -0.04em; font-weight: 500; }

/* ── Subtitle (16px Inter, ink-soft) ── */
.page-header-app .ph-sub {
  font-size: 16px; line-height: 1.5; color: var(--ink-soft);
  max-width: 56ch; margin-top: 12px;
}

/* ── Stats / meta row (13px JetBrains Mono, ink-mute) ── */
.page-header-app .ph-meta {
  font-family: "JetBrains Mono", monospace; font-size: 13px;
  color: var(--ink-mute); margin-top: 16px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
}
.page-header-app .ph-meta .s-sep { margin: 0 9px; opacity: 0.4; }

/* ── H1 title row (for inline chip right of H1) ── */
.page-header-app .ph-title-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

@media (max-width: 760px) {
  nav.brand-nav.brand-nav-app { padding: 0 20px; }
  .page-header-app { padding: 44px 20px 28px; }
  .page-header-app.has-pre-row { padding-top: 28px; }
}
.brand-row { display: inline-flex; align-items: baseline; gap: 10px; }
.brand { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 30px; line-height: 1; }
.brand::after { content: '.'; color: var(--emerald); }
.mit-pill {
  background: var(--paper); border: 0.5px solid var(--line);
  color: var(--ink-soft); font-size: 9px; font-weight: 600; letter-spacing: 0.20em;
  padding: 3px 7px; border-radius: 4px;
  position: relative; bottom: 5px;       /* visually align with the lowercase x-height of "floom" */
  text-transform: uppercase;
}
/* GitHub link icon in nav */
.nav-gh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--ink-soft);
  transition: color 0.15s, background 0.15s;
}
.nav-gh:hover { color: var(--ink); background: var(--sage-tint); }
.nav-gh svg { width: 18px; height: 18px; }
.nav-right { display: inline-flex; gap: 18px; align-items: center; font-size: 13px; }
.nav-right a { color: var(--ink-soft); }
.nav-right a:hover { color: var(--ink); }
.nav-right .signin { color: var(--ink); border-bottom: 0.5px solid var(--ink); padding-bottom: 2px; }

/* MCP install pill — pinned in nav across all pages */
.nav-mcp {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 0.5px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 10px 6px 12px; border-radius: 999px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, 0 2px 6px -2px rgba(26,37,32,0.06);
  transition: background 0.15s, color 0.15s;
}
.nav-mcp:hover { background: rgba(255,255,255,0.95); color: var(--ink); }
.nav-mcp .copy {
  background: var(--sage-tint); color: var(--emerald);
  padding: 2px 6px; border-radius: 5px; font-size: 10px;
}

/* ── EYEBROW ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 0.5px solid var(--line);
  color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: 0.20em;
  text-transform: uppercase; padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, 0 4px 14px -8px rgba(26,37,32,0.10);
}
.eyebrow::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--emerald); }

/* ── DISPLAY TYPE ── */
h1.display {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.0;
  max-width: 18ch;
  margin-left: auto; margin-right: auto;
  text-wrap: balance;       /* modern browsers: balanced line lengths */
}
/* Emerald accent — brand voice signature without the italic-serif tic */
h1.display em {
  font-style: normal;
  color: var(--emerald);
  letter-spacing: -0.04em;     /* tighter tracking gives the accent character */
  font-weight: 500;             /* slight weight bump for emphasis without italic */
  white-space: nowrap;          /* keeps the accent phrase on one line, no orphan */
}
h2.section {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400; letter-spacing: -0.025em; line-height: 1.0;
}
h2.section em {
  font-style: normal; color: var(--emerald);
  letter-spacing: -0.03em; font-weight: 500;
}
.sub {
  font-size: 16px; line-height: 1.55; color: var(--ink-soft);
  max-width: 48ch;
}

/* ── CTAs ── */
.cta-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--emerald); color: var(--paper);
  padding: 13px 18px; border-radius: 12px;
  font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 14px -6px rgba(10,82,48,0.40);
  transition: background 0.2s, transform 0.2s;
}
.cta-primary:hover { background: var(--emerald-dark); transform: translateY(-1px); }
.cta-primary .copy { background: rgba(255,255,255,0.18); padding: 2px 7px; border-radius: 5px; font-size: 11px; }
.cta-secondary {
  color: var(--ink); font-size: 14px; font-weight: 500;
  border-bottom: 0.5px solid var(--ink); padding-bottom: 2px;
}
.cta-secondary.ghost { border-bottom: 0; color: var(--ink-soft); }
/* Mono-pill secondary — for inline CLI command beside primary CTA */
.cta-secondary.mono-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--ink-soft);
  padding: 11px 14px 11px 16px; border-radius: 999px;
  border: 0.5px solid var(--line);
  font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, 0 2px 6px -2px rgba(26,37,32,0.06);
}
.cta-secondary.mono-pill:hover { color: var(--ink); }
.cta-secondary.mono-pill .copy {
  background: var(--sage-tint); color: var(--emerald);
  padding: 2px 6px; border-radius: 5px; font-size: 10px;
}

/* ── GLASS PRIMITIVES ──
   Two-layer system per Federico's reference screenshot:
   .glass-shell  =  outer translucent container with raised 3D borders
   .glass-hero   =  inner solid card (sits INSIDE .glass-shell with breathing margin)
   .glass        =  general-purpose smaller glass surface (chips, secondary cards) */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 0.5px solid var(--glass-edge);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 -1px 0 rgba(26,37,32,0.06) inset,
    0 8px 20px -10px rgba(26,37,32,0.10);
  position: relative; overflow: hidden;
}
.glass::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.30), transparent);
  pointer-events: none;
}
.glass > * { position: relative; z-index: 1; }

/* OUTER GLASS SHELL — actual transparent glass, NOT a cream cardboard frame.
   The shell mostly shows the page background through it; depth comes from
   the layered shadow + edge specular + refraction filter, not from fill color. */
.glass-shell {
  position: relative;
  padding: 16px;
  border-radius: 28px;
  /* Mostly clear — let the aurora bg show through */
  background:
    linear-gradient(
      160deg,
      rgba(255,255,255,0.40) 0%,
      rgba(255,255,255,0.20) 50%,
      rgba(255,255,255,0.28) 100%
    );
  backdrop-filter: url(#liquid-refract) blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  /* Raised border treatment — restrained, not loud */
  box-shadow:
    /* TOP edge: bright specular */
    0 1.5px 0 rgba(255,255,255,0.95) inset,
    /* SIDE edges: subtle */
    1px 0 0 rgba(255,255,255,0.55) inset,
    -1px 0 0 rgba(255,255,255,0.55) inset,
    /* BOTTOM edge: dark grounding line */
    0 -1px 0 rgba(26,37,32,0.10) inset,
    /* Layered outer drop shadow — depth stack, slightly cooler */
    0 20px 50px -22px rgba(26,37,32,0.18),
    0 50px 100px -40px rgba(26,37,32,0.12),
    0 100px 180px -70px rgba(26,37,32,0.08);
  border: 0.5px solid rgba(255,255,255,0.75);
  isolation: isolate;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
/* Top-edge specular GLINT — soft highlight band */
.glass-shell::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  border-radius: 27px 27px 0 0;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.45) 0%,
    rgba(255,255,255,0.10) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}
.glass-shell::after { display: none; }
.glass-shell > * { position: relative; z-index: 1; }

/* INNER HERO CARD — sits inside .glass-shell with breathing margin.
   Cleaner near-white with very subtle elevation. */
.glass-hero {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255,255,255,0.95);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95) inset,
    0 -1px 0 rgba(26,37,32,0.04) inset,
    0 4px 10px -4px rgba(26,37,32,0.06),
    0 10px 24px -12px rgba(26,37,32,0.08);
  position: relative; overflow: hidden;
}
.glass-hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.40), transparent);
  pointer-events: none;
  border-radius: 20px 20px 0 0;
}
.glass-hero > * { position: relative; z-index: 1; }

/* ── MOTION ──
   Single persistent motion: parallax cursor-tilt on .glass-shell (handled inline per page).
   Apple discipline: NO ambient bobbing on chips — that read as "alive but busy".
   .float kept as opt-in for static layout where a single chip needs gentle weight. */
.float {
  animation: float-bob 11s cubic-bezier(.45,.05,.55,.95) infinite alternate;
  will-change: transform;
}
@keyframes float-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-3px); }
}

/* Entrance animation — staggered rise */
.rise { animation: rise 800ms cubic-bezier(.2,.8,.2,1) both; }
.rise-1 { animation-delay: 0ms; }
.rise-2 { animation-delay: 80ms; }
.rise-3 { animation-delay: 160ms; }
.rise-4 { animation-delay: 240ms; }
.rise-5 { animation-delay: 320ms; }
.rise-6 { animation-delay: 400ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* CRITICAL: with prefers-reduced-motion the animation gets disabled
   AND the from-state (opacity:0) sticks → entire hero invisible.
   Force visibility for reduced-motion users + safety net for any case
   where animation doesn't run (headless chrome, slow paint, etc). */
@media (prefers-reduced-motion: reduce) {
  .rise {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── DIAGRAM PRIMITIVES (sync diagram on landing) ── */
.diagram-row {
  display: grid; gap: 16px; align-items: stretch;
  grid-template-columns: 1fr 1fr 1fr;
}
.diagram-row.two { grid-template-columns: 1fr 1fr; max-width: 520px; margin: 0 auto; }
.diagram-arrows { display: grid; gap: 16px; grid-template-columns: 1fr 1fr 1fr; justify-items: center; height: 22px; align-items: center; }
.diagram-arrows.two { grid-template-columns: 1fr 1fr; max-width: 520px; margin: 0 auto; }
.arrow { width: 1px; height: 22px; background: var(--line); position: relative; }
.arrow::before, .arrow::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.arrow::before { top: -1px; border-bottom: 5px solid var(--ink-mute); }
.arrow::after { bottom: -1px; border-top: 5px solid var(--ink-mute); }

/* AGENT CHIP / MACHINE BOX — small glass pieces around the central library card */
.agent-chip { padding: 12px 14px; font-size: 12px; text-align: center; border-radius: 14px; }
.agent-chip .name { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.agent-chip .meta { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ink-mute); }
.agent-chip .status {
  display: inline-block; margin-top: 4px;
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: var(--sage-tint); color: var(--emerald);
  font-family: "JetBrains Mono", monospace;
}
.agent-chip .status.syncing { color: var(--ink-soft); background: rgba(26,37,32,0.06); }

/* LIBRARY ITEM (used on hero card + library page) */
.lib-item {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 4px; font-size: 13px;
  border-top: 0.5px solid var(--line-soft);
}
.lib-item:first-of-type { border-top: 0; }
.lib-item .ic { width: 24px; height: 24px; border-radius: 6px; background: var(--sage-tint); display: grid; place-items: center; font-size: 13px; }
.lib-item .name { font-weight: 600; color: var(--ink); }
.lib-item .v {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--emerald); background: var(--sage-tint);
  padding: 2px 7px; border-radius: 5px;
}

/* ── FOOTER ── */
footer.brand-footer {
  position: relative; z-index: 2;
  padding: 64px 36px 40px;
  max-width: 1200px; margin: 0 auto;
  border-top: 0.5px solid var(--line);
  margin-top: 80px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 48px;
}
footer.brand-footer .col h4 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 12px;
}
footer.brand-footer .col a {
  display: block; padding: 4px 0;
  font-size: 14px; color: var(--ink); font-weight: 500;
}
footer.brand-footer .col a:hover { color: var(--emerald); }
footer.brand-footer .brand-col { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 28px; }
footer.brand-footer .brand-col::after { content: '.'; color: var(--emerald); }
footer.brand-footer .brand-col p {
  font-family: "Inter", sans-serif; font-size: 13px;
  color: var(--ink-soft); margin-top: 12px; line-height: 1.5;
  max-width: 28ch;
}

/* ── RESPONSIVE ── */
@media (max-width: 760px) {
  nav.brand-nav {
    padding: 18px 20px 0;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* Nav links: 44px minimum tap target on mobile */
  nav.brand-nav .nav-right {
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
  }
  nav.brand-nav .nav-right a {
    min-height: 44px;
    display: inline-flex; align-items: center;
    padding: 8px 10px;
    font-size: 12px;
  }
  /* Bump specificity (0,2,2) to beat .nav-right a rule (0,2,1) */
  nav.brand-nav .nav-right a.nav-mcp {
    display: none !important;
  }
  nav.brand-nav .brand {
    font-size: 26px;
  }
  /* Profile icon stays visible on mobile, no shrink */
  nav.brand-nav .nav-right a.nav-profile {
    width: 32px; height: 32px;
  }
  /* Footer links: 44px minimum tap target on mobile */
  footer.brand-footer { grid-template-columns: 1fr 1fr; gap: 32px; padding: 48px 20px 32px; }
  footer.brand-footer .col a {
    min-height: 44px;
    display: flex; align-items: center;
    padding: 6px 0;
    font-size: 14px;
  }
  /* Diagram rows on mobile collapse */
  .diagram-row { grid-template-columns: 1fr; }
  .diagram-row.two { grid-template-columns: 1fr; }
  .diagram-arrows { display: none; }
  .arrows-converge, .arrows-fan { display: none; }
  .chip-row, .machine-row { grid-template-columns: 1fr; }
}

/* ── RESPONSIVE 480px ── */
@media (max-width: 480px) {
  nav.brand-nav {
    padding: 14px 16px 0;
    gap: 6px;
  }
  nav.brand-nav .brand { font-size: 24px; }
  nav.brand-nav .nav-right {
    gap: 4px;
  }
  nav.brand-nav .nav-right a {
    padding: 6px 8px;
    font-size: 12px;
  }
  /* Hide secondary nav items on very small phones — keep brand + profile */
  nav.brand-nav .nav-right a:not(.nav-profile):not(.nav-gh) {
    display: none;
  }
  /* Footer: single column on small phones */
  footer.brand-footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 16px 28px;
  }
  footer.brand-footer .brand-col { font-size: 24px; }
  /* CTAs full width */
  .cta-primary { width: 100%; justify-content: center; }
}

/* Profile icon in nav (replaces "Settings" nav item — clicking opens profile menu → settings) */
.nav-profile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), var(--emerald));
  color: var(--paper);
  font-family: "Inter", sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 2px 6px -2px rgba(26,37,32,0.18);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-profile:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 4px 10px -2px rgba(26,37,32,0.22); }
