/* ==========================================================================
   memoratu — site.css
   One stylesheet. No build step, no preprocessor, no framework.

     1. Tokens      2. Reset/base   3. Layout      4. Buttons
     5. Nav         6. Footer       7. Device frame (the screenshots)
     8. Sections    9. Status table 10. Pricing   11. Blog/prose
     12. Responsive 13. Print

   COLOUR comes from the project's own brand kit (memoratu/design/logo-kit.html)
   — the same file the iOS app's colorsets were read from. Light and dark are
   both defined there; both are carried here. Nothing is invented.

   RESPONSIVE follows somliswebsite's idiom deliberately, because he asked for
   it by name: fluid clamp() type and spacing, a scaling gutter, a max-width
   shell, and breakpoints at 1023 / 767 / 480. The footer collapses to one
   column and sits properly at the bottom on a phone.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #F7F6FB;
  --card: #ffffff;
  --ink: #111827;
  --mute: #6B7280;
  --line: #E4E2EF;
  --accent: #4F46E5;
  --coral: #FF7A59;

  /* Derived for this site only. The kit fixes the six above and the mark;
     these are tones of them for surfaces the kit has no opinion about. */
  --card-2: #FDFDFF;
  --ink-soft: #374151;
  --accent-wash: #EEEDFB;
  --good: #137A4E;
  --good-wash: #E4F3EB;
  --wait-wash: #F1F0F6;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --display-xl: clamp(2.25rem, 1.3rem + 3.9vw, 4rem);
  --display-l: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --display-m: clamp(1.3rem, 1.1rem + 0.9vw, 1.75rem);
  --lede: clamp(1.05rem, 0.99rem + 0.3vw, 1.25rem);
  --body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --body-s: 0.9375rem;
  --caption: 0.8125rem;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px; --sp-10: 56px;
  --sp-11: 64px; --sp-12: 80px; --sp-13: 96px;

  --section-y: clamp(56px, 7vw, 112px);
  --gutter-x: clamp(18px, 4.5vw, 56px);
  --shell-w: 1120px;
  --radius: 14px;

  --shadow-1: 0 1px 2px rgba(17, 24, 39, .06), 0 4px 12px rgba(17, 24, 39, .05);
  --shadow-2: 0 2px 6px rgba(17, 24, 39, .08), 0 18px 48px rgba(17, 24, 39, .14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12111A;
    --card: #1C1B27;
    --ink: #F3F2FA;
    --mute: #9A98AD;
    --line: #2D2B3D;
    --accent: #8B85FF;
    --coral: #FF7A59;

    --card-2: #221F2F;
    --ink-soft: #D7D5E6;
    --accent-wash: #241F45;
    --good: #5FD6A0;
    --good-wash: #13302A;
    --wait-wash: #211F2D;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .55);
  }
}

/* 2. Reset & base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* sticky nav must not cover an anchor target */
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;

  /* THE BACKSTOP. The device cluster rotates and overlaps on desktop; this
     guarantees that no transform anywhere can produce a horizontal scrollbar.
     somliswebsite paid for this lesson once already. */
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: var(--display-xl); }
h2 { font-size: var(--display-l); }
h3 { font-size: var(--display-m); }
p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.skip-link {
  position: absolute; left: 0; top: -100px; z-index: 200;
  background: var(--accent); color: #fff; padding: 12px 20px; font-weight: 600;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 3. Layout ---------------------------------------------------------------- */
.shell { max-width: var(--shell-w); margin: 0 auto; padding: 0 var(--gutter-x); }
.shell.narrow { max-width: 720px; }
.section { padding: var(--section-y) 0; }
.section-top { padding-top: clamp(40px, 5vw, 72px); }
.section-rule { border-top: 1px solid var(--line); }
.lede { font-size: var(--lede); color: var(--mute); max-width: 56ch; margin-top: var(--sp-5); }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--caption); letter-spacing: .08em;
  text-transform: uppercase; color: var(--mute); margin-bottom: var(--sp-4); display: block;
}
.section-header { max-width: 52ch; margin-bottom: var(--sp-9); }
.section-header .lede { margin-top: var(--sp-4); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-7); box-shadow: var(--shadow-1);
}
.card h3 { margin-bottom: var(--sp-3); }
.card p { color: var(--mute); font-size: var(--body-s); }

/* Code, styled OUTSIDE .prose too — the install command now appears in cards on
   /features/ and /whats-new/, not only in blog bodies.
   THE OVERFLOW RULE IS THE ONE THAT MATTERS: `brew install
   subbutgs/memoratu/mu` is wider than a 232px phone can render, and without a
   scrolling box it would push the whole page sideways. */
pre {
  margin: 0; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 10px; padding: var(--sp-4);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
pre code {
  font-family: var(--font-mono); font-size: 0.875rem; color: var(--ink);
  background: none; border: 0; padding: 0; white-space: pre;
}
code {
  font-family: var(--font-mono); font-size: .875em; background: var(--wait-wash);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

/* 4. Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: var(--body-s);
  text-decoration: none; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-7); }
.text-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* 5. Navigation -------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  /* SOLID FALLBACK FIRST, and it is load-bearing.
     color-mix() is recent. On a browser that does not understand it the whole
     declaration is dropped — which on a STICKY bar means no background at all,
     and the page content scrolls visibly underneath the links. An opaque
     background first means the worst case is "not translucent", not "broken". */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: var(--sp-6); height: 64px; }
.nav-brand { text-decoration: none; color: var(--ink); }
.lockup { display: inline-flex; align-items: center; gap: 9px; }
.lockup-word { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.03em; }
/* The 'o' of memoratu, drawn as the mark's coral check-ring — the brand kit's
   own lockup. The real letter is inside it as .vh, so the ring is what you see
   and "memoratu" is still what you copy and what a screen reader says. */
.lockup-o {
  display: inline-block; width: .62em; height: .62em; border-radius: 50%;
  border: 2.5px solid var(--coral); vertical-align: baseline; margin: 0 .04em;
  position: relative; top: .02em;
}
/* Visually hidden, still read and still copied. */
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.nav-links { display: flex; gap: var(--sp-6); margin-left: auto; }
.nav-links a {
  text-decoration: none; color: var(--mute); font-size: var(--body-s); font-weight: 500;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-trigger { display: none; margin-left: auto; padding: 8px; }
.nav-trigger-icon { display: flex; flex-direction: column; gap: 4px; }
.nav-trigger-icon span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-panel { display: none; }

/* 6. Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: var(--sp-9); }
.footer-grid {
  display: grid; grid-template-columns: 4fr 3fr 3fr; gap: var(--sp-8);
  padding-top: var(--sp-11); padding-bottom: var(--sp-9);
}
.footer-wordmark {
  display: flex; align-items: center; gap: 9px; font-weight: 700;
  font-size: 1.0625rem; letter-spacing: -0.02em;
}
.footer-tagline { margin-top: var(--sp-4); color: var(--mute); max-width: 26ch; }
.footer-state {
  margin-top: var(--sp-2); color: var(--mute); font-size: var(--body-s);
  font-family: var(--font-mono);
}
.footer-heading {
  display: block; font-family: var(--font-mono); font-size: var(--caption);
  letter-spacing: .08em; text-transform: uppercase; color: var(--mute);
  margin-bottom: var(--sp-4);
}
.footer-links, .footer-social { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-social { margin-top: var(--sp-8); }
.footer-links a, .footer-social a {
  text-decoration: none; color: var(--mute); font-size: var(--body-s);
}
.footer-links a:hover, .footer-social a:hover { color: var(--ink); }
/* An account that does not exist is not a link. It must not look clickable. */
.soon { color: var(--mute); font-size: var(--body-s); cursor: default; }
.soon em {
  font-style: normal; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
  background: var(--wait-wash); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 999px; margin-left: 4px;
}
.footer-legal {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-6) 0; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--caption); color: var(--mute);
}
.footer-legal-links { display: flex; gap: var(--sp-5); }
.footer-legal a { color: var(--mute); text-decoration: none; }
.footer-legal a:hover { color: var(--ink); }

/* 7. The device frame -------------------------------------------------------- */
/* Pure CSS. No PNG is edited, so when the screenshots are replaced with
   polished ones from the real app, every frame on the site survives untouched.
   No notch is drawn — the captures already contain the status bar and the
   Dynamic Island. */
.device {
  --bezel: 10px;
  width: 420px; max-width: 100%;
  padding: var(--bezel);
  border-radius: 46px;
  background: linear-gradient(160deg, #3a3a44, #17171d 42%, #26262e);
  box-shadow: var(--shadow-2), inset 0 0 0 1px rgba(255, 255, 255, .09);
  flex: 0 0 auto;
}
.device-screen { border-radius: 36px; overflow: hidden; background: var(--card); line-height: 0; }
.device-screen img { width: 100%; height: auto; }

.device-cluster {
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: var(--sp-6); padding-bottom: var(--sp-6);
}
/* The tilt and the overlap. Transform only — nothing reflows, and every one of
   these is switched off below 768px (§12). */
.device-cluster .device { width: 300px; }
.tilt-left   { transform: rotate(-4deg) translateY(18px); margin-right: -46px; z-index: 1; }
.tilt-centre { transform: rotate(1.5deg); z-index: 3; width: 330px !important; }
.tilt-right  { transform: rotate(3deg) translateY(26px); margin-left: -46px; z-index: 2; }

.device-pair { display: flex; gap: var(--sp-7); justify-content: center; flex-wrap: wrap; }
.device-pair .device { width: 280px; }

.shot-caption {
  text-align: center; color: var(--mute); font-size: var(--body-s);
  max-width: 58ch; margin: var(--sp-6) auto 0;
}

/* 8. Sections ----------------------------------------------------------------- */
.hero { padding-top: clamp(40px, 6vw, 88px); padding-bottom: 0; }
.hero-inner { text-align: center; }
.hero .lede { margin-left: auto; margin-right: auto; }
.hero .btn-row { justify-content: center; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border-radius: 999px; background: var(--accent-wash); color: var(--accent);
  font-size: var(--caption); font-weight: 600; font-family: var(--font-mono);
  letter-spacing: .04em; margin-bottom: var(--sp-5);
}
.note {
  border-left: 3px solid var(--coral); background: var(--card);
  padding: var(--sp-5) var(--sp-6); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft); margin-top: var(--sp-7); max-width: 64ch;
}
.note strong { color: var(--ink); }
.empty-state {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: var(--sp-9) var(--sp-7); text-align: center; color: var(--mute);
  background: var(--card-2);
}

/* 9. The status table ---------------------------------------------------------- */
.status-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.status-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--line);
}
.status-row:last-child { border-bottom: 0; }
.status-what { font-weight: 500; }
.status-state {
  font-family: var(--font-mono); font-size: var(--caption); font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.state-live { background: var(--good-wash); color: var(--good); }
.state-wait { background: var(--wait-wash); color: var(--mute); }
.state-soon { background: var(--accent-wash); color: var(--accent); }

/* 10. Pricing ------------------------------------------------------------------ */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); align-items: start; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-7); }
.price-name { font-family: var(--font-mono); font-size: var(--caption); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.price-amount { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; margin-top: var(--sp-3); }
.price-amount span { font-size: 1rem; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.price-placeholder {
  display: inline-block; margin-top: var(--sp-2); font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--coral); border: 1px solid var(--coral); border-radius: 999px; padding: 1px 8px;
}
.price-list { margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }
.price-list li { color: var(--mute); font-size: var(--body-s); padding-left: 20px; position: relative; }
.price-list li::before { content: '·'; position: absolute; left: 6px; color: var(--accent); font-weight: 700; }

.plan-table { width: 100%; border-collapse: collapse; font-size: var(--body-s); }
.plan-table th, .plan-table td { text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.plan-table th { font-family: var(--font-mono); font-size: var(--caption); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 600; }
.plan-table td:not(:first-child), .plan-table th:not(:first-child) { text-align: center; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 11. Blog and prose ------------------------------------------------------------ */
.post-list { display: flex; flex-direction: column; gap: var(--sp-5); }
.post-card {
  display: grid; grid-template-columns: 160px 1fr; gap: var(--sp-6);
  text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-6);
  transition: border-color .15s ease;
}
.post-card:hover { border-color: var(--accent); }
.post-card-meta { font-family: var(--font-mono); font-size: var(--caption); color: var(--mute); }
.post-card h2 { font-size: var(--display-m); }
.post-card p { color: var(--mute); margin-top: var(--sp-3); font-size: var(--body-s); }

.post-header { max-width: 68ch; margin-bottom: var(--sp-8); }
.post-meta { font-family: var(--font-mono); font-size: var(--caption); color: var(--mute); margin-bottom: var(--sp-4); }
.prose { max-width: 68ch; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin-top: var(--sp-5); }
.prose h2 { font-size: var(--display-m); margin-top: var(--sp-10); }
.prose h3 { font-size: 1.1875rem; margin-top: var(--sp-8); }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li { margin-top: var(--sp-2); }
.prose code {
  font-family: var(--font-mono); font-size: .875em; background: var(--wait-wash);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.prose pre {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-5); overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: .875rem; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding-left: var(--sp-5); color: var(--ink-soft);
}
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.post-footer { max-width: 68ch; margin-top: var(--sp-10); padding-top: var(--sp-6); border-top: 1px solid var(--line); }
.post-standing {
  margin-top: var(--sp-8); padding: var(--sp-5) var(--sp-6); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card-2); color: var(--mute);
  font-size: var(--body-s); max-width: 68ch;
}

/* 12. Responsive ----------------------------------------------------------------- */
@media (max-width: 1023px) {
  .nav-links, .nav-signin { display: none; }
  .nav-trigger { display: block; }
  .nav-panel[hidden] { display: none; }
  .nav-panel {
    display: flex; flex-direction: column; gap: var(--sp-6);
    padding: var(--sp-6) var(--gutter-x) var(--sp-8);
    border-top: 1px solid var(--line); background: var(--bg);
  }
  .nav-panel nav { display: flex; flex-direction: column; gap: var(--sp-4); }
  .nav-panel nav a { text-decoration: none; color: var(--ink); font-size: 1.375rem; font-weight: 600; }
  .nav-panel .btn { width: 100%; }

  .grid-3, .price-grid { grid-template-columns: 1fr 1fr; }
  /* The footer collapses to one column — and because it is in normal flow with
     nothing fixed over it, it sits at the bottom of the page on a phone exactly
     as he asked. */
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
}

@media (max-width: 767px) {
  /* THE SCREENSHOTS GO UPRIGHT.
     Rotation + negative margin is the classic cause of horizontal scroll at
     phone width. The cluster becomes one centred column: still composed, just
     composed honestly for a narrow screen. !important because these are the one
     guarantee against overflow and must beat any future modifier class. */
  .device-cluster { flex-direction: column; align-items: center; gap: var(--sp-7); }
  .tilt-left, .tilt-centre, .tilt-right {
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .device-cluster .device, .tilt-centre { width: 260px !important; }
  .device-pair .device { width: 240px; }

  .grid-2, .grid-3, .price-grid { grid-template-columns: 1fr !important; }
  .post-card { grid-template-columns: 1fr; gap: var(--sp-3); }
  .btn-row .btn { width: 100%; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}

@media (max-width: 480px) {
  .device-cluster .device, .tilt-centre { width: 232px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* 13. Print ------------------------------------------------------------------------ */
@media print {
  .site-nav, .nav-panel, .btn { display: none; }
  body { background: #fff; color: #000; }
  .device { box-shadow: none; }
}

/* 14. Documentation ---------------------------------------------------------
   /docs/ and /docs/<slug>/. Uses the existing tokens and the existing .card,
   .post-card, .plan-table and .table-scroll idioms — nothing new is invented
   where something already exists. Light and dark both come from the tokens, so
   neither needed a second rule.
   -------------------------------------------------------------------------- */
.doc-group + .doc-group { margin-top: var(--sp-9); }
.doc-group-head {
  font-family: var(--font-mono); font-size: var(--caption); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mute);
  margin-bottom: var(--sp-5);
}
.doc-card h3 { font-size: var(--display-m); }
.doc-card-badge { margin-top: var(--sp-4); }

/* The plan badge. It appears three times on the CLI page and the FIRST is
   above the install command — a reader must learn the gate before they spend
   effort, not after. The numbers behind it are CONTRACT.md §7.1. */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--caption);
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent);
  border: 1px solid transparent; white-space: nowrap;
}
.plan-badge strong { font-weight: 700; }
.plan-badge-any { background: var(--good-wash); color: var(--good); }

.doc-top { padding-bottom: var(--sp-6); }
.doc-crumb {
  font-family: var(--font-mono); font-size: var(--caption);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--sp-4);
}
.doc-crumb a { color: var(--mute); text-decoration: none; }
.doc-crumb a:hover { color: var(--accent); }
.doc-stamp {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-5);
}
.doc-updated { font-family: var(--font-mono); font-size: var(--caption); color: var(--mute); }

/* "On this page" is plain anchors — it works with no JavaScript because it is
   nothing but links. */
.doc-toc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: var(--sp-5) var(--sp-6);
}
.doc-toc ul { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); margin-top: var(--sp-3); }
.doc-toc a { font-size: var(--body-s); text-decoration: none; }
.doc-toc a:hover { text-decoration: underline; }

.gate-card { margin-top: var(--sp-6); border-left: 3px solid var(--accent); }
.gate-badge { margin-bottom: var(--sp-4); }

/* The caveat list — rendered only by notYetList(), which is the single place a
   negative claim is allowed to live. See site/partials/docs.mjs. */
.not-yet { margin-top: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-4); }
.not-yet li {
  color: var(--mute); font-size: var(--body-s);
  padding-left: var(--sp-5); border-left: 2px solid var(--line);
}
.not-yet strong { color: var(--ink); }

.cmd-table td:first-child { white-space: nowrap; }
.cmd-table td:not(:first-child), .cmd-table th:not(:first-child) { text-align: left; }

/* 15. Command blocks, copy buttons, and the stepper -------------------------
   ⚠ THE OVERFLOW RULE IS THE ONE THAT MATTERS AT 320px.
   `brew install subbutgs/memoratu/mu` is 34 characters and is wider than a
   narrow phone can render. The base `pre { overflow-x: auto }` keeps it inside
   its own box; everything added here must not reintroduce the problem. That
   exact bug was already caught once on this site.
   -------------------------------------------------------------------------- */
.cmd { position: relative; margin-top: var(--sp-4); }
.cmd + .cmd { margin-top: var(--sp-3); }
.cmd-sample pre { background: var(--wait-wash); }
.cmd-sample pre code { color: var(--ink-soft); }

/* Injected by docs.js, never present in the HTML — so a reader with
   JavaScript off never meets a button that does nothing when tapped. */
.cmd-copy {
  position: absolute; top: 7px; right: 7px;
  font-family: var(--font-mono); font-size: var(--caption); font-weight: 600;
  padding: 5px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--mute);
}
.cmd-copy:hover { color: var(--accent); border-color: var(--accent); }
.cmd.has-copy pre { padding-right: 84px; }

/* The toast sits BESIDE the button, as he asked — not in a corner of the
   viewport. It is aria-hidden because the same text already goes to the one
   shared #docs-live region; announcing it twice is worse than once. */
.cmd-toast {
  position: absolute; top: 9px; right: 88px;
  font-size: var(--caption); font-weight: 600; white-space: nowrap;
  padding: 4px 9px; border-radius: 7px;
  background: var(--good-wash); color: var(--good);
  opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.cmd-toast.is-on { opacity: 1; transform: none; }
.cmd-toast.is-bad { background: var(--accent-wash); color: var(--accent); }

/* ---- the steps ----
   WITHOUT JAVASCRIPT THIS IS AN ORDINARY NUMBERED LIST and every rule below
   that hides anything is scoped under .js-steps — a class ONLY docs.js adds.
   The stylesheet therefore cannot hide a step unless JS ran. Do not invert
   this: CSS that hides by default and JS that reveals looks identical in a
   browser and is a documentation page Google reads as EMPTY. */
.steps { margin-top: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-5); list-style: none; padding: 0; }
.step {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: var(--sp-6);
}
.step-head {
  display: flex; align-items: center; gap: var(--sp-4);
  font-size: 1.0625rem; outline-offset: 4px;
}
.step-n {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--caption); font-weight: 700;
  background: var(--accent-wash); color: var(--accent);
}
.step-title { flex: 1 1 auto; }
.step-badge { margin-top: var(--sp-4); }
.step-body { margin-top: var(--sp-5); }
.step-body > p { margin-top: var(--sp-4); }
.step-body > p:first-child { margin-top: 0; }
.step-expect { color: var(--mute); font-size: var(--body-s); }
.step-next { margin-top: var(--sp-6); }
.step-toggle {
  display: none; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 8px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--mute);
  font-family: var(--font-mono); font-size: 1rem; line-height: 1;
}
.step-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* The progress panel and the finished panel are both injected by docs.js, so
   neither exists for a reader without it. */
.step-progress {
  margin-top: var(--sp-7);
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
}
.step-count {
  font-family: var(--font-mono); font-size: var(--caption); font-weight: 600;
  color: var(--mute); white-space: nowrap;
}
.step-bar {
  flex: 1 1 120px; min-width: 80px; height: 6px; border-radius: 999px;
  background: var(--wait-wash); overflow: hidden;
}
.step-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.step-reset { background: none; border: 0; font-size: var(--caption); padding: 0; }
.step-done-panel {
  margin-top: var(--sp-6); padding: var(--sp-6);
  border: 1px solid var(--good); border-radius: var(--radius);
  background: var(--good-wash); color: var(--ink);
}
.step-done-panel p + p { margin-top: var(--sp-4); }
.step-done-links { display: flex; flex-wrap: wrap; gap: var(--sp-5); }

/* THE ENHANCEMENT. Everything from here to the end of this block requires the
   .js-steps class, which only docs.js sets. HIDE FIRST, THEN SHOW — the show
   rules have equal specificity and must come after to win. */
.js-steps .step-toggle { display: inline-flex; }
.js-steps .step[data-state="done"] .step-body,
.js-steps .step[data-state="ahead"] .step-body { display: none; }
.js-steps .step[data-open] .step-body,
.js-steps .step[data-state="current"] .step-body { display: block; }
.js-steps .step[data-state="current"] .step-toggle { display: none; }
.js-steps .step:not([data-state="current"]) .step-next { display: none; }
.js-steps .step[data-state="current"] { border-color: var(--accent); box-shadow: var(--shadow-1); }
.js-steps .step[data-state="done"] .step-n { background: var(--good-wash); color: var(--good); }
.js-steps .step[data-state="done"] .step-title { color: var(--mute); }
.js-steps .step[data-state="ahead"] { background: var(--card-2); }
.js-steps .step[data-state="ahead"] .step-n { background: var(--wait-wash); color: var(--mute); }
.js-steps[data-finished="yes"] .step[data-state="done"] .step-n { background: var(--good-wash); color: var(--good); }

/* 16. Responsive — documentation -------------------------------------------
   THE 480px RULE EXISTS FOR ONE REASON: at phone width an absolutely
   positioned copy button sits on top of the command it is meant to copy. So
   below 480px it becomes a normal block under the <pre>, the <pre> gets its
   padding back, and the toast moves into the space the button left. No
   overlap, and nothing extends past the box — so no horizontal page scroll.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .doc-toc ul { flex-direction: column; gap: var(--sp-3); }
  .cmd-table td:first-child { white-space: normal; }
}

@media (max-width: 480px) {
  .cmd-copy {
    position: static; display: block; margin: var(--sp-3) 0 0 auto;
  }
  .cmd.has-copy pre { padding-right: var(--sp-4); }
  .cmd-toast { top: 9px; right: 9px; }
  .step { padding: var(--sp-5); }
  .step-head { font-size: 1rem; gap: var(--sp-3); }
  .step-next .btn { width: 100%; }
  .step-progress { gap: var(--sp-3); }
}
