/*
 * css.dev — Stylesheet
 *
 * Layers (in cascade order):
 *   1. reset       — Box-sizing, margin removal, reduced-motion
 *   2. tokens      — Design tokens: colors, type, space, radii
 *   3. layout      — Structural grids and page-level containers
 *   4. components  — All visual components (header, hero, bento, etc.)
 *   5. utilities   — One-off helpers (visually-hidden, etc.)
 */
@layer reset, tokens, layout, components, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
    padding: 0;
  }

  html {
    hanging-punctuation: first last;
    color-scheme: dark light;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-height: 100dvh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

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

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration-skip-ink: auto;
  }

  ul,
  ol {
    list-style: none;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer tokens {
  :root {
    /* ── Primitives ── */
    --gray-950: oklch(5.5% 0.005 260);
    --gray-900: oklch(9.5% 0.007 260);
    --gray-850: oklch(12% 0.007 260);
    --gray-800: oklch(15% 0.007 260);
    --gray-700: oklch(20% 0.006 260);
    --gray-600: oklch(30% 0.005 260);
    --gray-500: oklch(42% 0.005 260);
    --gray-400: oklch(55% 0.005 260);
    --gray-300: oklch(70% 0.005 260);
    --gray-200: oklch(85% 0.005 260);
    --gray-100: oklch(92% 0.003 260);
    --gray-50: oklch(97% 0.002 260);
    --white: oklch(98% 0.002 260);

    --lime: oklch(84% 0.17 128);
    --lime-muted: oklch(68% 0.11 128);
    --lime-dim: light-dark(oklch(90% 0.06 155), oklch(28% 0.06 175));
    --lime-wash: light-dark(oklch(96% 0.025 155), oklch(15% 0.03 175));
    --red: light-dark(oklch(55% 0.18 25), oklch(68% 0.15 25));
    --red-dim: light-dark(oklch(95% 0.025 25), oklch(22% 0.05 25));
    --green: light-dark(oklch(45% 0.14 155), oklch(74% 0.15 155));
    --green-dim: light-dark(oklch(95% 0.025 155), oklch(22% 0.05 155));

    /* ── Semantic ── */
    --color-bg: light-dark(var(--white), var(--gray-950));
    --color-surface: light-dark(var(--gray-50), var(--gray-900));
    --color-raised: light-dark(var(--gray-100), var(--gray-800));
    --color-border: light-dark(var(--gray-200), var(--gray-700));
    --color-border-subtle: light-dark(var(--gray-100), var(--gray-800));
    --color-text: light-dark(var(--gray-950), var(--white));
    --color-text-2: light-dark(var(--gray-500), var(--gray-300));
    --color-text-3: light-dark(var(--gray-400), var(--gray-400));
    --color-accent: light-dark(oklch(38% 0.1 168), oklch(76% 0.13 175));
    --color-accent-muted: light-dark(oklch(32% 0.07 168), oklch(60% 0.09 175));

    /* ── Type ── */
    --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

    --text-xs:  clamp(0.6875rem, 0.66rem + 0.14vw, 0.75rem);
    --text-sm:  clamp(0.8125rem, 0.78rem + 0.16vw, 0.875rem);
    --text-base: clamp(0.9375rem, 0.9rem  + 0.19vw, 1.0625rem);
    --text-lg:  clamp(1.125rem,  1.06rem  + 0.33vw, 1.3125rem);
    --text-xl:  clamp(1.375rem,  1.22rem  + 0.78vw, 1.75rem);
    --text-2xl: clamp(1.75rem,   1.5rem   + 1.25vw, 2.5rem);
    --text-3xl: clamp(2.25rem,   1.75rem  + 2.5vw,  3.75rem);
    --text-4xl: clamp(2.75rem,   2rem     + 3.75vw, 5rem);

    /* ── Space ── */
    --sp-3xs: clamp(0.25rem,  0.22rem + 0.15vw, 0.375rem);
    --sp-2xs: clamp(0.375rem, 0.33rem + 0.22vw, 0.5rem);
    --sp-xs:  clamp(0.5rem,   0.44rem + 0.28vw, 0.75rem);
    --sp-s:   clamp(0.75rem,  0.66rem + 0.45vw, 1rem);
    --sp-m:   clamp(1rem,     0.88rem + 0.6vw,  1.5rem);
    --sp-l:   clamp(1.5rem,   1.3rem  + 1vw,    2.25rem);
    --sp-xl:  clamp(2rem,     1.7rem  + 1.5vw,  3rem);
    --sp-2xl: clamp(3rem,     2.5rem  + 2.5vw,  4.5rem);
    --sp-3xl: clamp(3.5rem,   2.75rem + 3.75vw,  6rem);
    --sp-4xl: clamp(4.5rem,  3.5rem  + 5vw,     7.5rem);

    /* ── Misc ── */
    --radius-s: 6px;
    --radius-m: 8px;
    --radius-l: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;
    --max-w: 72rem;
    --gutter: var(--sp-m);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --dur: 180ms;
  }

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

@layer layout {
  body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
  }

  .container {
    width: 100%;
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  .container-wide {
    width: 100%;
    max-width: 82rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  /* ── Header ── */
  .header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 3.75rem;
  }

  /* ── Hero ── */
  .hero {
    position: relative;
    overflow: hidden;
    padding-block-start: var(--sp-4xl);
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 42rem;
    margin-inline: auto;
    padding-block-end: var(--sp-3xl);
  }

  .hero-demo {
    padding-block-end: var(--sp-4xl);
  }

  /* ── Sections ── */
  .section {
    padding-block: var(--sp-4xl);
  }

  /* ── Diff panes ── */
  .diff-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;

    @media (max-width: 52em) {
      grid-template-columns: 1fr;
    }
  }

  /* ── Bento grid ── */
  .skill-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;

    @media (max-width: 64em) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (max-width: 36em) {
      grid-template-columns: 1fr;
    }
  }

  .bento-core {
    grid-column: span 2;
    grid-row: span 2;

    @media (max-width: 64em) {
      grid-column: span 2;
      grid-row: span 1;
    }

    @media (max-width: 36em) {
      grid-column: span 1;
    }
  }

  /* ── Install: side-by-side ── */
  .install-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--sp-2xl);
    align-items: start;

    @media (max-width: 56em) {
      grid-template-columns: 1fr;
    }
  }

  .install-terminal {
    display: flex;
    flex-direction: column;
  }

  .install-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3xs);
    margin-block-end: var(--sp-m);
  }

  /* ── Manifesto ── */
  .manifesto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  /* ── Footer ── */
  .footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-2xs) var(--sp-m);
  }
}

@layer components {

  /* ═══════════════ HEADER ═══════════════ */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in oklch, var(--color-bg) 82%, transparent);
    backdrop-filter: blur(20px) saturate(1.6);
    border-block-end: 1px solid var(--color-border-subtle);
  }

  .logo {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-decoration: none;
    letter-spacing: -0.02em;
  }

  .logo-brace { color: var(--color-accent); }

  .nav-links {
    display: flex;
    justify-self: center;
    gap: var(--sp-l);
    & a {
      font-size: var(--text-sm);
      color: var(--color-text-3);
      text-decoration: none;
      transition: color var(--dur);
      &:hover { color: var(--color-text); }
    }
    @media (max-width: 34em) { display: none; }
  }

  .theme-toggle {
    justify-self: end;
    padding: 6px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    cursor: pointer;
    color: var(--color-text-3);
    line-height: 0;
    transition: color var(--dur), border-color var(--dur);
    &:hover { color: var(--color-text-2); border-color: var(--color-text-3); }
  }

  [data-theme="dark"] .icon-moon,
  [data-theme="light"] .icon-sun { display: none; }

  .skip-link {
    position: absolute; top: -100%; left: var(--sp-m);
    padding: var(--sp-3xs) var(--sp-s);
    background: var(--color-accent); color: var(--gray-950);
    border-radius: var(--radius-s); z-index: 100;
    text-decoration: none; font-weight: 600;
    &:focus { top: var(--sp-xs); }
  }

  /* ═══════════════ OVERLINE ═══════════════ */
  .overline {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-block-end: var(--sp-m);
  }

  /* ═══════════════ HERO ═══════════════ */
  .hero-orb {
    position: absolute;
    top: 0;
    left: 50%;
    translate: -50% 0;
    width: 460px;
    height: 460px;
    max-width: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;

    [data-theme="light"] & { opacity: 0.25; }
  }

  .hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
      55% 40% at 50% 25%,
      oklch(38% 0.09 175 / 0.12),
      transparent
    );
    pointer-events: none;
  }

  .hero-headline {
    font-family: var(--font-serif);
    font-size: var(--text-4xl);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-block-end: var(--sp-l);
    & em { font-style: italic; color: var(--color-accent); }
  }

  .hero-sub {
    font-size: var(--text-lg);
    color: var(--color-text-2);
    line-height: 1.45;
    max-width: 32rem;
    margin-block-end: var(--sp-xl);
  }

  .hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-s);
    margin-block-end: var(--sp-2xl);
  }

  .compat-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4em 1.4em;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-3);
  }

  /* ═══════════════ BUTTONS ═══════════════ */
  .btn {
    display: inline-flex;
    align-items: center;
    padding: 0.65em 1.7em;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--dur), border-color var(--dur), color var(--dur);
  }

  .btn-primary {
    background: var(--color-accent);
    color: light-dark(var(--white), var(--gray-950));
    &:hover { background: color-mix(in oklch, var(--color-accent), light-dark(black, white) 12%); }
  }

  .btn-ghost {
    color: var(--color-text-2);
    border-color: var(--color-border);
    &:hover { color: var(--color-text); border-color: var(--color-text-3); }
  }

  /* ═══════════════ SECTION HEADINGS ═══════════════ */
  .section-headline {
    font-family: var(--font-serif);
    font-size: var(--text-3xl);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-block-end: var(--sp-2xl);
    & em { font-style: italic; color: var(--color-accent); }
  }

  .section-headline-wide {
    max-width: 36rem;
  }

  /* ═══════════════ WINDOW (shared) ═══════════════ */
  .window {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .window-diff {
    box-shadow:
      0 1px 2px oklch(0% 0 0 / 0.04),
      0 3px 6px oklch(0% 0 0 / 0.04),
      0 8px 16px oklch(0% 0 0 / 0.05),
      0 16px 32px oklch(0% 0 0 / 0.05),
      0 32px 64px oklch(0% 0 0 / 0.07),
      0 0 0 1px oklch(0% 0 0 / 0.03);
  }

  [data-theme="dark"] .window-diff {
    box-shadow:
      0 0 0 1px oklch(100% 0 0 / 0.06),
      0 1px 3px oklch(0% 0 0 / 0.3),
      0 4px 12px oklch(0% 0 0 / 0.25),
      0 16px 40px oklch(0% 0 0 / 0.3);
  }

  .window-chrome {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--sp-xs) var(--sp-m);
    background: var(--color-bg);
    border-block-end: 1px solid var(--color-border-subtle);
  }

  .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-border);
  }

  .filename {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-2);
  }

  .badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
  }

  .badge-bad  { background: var(--red-dim);   color: var(--red); }
  .badge-good { background: var(--green-dim); color: var(--green); }

  .pane-code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.8;
    padding: var(--sp-m);
    overflow-x: auto;
    tab-size: 2;
    & code { font-family: inherit; }
  }

  /* Syntax tokens */
  .t-cm   { color: var(--color-text-3); }
  .t-sel  { color: oklch(75% 0.1 200); }
  .t-prop { color: var(--color-text-2); }
  .t-val  { color: var(--green); }
  .t-err  { color: var(--red); }
  .t-kw   { color: oklch(74% 0.12 310); }
  .t-ps   { color: var(--color-accent); user-select: none; }
  .t-ok   { color: var(--green); font-weight: 700; }

  /* Inline code annotations (shared) */
  @keyframes anno-in {
    from {
      opacity: 0;
      translate: -8px 0;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  .anno {
    --_anno-fg: light-dark(oklch(42% 0.14 25), oklch(78% 0.1 25));
    --_anno-bg: light-dark(var(--white), oklch(22% 0.015 25));
    --_anno-border: light-dark(oklch(90% 0.02 25), oklch(30% 0.03 25));

    position: relative;
    display: inline-block;
    margin-inline-start: 10px;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 4px 8px;
    white-space: nowrap;
    color: var(--_anno-fg);
    background: var(--_anno-bg);
    border: 1px solid var(--_anno-border);
    border-radius: var(--radius-s);
    user-select: none;
    vertical-align: middle;
    box-shadow:
      0 1px 2px oklch(0% 0 0 / 0.05),
      0 2px 4px oklch(0% 0 0 / 0.05),
      0 4px 8px oklch(0% 0 0 / 0.04),
      0 8px 16px oklch(0% 0 0 / 0.04),
      0 16px 32px oklch(0% 0 0 / 0.03);

    opacity: 0;
    translate: -20px 0;
    scale: 0.92;
    transition:
      opacity 0.6s ease,
      translate 0.6s var(--ease),
      scale 0.6s var(--ease);
  }

  .anno.is-visible {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }

  .anno::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    translate: 0 -50%;
    border: 4px solid transparent;
    border-right-color: var(--_anno-border);
  }

  .anno::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    translate: 1px -50%;
    border: 4px solid transparent;
    border-right-color: var(--_anno-bg);
  }

  .anno-good {
    --_anno-fg: light-dark(oklch(38% 0.12 165), oklch(78% 0.1 155));
    --_anno-bg: light-dark(var(--white), oklch(22% 0.015 155));
    --_anno-border: light-dark(oklch(88% 0.03 155), oklch(30% 0.04 155));
  }

  @media (max-width: 64em) {
    .anno { display: none; }
  }

  /* Pane footers */
  .pane-footer {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: var(--sp-xs) var(--sp-m);
    border-block-start: 1px solid var(--color-border-subtle);
  }

  .pane-footer-bad {
    color: var(--red);
  }

  .pane-footer-good {
    color: var(--green);
  }

  /* ═══════════════ DIFF (split-pane) ═══════════════ */
  .diff-pane:first-child {
    background: light-dark(oklch(97% 0.015 25), oklch(16% 0.02 25));
  }

  .diff-pane:first-child .diff-pane-head {
    background: light-dark(oklch(95% 0.02 25), oklch(13% 0.025 25));
  }

  .diff-pane:last-child {
    background: light-dark(oklch(97% 0.015 155), oklch(16% 0.02 155));
  }

  .diff-pane:last-child .diff-pane-head {
    background: light-dark(oklch(95% 0.02 155), oklch(13% 0.025 155));
  }

  .diff-pane + .diff-pane {
    border-inline-start: 1px solid var(--color-border);

    @media (max-width: 52em) {
      border-inline-start: 0;
      border-block-start: 1px solid var(--color-border);
    }
  }

  .diff-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2xs) var(--sp-m);
    border-block-end: 1px solid var(--color-border-subtle);
  }

  .diff-pane:first-child .pane-footer {
    background: light-dark(oklch(95% 0.02 25), oklch(8% 0.02 25));
  }

  .diff-pane:last-child .pane-footer {
    background: light-dark(oklch(95% 0.02 155), oklch(8% 0.02 155));
  }

  /* ═══════════════ BENTO SKILLS ═══════════════ */
  .bento-cell {
    background: var(--color-surface);
    padding: var(--sp-l);
    transition: background var(--dur) var(--ease);
    &:hover { background: var(--color-raised); }
  }

  .bento-core {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--lime-wash);
    padding: var(--sp-xl);
    &:hover { background: color-mix(in oklch, var(--lime-wash), var(--color-raised) 40%); }
  }

  .core-status {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-accent-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-block-end: var(--sp-m);
  }

  .pulse {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: pulse 2.5s ease-out infinite;
  }

  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 oklch(76% 0.13 175 / 0.5); }
    70%  { box-shadow: 0 0 0 8px oklch(76% 0.13 175 / 0); }
    100% { box-shadow: 0 0 0 0 oklch(76% 0.13 175 / 0); }
  }

  .core-name {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    margin-block-end: var(--sp-s);
  }

  .core-desc {
    color: var(--color-text-2);
    font-size: var(--text-sm);
    line-height: 1.6;
    max-width: 28rem;
  }

  .cell-icon {
    width: 20px; height: 20px;
    color: var(--color-text-3);
    margin-block-end: var(--sp-m);
  }

  .cell-cmd {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-accent);
    margin-block-end: var(--sp-2xs);
  }

  .bento-cell h3 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-block-end: var(--sp-3xs);
  }

  .bento-cell p {
    font-size: var(--text-sm);
    color: var(--color-text-2);
    line-height: 1.5;
  }

  /* ═══════════════ INSTALL ═══════════════ */
  .install-tab {
    padding: 5px var(--sp-s);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    cursor: pointer;
    color: var(--color-text-3);
    transition: color var(--dur), border-color var(--dur), background var(--dur);
    &:hover { color: var(--color-text-2); border-color: var(--color-text-3); }
    &.is-active {
      background: var(--color-accent);
      color: light-dark(var(--white), var(--gray-950));
      border-color: var(--color-accent);
    }
  }

  .install-panel[hidden] { display: none; }

  .install-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .install-panel.is-active {
    padding: var(--sp-l) var(--sp-xl);
  }

  .install-steps {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: var(--sp-l);
  }

  .install-steps li {
    counter-increment: step;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-s);
  }

  .install-steps li::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-accent);
    color: light-dark(var(--white), var(--gray-950));
  }

  .step-label {
    font-size: var(--text-sm);
    color: var(--color-text);
  }

  .step-path {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-accent);
    background: var(--lime-wash);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-s);
  }

  .btn-sm {
    padding: 0.4em 1.1em;
    font-size: var(--text-xs);
  }

  .install-cli {
    margin-block-start: var(--sp-l);
    padding-block-start: var(--sp-m);
    border-block-start: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    gap: var(--sp-s);
  }

  .install-cli-label {
    font-size: var(--text-xs);
    color: var(--color-text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
  }

  .install-cli-cmd {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-2);
    background: var(--color-bg);
    padding: 0.3em 0.6em;
    border-radius: var(--radius-s);
    border: 1px solid var(--color-border-subtle);
  }

  /* ═══════════════ MANIFESTO ═══════════════ */
  .manifesto-item {
    background: var(--color-surface);
    padding: var(--sp-l) var(--sp-xl);
  }

  .manifesto-n {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-3);
    margin-block-end: var(--sp-m);
  }

  .manifesto-title {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 400;
    font-style: italic;
    margin-block-end: var(--sp-xs);
  }

  .manifesto-item p {
    font-size: var(--text-sm);
    color: var(--color-text-2);
    line-height: 1.6;
  }

  .manifesto-item code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--color-accent);
    background: light-dark(oklch(92% 0.04 165), var(--lime-wash));
    padding: 0.1em 0.35em;
    border-radius: var(--radius-s);
  }

  /* ═══════════════ FOOTER ═══════════════ */
  .site-footer {
    padding-block: var(--sp-xl);
    border-block-start: 1px solid var(--color-border-subtle);
  }

  .footer-mid {
    font-size: var(--text-sm);
    color: var(--color-text-3);
  }

  .footer-end {
    font-size: var(--text-sm);
    color: var(--color-text-3);
    margin-inline-start: auto;
  }

  .footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 1em;
    & a {
      font-size: var(--text-sm);
      color: var(--color-text-3);
      text-decoration: none;
      transition: color var(--dur);
      &:hover { color: var(--color-text-2); }
    }
  }

  /* ═══════════════ LEGAL / PROSE (terms & privacy pages) ═══════════════ */
  .legal-hero {
    padding-block: var(--sp-3xl) var(--sp-xl);
    border-block-end: 1px solid var(--color-border-subtle);
  }

  .legal-hero .section-headline {
    margin-block-end: var(--sp-xs);
  }

  .legal-updated {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-3);
  }

  .prose {
    max-width: 48rem;
    padding-block: var(--sp-2xl) var(--sp-4xl);
  }

  .prose h2 {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 400;
    font-style: italic;
    margin-block: var(--sp-2xl) var(--sp-s);
  }

  .prose h2:first-child {
    margin-block-start: 0;
  }

  .prose p {
    color: var(--color-text-2);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-block-end: var(--sp-s);
  }

  .prose ul,
  .prose ol {
    color: var(--color-text-2);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-block-end: var(--sp-s);
    padding-inline-start: var(--sp-m);
  }

  .prose ul { list-style: disc; }
  .prose ol { list-style: decimal; }

  .prose li + li {
    margin-block-start: var(--sp-3xs);
  }

  .prose a {
    color: var(--color-accent);
    text-underline-offset: 0.15em;
    transition: color var(--dur);
    &:hover { color: var(--color-accent-muted); }
  }

  .prose strong {
    color: var(--color-text);
    font-weight: 600;
  }

  .prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--color-accent);
    background: var(--lime-wash);
    padding: 0.1em 0.35em;
    border-radius: var(--radius-s);
  }
}

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

