/* LYE LABS — design system
   ---------------------------------------------------------------------------
   No framework, no build step, no external requests. Self-hosted variable font,
   one stylesheet. The company's first product argues a small auditable surface
   beats a dependency tree, so the site is built the same way.

   Layers, in order:
     1. tokens        design decisions, in one place
     2. reset         predictable baseline
     3. layout        page shell and vertical rhythm
     4. header/footer chrome
     5. typography
     6. components    the vocabulary pages are written in
     7. utilities
     8. responsive + motion + print

   Dark mode follows the OS. Every colour used in a component is a token, so
   there is no per-component dark override to forget.
   --------------------------------------------------------------------------- */

/* ═══ 1. tokens ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter var";
  src: url("/fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ---- neutrals: a slightly cool ramp, not pure grey ---- */
  --n-0:  #ffffff;
  --n-25: #fcfcfd;
  --n-50: #f8f9fb;
  --n-100:#f1f3f7;
  --n-150:#e8ebf1;
  --n-200:#dfe3ea;
  --n-300:#c8cdd8;
  --n-400:#9aa3b2;
  --n-500:#737d8c;
  --n-600:#565f6e;
  --n-700:#3d4553;
  --n-800:#242b36;
  --n-900:#141920;
  --n-950:#0b0e13;

  /* ---- semantic surfaces ---- */
  --bg:          var(--n-0);
  --bg-subtle:   var(--n-50);
  --bg-sunken:   var(--n-100);
  --bg-raised:   var(--n-0);
  --bg-code:     #0d1117;

  --fg:          var(--n-950);
  --fg-muted:    var(--n-600);
  --fg-subtle:   var(--n-500);
  --fg-faint:    var(--n-400);
  --fg-invert:   var(--n-0);

  --border:      var(--n-200);
  --border-soft: var(--n-150);
  --border-hair: var(--n-100);
  --border-dark: #22272f;

  /* ---- brand: indigo with a cyan counterpoint for technical accents ---- */
  --brand:       #4f46e5;
  --brand-hover: #4338ca;
  --brand-fg:    #ffffff;
  --brand-soft:  #eef2ff;
  --brand-line:  #c7d2fe;

  --cyan:        #0891b2;

  --ok:          #047857;
  --ok-soft:     #ecfdf5;
  --warn:        #b45309;
  --warn-soft:   #fffbeb;
  --danger:      #be123c;
  --danger-soft: #fff1f2;

  /* ---- gradients: used sparingly, always as light, never a slab of colour ---- */
  --grad-brand:  linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%);
  --grad-sheen:  linear-gradient(180deg, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 100%);
  --grad-text:   linear-gradient(120deg, #4f46e5, #0891b2);
  --grad-halo:   radial-gradient(60% 60% at 20% 0%, rgba(99,102,241,.16), transparent 70%),
                 radial-gradient(50% 50% at 85% 5%, rgba(8,145,178,.12), transparent 70%);

  /* ---- elevation: layered, low-opacity, never a single hard shadow ---- */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 4px 8px -2px rgba(16, 24, 40, .07), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --sh-lg: 0 12px 20px -6px rgba(16, 24, 40, .09), 0 4px 8px -4px rgba(16, 24, 40, .05);
  --sh-xl: 0 24px 48px -12px rgba(16, 24, 40, .14), 0 8px 16px -8px rgba(16, 24, 40, .06);
  --sh-brand: 0 8px 20px -6px rgba(79, 70, 229, .32);

  /* ---- radius ---- */
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* ---- type: fluid ---- */
  --font: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --t-display: clamp(2.35rem, 1.6rem + 3.1vw, 3.85rem);
  --t-h1:      clamp(1.95rem, 1.45rem + 1.9vw, 2.75rem);
  --t-h2:      clamp(1.5rem, 1.25rem + 1vw, 1.95rem);
  --t-h3:      clamp(1.1rem, 1.02rem + .34vw, 1.3rem);
  --t-lede:    clamp(1.05rem, 1rem + .35vw, 1.21rem);
  --t-body:    1rem;
  --t-sm:      .875rem;
  --t-xs:      .8125rem;
  --t-2xs:     .75rem;

  --lh-tight: 1.06;
  --lh-snug:  1.22;
  --lh-body:  1.62;
  --lh-cjk:   1.8;

  /* ---- space: 4px base ---- */
  --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;  --s-4: 1rem;
  --s-5: 1.25rem; --s-6: 1.5rem;  --s-8: 2rem;    --s-10: 2.5rem;
  --s-12: 3rem;   --s-16: 4rem;   --s-20: 5rem;   --s-24: 6rem;

  --wrap: 1120px;
  --wrap-prose: 68ch;
  --gutter: clamp(1.15rem, .6rem + 2vw, 2rem);

  --dur: .18s;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---- dark mode: token swap only ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0b0e13;
    --bg-subtle:   #10141b;
    --bg-sunken:   #0d1117;
    --bg-raised:   #131820;
    --bg-code:     #080b10;

    --fg:          #eef1f6;
    --fg-muted:    #a3adbd;
    --fg-subtle:   #8b95a5;
    --fg-faint:    #6b7585;
    --fg-invert:   #0b0e13;

    --border:      #232a35;
    --border-soft: #1c222b;
    --border-hair: #171d25;
    --border-dark: #2a323d;

    --brand:       #7c7cf8;
    --brand-hover: #9291fa;
    --brand-fg:    #0f1020;
    --brand-soft:  rgba(99,102,241,.14);
    --brand-line:  rgba(99,102,241,.34);

    --cyan:        #22d3ee;

    --ok:          #34d399;
    --ok-soft:     rgba(4,120,87,.16);
    --warn:        #fbbf24;
    --warn-soft:   rgba(180,83,9,.16);
    --danger:      #fb7185;
    --danger-soft: rgba(190,18,60,.16);

    --grad-halo:   radial-gradient(60% 60% at 20% 0%, rgba(99,102,241,.22), transparent 70%),
                   radial-gradient(50% 50% at 85% 5%, rgba(34,211,238,.13), transparent 70%);
    --grad-sheen:  linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 100%);

    --sh-xs: 0 1px 2px rgba(0,0,0,.4);
    --sh-sm: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
    --sh-md: 0 4px 8px -2px rgba(0,0,0,.5), 0 2px 4px -2px rgba(0,0,0,.4);
    --sh-lg: 0 12px 20px -6px rgba(0,0,0,.55), 0 4px 8px -4px rgba(0,0,0,.4);
    --sh-xl: 0 24px 48px -12px rgba(0,0,0,.7), 0 8px 16px -8px rgba(0,0,0,.5);
  }
}

/* ═══ 2. reset ════════════════════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  tab-size: 2;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* CJK paragraphs want more leading and no negative tracking */
:lang(zh), :lang(zh-CN), :lang(ja), :lang(ko) { line-height: var(--lh-cjk); }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3,
:lang(zh-CN) h1, :lang(zh-CN) h2, :lang(zh-CN) h3 {
  letter-spacing: 0;
  line-height: 1.32;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

::selection { background: var(--brand-soft); color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ═══ 3. layout ═══════════════════════════════════════════════════════════ */

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

main { display: block; }

.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }

.section--subtle {
  background: var(--bg-subtle);
  border-block: 1px solid var(--border-hair);
}

.section--halo { background-image: var(--grad-halo); }

.section--dark {
  background: #0b0e13;
  color: #eef1f6;
  --fg: #eef1f6;
  --fg-muted: #a3adbd;
  --fg-subtle: #8b95a5;
  --fg-faint: #6b7585;
  --border: #232a35;
  --border-soft: #1c222b;
  --border-hair: #171d25;
  --bg-raised: #131820;
  --bg-subtle: #10141b;
  --bg-sunken: #0d1117;
  --brand: #7c7cf8;
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }

/* ═══ 4. chrome ═══════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-hair);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1rem;
  font-weight: 640;
  letter-spacing: -.02em;
  color: var(--fg);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-glyph {
  width: 1.6rem; height: 1.6rem;
  border-radius: var(--r-sm);
  background-image: var(--grad-brand);
  box-shadow: var(--sh-brand);
  display: grid; place-items: center;
  color: #fff; font-size: .8rem; font-weight: 750;
  letter-spacing: -.03em;
  flex: 0 0 auto;
}
.brand-rest { color: var(--fg-muted); font-weight: 520; }

.site-header nav { display: flex; align-items: center; gap: var(--s-1); }
.site-header nav a {
  color: var(--fg-muted);
  font-size: var(--t-sm);
  font-weight: 500;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.site-header nav a:hover {
  background: var(--bg-sunken);
  color: var(--fg);
  text-decoration: none;
}
.site-header nav a.is-active { color: var(--fg); background: var(--bg-sunken); }
.site-header nav a.nav-cta {
  background: var(--fg);
  color: var(--bg);
  font-weight: 590;
  margin-left: var(--s-2);
}
.site-header nav a.nav-cta:hover { opacity: .88; background: var(--fg); }

/* language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  margin-left: var(--s-2);
  background: var(--bg-sunken);
  border: 1px solid var(--border-hair);
  border-radius: var(--r-full);
}
.lang-switch a {
  font-size: var(--t-2xs);
  font-weight: 620;
  letter-spacing: .02em;
  padding: .2rem .5rem;
  border-radius: var(--r-full);
  color: var(--fg-subtle);
}
.lang-switch a:hover { text-decoration: none; color: var(--fg); background: transparent; }
.lang-switch a[aria-current="true"] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--sh-xs);
}

.site-footer {
  border-top: 1px solid var(--border-hair);
  background: var(--bg-subtle);
  margin-top: var(--s-20);
  padding-block: var(--s-10) var(--s-12);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-8);
  flex-wrap: wrap;
}
.site-footer .brand { font-size: var(--t-sm); margin-bottom: .35rem; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  font-size: var(--t-sm);
}
.site-footer nav a { color: var(--fg-muted); }
.site-footer nav a:hover { color: var(--fg); }

/* ═══ 5. typography ═══════════════════════════════════════════════════════ */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--fg);
  font-weight: 680;
  letter-spacing: -.021em;
  line-height: var(--lh-snug);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); letter-spacing: -.028em; }
h2 { font-size: var(--t-h2); letter-spacing: -.024em; }
h3 { font-size: var(--t-h3); letter-spacing: -.014em; font-weight: 640; }
h4 { font-size: var(--t-body); font-weight: 620; }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

.display {
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: -.035em;
  font-weight: 700;
  text-wrap: balance;
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}
:lang(zh) .lede { line-height: 1.72; }

.muted  { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.faint  { color: var(--fg-faint); }
.small  { font-size: var(--t-sm); }
.xsmall { font-size: var(--t-xs); line-height: 1.6; }
.mono   { font-family: var(--font-mono); font-size: .9em; }

.gradient-text {
  background-image: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--t-2xs);
  font-weight: 620;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-4);
}
.eyebrow::before {
  content: "";
  width: .4rem; height: .4rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
:lang(zh) .eyebrow { letter-spacing: .1em; }

.prose { max-width: var(--wrap-prose); }
.prose h2 { margin: var(--s-12) 0 var(--s-4); }
.prose h3 { margin: var(--s-8) 0 var(--s-3); }
.prose > :is(p, ul, ol, table, pre, blockquote, figure) { margin-bottom: var(--s-5); }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--fg-faint); }
.prose blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-1) 0 var(--s-1) var(--s-5);
  border-left: 3px solid var(--brand-line);
  color: var(--fg-muted);
  font-size: var(--t-lede);
}
.prose img { border-radius: var(--r-lg); border: 1px solid var(--border); margin-block: var(--s-6); }
.prose hr { margin-block: var(--s-10); }

hr { border: 0; border-top: 1px solid var(--border-hair); margin-block: var(--s-8); }

/* ═══ 6. components ═══════════════════════════════════════════════════════ */

/* ---- hero ---- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto -20%;
  height: 130%;
  background-image: var(--grad-halo);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1, .hero .display { max-width: 20ch; }
.hero .lede { max-width: 60ch; margin-top: var(--s-5); }
.hero--center { text-align: center; }
.hero--center h1, .hero--center .display,
.hero--center .lede { margin-inline: auto; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-8);
}
.hero--center .hero-actions { justify-content: center; }

.hero-note { margin-top: var(--s-5); font-size: var(--t-sm); color: var(--fg-subtle); }

/* ---- buttons ---- */
.btn {
  --btn-bg: var(--bg-raised);
  --btn-fg: var(--fg);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.05rem;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-sm);
  font-weight: 590;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--sh-xs);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-xs); }

.btn--primary {
  --btn-fg: #fff;
  --btn-border: transparent;
  background-image: var(--grad-brand);
  box-shadow: var(--sh-brand);
  position: relative;
  overflow: hidden;
}
.btn--primary::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--grad-sheen);
  opacity: .45;
  pointer-events: none;
}
.btn--primary:hover { box-shadow: 0 12px 26px -8px rgba(79,70,229,.45); }

.btn--ghost { --btn-bg: color-mix(in srgb, var(--bg) 60%, transparent); }
.btn--ghost:hover { --btn-bg: var(--bg-sunken); }

.btn--dark { --btn-bg: var(--fg); --btn-fg: var(--bg); --btn-border: transparent; }
.btn--dark:hover { opacity: .9; }

.btn--lg { padding: .8rem 1.35rem; font-size: var(--t-body); border-radius: var(--r-lg); }

.btn--link {
  --btn-bg: transparent; --btn-border: transparent;
  color: var(--fg-muted); box-shadow: none; padding-inline: .35rem;
}
.btn--link:hover { color: var(--fg); box-shadow: none; transform: none; }
.btn--link::after { content: "→"; transition: transform var(--dur) var(--ease); }
.btn--link:hover::after { transform: translateX(3px); }

/* ---- surface / card ---- */
.surface {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
}
.surface--flat { box-shadow: none; background: var(--bg-subtle); border-color: var(--border-soft); }
.surface--pad { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.surface--lift {
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.surface--lift:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); }

.grid { display: grid; gap: var(--s-5); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.feature { display: flex; flex-direction: column; gap: var(--s-3); }
.feature-icon {
  width: 2.1rem; height: 2.1rem;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-line);
  font-family: var(--font-mono);
  font-size: .82rem; font-weight: 680;
  flex: 0 0 auto;
}
.feature h3 { margin: 0; }
.feature p { color: var(--fg-muted); font-size: var(--t-sm); margin: 0; }

/* ---- stats ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  overflow: hidden;
}
.stats > div { padding: clamp(1.1rem, 2vw, 1.5rem); border-right: 1px solid var(--border-hair); }
.stats > div:last-child { border-right: 0; }
.stat-k {
  font-size: var(--t-2xs);
  font-weight: 620;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: .45rem;
}
.stat-v {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat-v--brand { color: var(--brand); }
.stat-v--ok { color: var(--ok); }
.stat-note { font-size: var(--t-xs); color: var(--fg-subtle); margin-top: .3rem; }

/* ---- section head ---- */
.section-head { max-width: 62ch; margin-bottom: clamp(1.75rem, 3vw, 2.75rem); }
.section-head h2 { margin-bottom: var(--s-3); }
.section-head .lede { font-size: var(--t-lede); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ---- terminal ---- */
.terminal {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-code);
  border: 1px solid var(--border-dark);
  box-shadow: var(--sh-xl);
  min-width: 0;
  max-width: 100%;
  position: relative;
}
.terminal::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  pointer-events: none;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: .6rem .85rem;
  background: #161b22;
  border-bottom: 1px solid #22272f;
}
.terminal-dots { display: flex; gap: .375rem; flex: 0 0 auto; }
.terminal-dots i {
  width: .62rem; height: .62rem; border-radius: 50%;
  background: #30363d; display: block;
}
.terminal-dots i:nth-child(1) { background: #ff5f57; }
.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  color: #7d8590;
  letter-spacing: .01em;
}
.terminal-body { padding: 1.1rem 1.15rem 1.25rem; overflow-x: auto; max-width: 100%; }
.terminal-body pre { margin: 0; background: none; border: 0; padding: 0; box-shadow: none; }
.terminal-body code {
  font-family: var(--font-mono);
  font-size: .76rem;
  line-height: 1.72;
  color: #c9d1d9;
  white-space: pre;
  background: none;
  border: 0;
  padding: 0;
}
@media (min-width: 640px) { .terminal-body code { font-size: .8125rem; } }

/* terminal syntax accents */
.t-prompt { color: #58a6ff; }
.t-dim    { color: #6e7681; }
.t-key    { color: #79c0ff; }
.t-ok     { color: #56d364; }
.t-warn   { color: #d29922; }
.t-crit   { color: #ff7b72; font-weight: 600; }
.t-num    { color: #ffa657; }
.t-str    { color: #a5d6ff; }

/* ---- code ---- */
code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--bg-sunken);
  border: 1px solid var(--border-hair);
  color: var(--fg);
  padding: .1em .36em;
  border-radius: var(--r-xs);
  overflow-wrap: anywhere;
}
pre {
  background: var(--bg-code);
  color: #c9d1d9;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  overflow-x: auto;
  margin: 0 0 var(--s-5);
  font-size: .8125rem;
  line-height: 1.72;
  box-shadow: var(--sh-sm);
}
pre code { background: none; border: 0; color: inherit; padding: 0; font-size: inherit; }

/* ---- steps ---- */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: var(--s-5);
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--border-hair);
}
.step:last-child { border-bottom: 0; }
.step-num {
  counter-increment: step;
  width: 2.1rem; height: 2.1rem;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  display: grid; place-items: center;
  font-size: var(--t-sm); font-weight: 660;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--sh-xs);
  flex: 0 0 auto;
}
.step-num::before { content: counter(step); }
.step-body { min-width: 0; }
.step-body h3 { margin-bottom: var(--s-2); }
.step-body > p { color: var(--fg-muted); font-size: var(--t-sm); }
.step-body .terminal { margin-top: var(--s-5); }

/* ---- flow ---- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--sh-sm);
}
.flow-node { padding: var(--s-5); min-width: 0; border-right: 1px solid var(--border-hair); }
.flow-node:last-child { border-right: 0; }
.flow-node--active { background: var(--brand-soft); }
.flow-node--dark { background: #0b0e13; color: #eef1f6; }
.flow-node--dark .flow-label { color: #8b95a5; }
.flow-node--dark .flow-note { color: #a3adbd; }
.flow-label {
  font-size: var(--t-2xs); font-weight: 620; letter-spacing: .07em;
  text-transform: uppercase; color: var(--fg-faint); margin-bottom: .4rem;
}
.flow-title { font-size: var(--t-sm); font-weight: 640; letter-spacing: -.01em; }
.flow-note { font-size: var(--t-xs); color: var(--fg-subtle); margin-top: .35rem; line-height: 1.55; }

/* ---- table ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--s-5);
}
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border-hair); }
th {
  font-size: var(--t-2xs); font-weight: 620; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-faint);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-subtle); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table--flush { border: 0; border-radius: 0; box-shadow: none; background: none; }
.table--flush th { background: none; }

/* pricing table emphasises the price column */
.table--pricing td:nth-child(2) {
  font-weight: 640; color: var(--ok); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- callout ---- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  padding: var(--s-5);
  margin-block: var(--s-6);
}
.callout--ok { border-left-color: var(--ok); background: var(--ok-soft); }
.callout--warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-title { font-weight: 650; font-size: var(--t-sm); margin-bottom: .35rem; color: var(--fg); }
.callout p { font-size: var(--t-sm); color: var(--fg-muted); margin: 0; }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: var(--t-2xs); font-weight: 620; letter-spacing: .01em;
  padding: .18rem .5rem; border-radius: var(--r-full);
  background: var(--bg-sunken); color: var(--fg-muted);
  border: 1px solid var(--border-hair);
  white-space: nowrap;
}
.badge--brand { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.badge--ok    { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge--warn  { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge--danger{ background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--s-4); }

/* ---- page head ---- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--s-2); }
.page-head h1 { max-width: 26ch; }
.page-head .lede { margin-top: var(--s-4); max-width: 62ch; }

/* ---- post list ---- */
.post-list { list-style: none; padding: 0; margin: var(--s-8) 0 0; }
.post-card { border-bottom: 1px solid var(--border-hair); }
.post-card:first-child { border-top: 1px solid var(--border-hair); }
.post-card a { display: block; padding: var(--s-6) 0; color: inherit; }
.post-card a:hover { text-decoration: none; }
.post-card h2 { font-size: var(--t-h3); margin-bottom: .35rem; transition: color var(--dur) var(--ease); }
.post-card a:hover h2 { color: var(--brand); }
.post-card p { color: var(--fg-muted); font-size: var(--t-sm); margin-bottom: .45rem; max-width: 68ch; }
.post-card time { font-size: var(--t-xs); color: var(--fg-faint); font-variant-numeric: tabular-nums; }

.post-header { margin-bottom: var(--s-8); max-width: var(--wrap-prose); }
.post-header h1 { margin: .4rem 0 var(--s-4); }
.post-date { font-size: var(--t-xs); color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.post-lede { font-size: var(--t-lede); color: var(--fg-muted); line-height: 1.55; }

/* ═══ 7. utilities ════════════════════════════════════════════════════════ */

.center { text-align: center; }
.stack { display: grid; gap: var(--s-3); }
.stack-lg { display: grid; gap: var(--s-5); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.nowrap { white-space: nowrap; }
.mt-0{margin-top:0} .mt-2{margin-top:var(--s-2)} .mt-3{margin-top:var(--s-3)}
.mt-4{margin-top:var(--s-4)} .mt-5{margin-top:var(--s-5)} .mt-6{margin-top:var(--s-6)}
.mt-8{margin-top:var(--s-8)} .mt-10{margin-top:var(--s-10)} .mt-12{margin-top:var(--s-12)}
.mb-0{margin-bottom:0} .mb-2{margin-bottom:var(--s-2)} .mb-3{margin-bottom:var(--s-3)}
.mb-4{margin-bottom:var(--s-4)} .mb-5{margin-bottom:var(--s-5)} .mb-6{margin-bottom:var(--s-6)}
.mb-8{margin-bottom:var(--s-8)}
.measure { max-width: var(--wrap-prose); }
.balance { text-wrap: balance; }

.skip-link {
  position: absolute; left: -9999px; top: .5rem;
  background: var(--fg); color: var(--bg);
  padding: .6rem 1rem; border-radius: var(--r-md); z-index: 100;
}
.skip-link:focus { left: var(--gutter); }

.texture-dots {
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ═══ 8. responsive ═══════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-node:nth-child(2n) { border-right: 0; }
  .flow-node:nth-child(-n+2) { border-bottom: 1px solid var(--border-hair); }
}

@media (max-width: 820px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(2n) { border-right: 0; }
  .stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-hair); }
}

@media (max-width: 680px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-node { border-right: 0; border-bottom: 1px solid var(--border-hair); }
  .flow-node:last-child { border-bottom: 0; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div { border-right: 0; border-bottom: 1px solid var(--border-hair); }
  .stats > div:last-child { border-bottom: 0; }
  .step { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .site-header nav a.nav-hide-sm { display: none; }
  .site-header nav a { padding: .4rem .55rem; }
  .btn { padding: .58rem .9rem; }
  .terminal-body { padding: .9rem .95rem 1.05rem; }
  .terminal-body code { font-size: .7rem; }
  .table-wrap { border-radius: var(--r-md); }
  th, td { padding: .6rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .surface--lift:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .terminal-bar, .lang-switch { display: none; }
  body { font-size: 11pt; background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .surface, .terminal, .callout, .stats, .table-wrap { break-inside: avoid; box-shadow: none; }
  .section { padding-block: 1rem; }
}
