/* =========================================================
   cc-bot showcase — single sheet, raw CSS
   palette: PCB ink + silkscreen bone + copper trace + solder green
   typography: Fraunces (editorial display) + Inter (UI) +
   JetBrains Mono (code); zh fallback Noto Serif SC + Noto Sans SC.
   ========================================================= */

:root {
  --ink: #0a0a0a;
  --ink-2: #0d1311;
  --ink-3: #131a17;
  --bone: #f3eee5;
  --bone-2: #e6e0d3;
  --line: #1d2a25;
  --line-soft: rgba(243, 238, 229, 0.12);
  --muted: #7a8a82;
  --signal: #d68f44;      /* copper trace */
  --acid: #2fae6f;        /* solder-mask green */
  --aqua: #6fd5a6;        /* via highlight */
  --gold: #e5b94d;        /* gold finger */

  --f-display: "Fraunces", "Noto Serif SC", ui-serif, Georgia, serif;
  --f-ui: "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", "Noto Sans SC", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gut: clamp(20px, 4vw, 56px);
  --col-max: 1280px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.7, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* CJK adjustments — Chinese mode */
html[lang="zh"] {
  line-height: 1.7;
}
html[lang="zh"] body {
  letter-spacing: 0;
}
html[lang="zh"] .hero__title,
html[lang="zh"] .section__h,
html[lang="zh"] .cta h2 {
  letter-spacing: -0.01em;
  line-height: 1.08;
}
/* CJK has no real italic — kill synthetic oblique on display <em>,
   lean on Noto Serif SC bold (700 cut) instead. */
html[lang="zh"] .hero__title em,
html[lang="zh"] .section__h em,
html[lang="zh"] .cta h2 em {
  font-style: normal;
  font-weight: 700;
}

/* ZH hero title: bold Song with bracketed accent + Latin caption
   reference: poster typography (有田烧业「400年」纪念) — large bold
   characters with smaller English caption tucked beneath. */
html[lang="zh"] .hero__title,
html[lang="zh"] .section__h,
html[lang="zh"] .cta h2 {
  font-weight: 900;          /* section h2 level keeps the heaviest cut */
}
html[lang="zh"] .hero__title-en > em {
  font-size: 1.22em;
  letter-spacing: -0.02em;
  font-weight: 900;          /* hero em — heaviest + colored + 1.22× */
}
/* Small Latin caption below the ZH title — added via ::after on the
   wrapper, using the i18n attribute. */
html[lang="zh"] .hero__title-en::after {
  content: "GROUP CHAT  ·  LOCAL AGENT  ·  WHOLE PROJECT";
  display: block;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.18em;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 1.1em;
  margin-bottom: 0.4em;
}
html[lang="zh"] .section__kicker,
html[lang="zh"] .eyebrow {
  letter-spacing: 0.12em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

code,
pre {
  font-family: var(--f-mono);
}

::selection {
  background: var(--signal);
  color: var(--ink);
}

/* Grain layer ============================================== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
  background-size: 160px 160px;
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-1%, -3%); }
  100% { transform: translate(0, 0); }
}

/* Soft cursor light ======================================== */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 860px;
  height: 860px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(214, 143, 68, 0.20), transparent 68%),
    radial-gradient(closest-side, rgba(47, 174, 111, 0.08), transparent 82%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 300ms ease;
  opacity: 0;
  filter: blur(32px);
  will-change: transform;
}
body.cursor-on .cursor-glow {
  opacity: 1;
}

/* Nav ====================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gut);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
/* PCB-trace divider between 'cc' and 'bot': tiny pad – thin trace – tiny pad.
   Sized in em so it scales with the nav font; vertical-align tuned to
   sit on the lowercase x-height middle, not above. */
.nav__word i.nav__trace {
  display: inline-block;
  width: 0.24em;
  height: 0.11em;
  margin: 0 0.20em;
  vertical-align: 0.20em;
  background: var(--signal);
  position: relative;
  font-style: normal;
  border-radius: 0.04em;
}
.nav__word i.nav__trace::before,
.nav__word i.nav__trace::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.22em;
  height: 0.22em;
  border-radius: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
}
/* left end: hollow ring — PCB via, periodically struck by a welding arc */
.nav__word i.nav__trace::before {
  left: -0.13em;
  background: transparent;
  border: 0.05em solid var(--signal);
  animation: nav-via-weld 3.4s steps(1, end) infinite;
}
/* right end: filled solder pad */
.nav__word i.nav__trace::after {
  right: -0.13em;
  background: var(--signal);
}
/* Welding-arc strike: dark plateau most of the cycle, then a fast
   bright-dim-bright sputter (~5 frames in 0.5s) before snapping
   back to dark. steps(1, end) on the parent keeps each frame a
   hard cut — no smooth interpolation — so it reads as electrical
   sparking, not a gentle glow. */
@keyframes nav-via-weld {
  0%, 56%, 78%, 100% {
    background: transparent;
    border-color: var(--signal);
    box-shadow: 0 0 0 0 transparent;
  }
  58% {
    background: rgba(255, 245, 215, 0.95);
    border-color: #fff7e0;
    box-shadow:
      0 0 0 1px rgba(255, 250, 230, 1),
      0 0 12px 3px rgba(255, 240, 200, 0.85),
      0 0 26px 6px rgba(214, 143, 68, 0.55);
  }
  62% {
    background: rgba(214, 143, 68, 0.28);
    border-color: rgba(255, 200, 130, 1);
    box-shadow: 0 0 5px 0.5px rgba(214, 143, 68, 0.4);
  }
  64% {
    background: rgba(255, 240, 200, 0.9);
    border-color: #ffeec0;
    box-shadow:
      0 0 10px 2px rgba(255, 235, 190, 0.8),
      0 0 20px 4px rgba(214, 143, 68, 0.45);
  }
  68% {
    background: rgba(214, 143, 68, 0.18);
    border-color: rgba(255, 200, 130, 0.85);
    box-shadow: 0 0 3px 0 rgba(214, 143, 68, 0.3);
  }
  72% {
    background: rgba(255, 230, 180, 0.7);
    border-color: #ffe0a8;
    box-shadow: 0 0 7px 1.5px rgba(255, 225, 170, 0.7);
  }
  76% {
    background: transparent;
    border-color: var(--signal);
    box-shadow: 0 0 0 0 transparent;
  }
}
.nav__forslack {
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aqua);
  background: rgba(111, 213, 166, 0.08);
  border: 1px solid rgba(111, 213, 166, 0.3);
}
@media (max-width: 540px) {
  .nav__forslack { display: none; }
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
}
.nav__menu a {
  position: relative;
  color: var(--bone-2);
  transition: color 220ms var(--ease-out);
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--signal);
  transition: right 280ms var(--ease-out);
}
.nav__menu a:hover {
  color: var(--bone);
}
.nav__menu a:hover::after {
  right: 0;
}
.nav__cta {
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
}
.nav__cta:hover {
  border-color: var(--signal);
  color: var(--bone);
}
.nav__cta::after {
  display: none;
}

/* Language toggle ========================================== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.lang-toggle__btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 2px 4px;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 220ms var(--ease-out);
}
.lang-toggle__btn:hover {
  color: var(--bone);
}
.lang-toggle__btn.is-active {
  color: var(--signal);
}
.lang-toggle__sep {
  color: var(--line);
}

@media (max-width: 720px) {
  .nav__menu {
    gap: 14px;
    font-size: 13px;
  }
  .nav__menu a:not(.nav__cta):not(:last-of-type) {
    display: none;
  }
  .lang-toggle {
    margin-left: 0;
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* Reveal animation ========================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 800ms var(--ease-out),
    transform 800ms var(--ease-out);
  transition-delay: 0ms;
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .grain {
    animation: none;
  }
}

/* Hero ===================================================== */
.hero {
  position: relative;
  padding: clamp(40px, 8vw, 110px) var(--gut) clamp(60px, 9vw, 140px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(800px 600px at 20% 0%, rgba(214, 143, 68, 0.10), transparent 70%),
    radial-gradient(700px 500px at 100% 30%, rgba(111, 213, 166, 0.06), transparent 70%);
}

.hero__marquee {
  position: absolute;
  inset: auto 0 50% 0;
  overflow: hidden;
  transform: translateY(50%);
  z-index: 0;
  opacity: 0.06;
  pointer-events: none;
  white-space: nowrap;
}
.hero__marquee-track {
  display: inline-block;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(120px, 22vw, 320px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--bone);
  animation: marquee 60s linear infinite;
}
.hero__marquee-track span {
  margin: 0 0.25em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--col-max);
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--bone-2);
  background: rgba(243, 238, 229, 0.04);
  border: 1px solid var(--line-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 28px;
}
.eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

.hero__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(46px, 7.2vw, 116px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--bone);
  max-width: 1100px;
}
.hero__title-en {
  display: flex;
  flex-direction: column;
  align-items: flex-start;  /* default — overridden per stanza */
}
.hero__title-en > span,
.hero__title-en > em {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0;
}
/* Asymmetric three-stanza composition — breaks the flush-left
   rectangle so the title reads as movement, not a list:
     1)  Group chat       flush-left, biggest, the hammer
     2)              「Local Agent」   pushed to the right edge
     3)     Whole project          indented, smaller, descending
*/
.hero__title-en > span:first-of-type {
  font-size: 1.45em;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.92;
  align-self: flex-start;
}
html[lang="zh"] .hero__title-en > span:first-of-type {
  font-weight: 900;
  letter-spacing: -0.04em;
}
.hero__title-en > em {
  align-self: flex-end;          /* push em to the right edge */
  margin-top: 0.06em;            /* lift slightly toward 'Group chat' descenders */
}
.hero__title-en > span:last-of-type {
  margin-left: 1.4em;            /* staircase indent */
  font-size: 0.86em;             /* descend into the closer */
  align-self: flex-start;
}

/* Mobile: the asymmetric composition (em flex-end, last-span indent,
   1.45× opener) overflows narrow viewports — 「Local Agent」 wraps
   across two lines and the title looks broken. Collapse to a calm
   flush-left stack with milder size variation. */
@media (max-width: 640px) {
  .hero__title {
    font-size: clamp(32px, 9vw, 60px);
    line-height: 1.0;
  }
  .hero__title-en {
    align-items: flex-start;
  }
  .hero__title-en > span:first-of-type {
    font-size: 1.15em;
    letter-spacing: -0.03em;
    line-height: 0.98;
  }
  html[lang="zh"] .hero__title-en > span:first-of-type {
    letter-spacing: -0.02em;
  }
  .hero__title-en > em {
    align-self: flex-start;
    margin-top: 0;
    font-size: 1.1em;
    letter-spacing: -0.02em;
  }
  .hero__title-en > span:last-of-type {
    margin-left: 0;
    font-size: 1em;
  }
  .hero__title-en::after {
    font-size: 0.22em;
    letter-spacing: 0.15em;
    margin-top: 0.8em;
  }
}
.hero__title em {
  font-style: normal;
  font-weight: 700;
  font-size: 1.22em;
  color: var(--signal);
  letter-spacing: -0.04em;
  position: relative;
}
/* Caption beneath the title — small letter-spaced subline echoing
   the reference poster's bilingual layering.
   EN mode default: English tagline derived from cc-bot's upstream
   project description (not a translation of the title above). */
.hero__title-en::after {
  content: "DEVELOP PROJECT FROM GROUP CHAT  ·  BY CLAUDE CODE";
  display: block;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.18em;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 1.1em;
  margin-bottom: 0.4em;
}

.hero__lede {
  max-width: 660px;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--bone-2);
  margin: 40px 0 0;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 280ms var(--ease-out), background 280ms var(--ease-out), color 280ms var(--ease-out);
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--signal);
  color: var(--ink);
}
.btn--primary:hover {
  background: var(--bone);
}
.btn--ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--bone);
}
.btn__arrow {
  transition: transform 280ms var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* Hero chat mockup ========================================= */
.hero__chat {
  position: relative;
  z-index: 2;
  margin: 56px auto 0;
  max-width: 640px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: rotate(-0.6deg);
  transition: transform 500ms var(--ease-out);
}
.hero__chat:hover {
  transform: rotate(0deg) translateY(-4px);
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.chat__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.chat__dot--r { background: #ff605c; }
.chat__dot--y { background: #ffbd44; }
.chat__dot--g { background: #00ca4e; }
.chat__title {
  margin-left: 6px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--bone-2);
}
.chat__hash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--signal), var(--gold));
  color: var(--ink);
}
.chat__head-spacer { flex: 1; }
.chat__bot-tag {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
  background: var(--acid);
  font-weight: 700;
}
.chat__app {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  background: rgba(47, 174, 111, 0.15);
  color: var(--acid);
  vertical-align: middle;
}
.chat__feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat__msg {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 95%;
  animation: bubble 700ms var(--ease-out) both;
}
.chat__msg b {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.chat__msg p {
  margin: 0;
  color: var(--bone);
}
.chat__msg--me {
  align-self: flex-end;
  background: rgba(214, 143, 68, 0.12);
  border: 1px solid rgba(214, 143, 68, 0.35);
}
.chat__msg--bot {
  align-self: flex-start;
  background: rgba(243, 238, 229, 0.04);
  border: 1px solid var(--line-soft);
}
.chat__msg--bot:nth-child(2) {
  animation-delay: 250ms;
}
.chat__msg--done {
  animation-delay: 600ms;
  border-color: rgba(47, 174, 111, 0.25);
}
.chat__msg code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.chat__msg a {
  color: var(--acid);
  border-bottom: 1px solid currentColor;
}
.chat__pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(111, 213, 166, 0.12);
  border: 1px solid rgba(111, 213, 166, 0.3);
  color: var(--aqua);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
@keyframes bubble {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sections ================================================= */
.section {
  position: relative;
  padding: clamp(64px, 9vw, 140px) var(--gut);
  max-width: var(--col-max);
  margin: 0 auto;
}
.rule {
  position: absolute;
  top: 0;
  left: var(--gut);
  right: var(--gut);
  height: 1px;
  background: linear-gradient(90deg, var(--signal), transparent 30%, transparent 70%, var(--aqua));
  opacity: 0.4;
}

.section__kicker {
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--signal);
  margin: 0 0 26px;
}
.section__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(34px, 5.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 40px;
  color: var(--bone);
  max-width: 1080px;
}
.section__h em {
  font-style: normal;
  color: var(--signal);
  font-weight: 700;
}

.lede {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--bone-2);
  line-height: 1.65;
  max-width: 56ch;
  margin: 0;
}
.lede--wide {
  max-width: 70ch;
}

.grid {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
}
.grid--two {
  grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 820px) {
  .grid--two {
    grid-template-columns: 1fr;
  }
}

.bigfacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(20px, 3vw, 36px);
}
.bigfacts li {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.bigfacts span {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1;
  color: var(--signal);
  letter-spacing: -0.04em;
  min-width: 1.6em;
}
.bigfacts i {
  font-style: normal;
  color: var(--bone-2);
  font-size: 15px;
  line-height: 1.4;
}

/* Cards ==================================================== */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
}

/* Local-first callout ======================================= */
.locals {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.local {
  padding: 26px 24px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(243, 238, 229, 0.025);
  transition: border-color 320ms var(--ease-out), background 320ms var(--ease-out);
}
.local:hover {
  border-color: rgba(214, 143, 68, 0.45);
  background: rgba(214, 143, 68, 0.04);
}
.local h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  color: var(--signal);
}
.local p {
  margin: 0;
  color: var(--bone-2);
  font-size: 15px;
  line-height: 1.6;
}
@media (max-width: 1080px) {
  .locals { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .locals { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  padding: 28px 26px 26px;
  background: linear-gradient(180deg, rgba(243, 238, 229, 0.03), transparent);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 360ms var(--ease-out), border-color 360ms var(--ease-out), background 360ms var(--ease-out);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(180deg, var(--signal), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 360ms var(--ease-out);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  background: linear-gradient(180deg, rgba(214, 143, 68, 0.05), transparent 70%);
  border-color: rgba(214, 143, 68, 0.4);
}
.card:hover::before {
  opacity: 0.55;
}
.card__no {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0;
}
.card h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--bone);
}
/* ZH card-style headings: Noto Serif SC Bold (思源宋体 Bold 700)
   — matches the dialed-down display weight elsewhere. */
html[lang="zh"] .card h3,
html[lang="zh"] .scenario h3,
html[lang="zh"] .local h3,
html[lang="zh"] .step h3 {
  font-weight: 700;
}
.card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--bone-2);
  margin: 0;
  flex: 1;
}
.card code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}
.card__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card__chips li {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(214, 143, 68, 0.08);
  border: 1px solid rgba(214, 143, 68, 0.25);
  color: var(--signal);
}

/* Architecture diagram ===================================== */
.diagram {
  margin: 30px 0 50px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(243, 238, 229, 0.02), transparent);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  overflow-x: auto;
}
.diagram svg {
  width: 100%;
  height: auto;
  min-width: 720px;
}
.diagram figcaption {
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.diagram .d-col rect {
  fill: rgba(243, 238, 229, 0.025);
  stroke: var(--line);
  stroke-width: 1;
}
.diagram .d-col text {
  fill: var(--bone);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.diagram .d-pill rect {
  fill: rgba(214, 143, 68, 0.08);
  stroke: rgba(214, 143, 68, 0.35);
}
.diagram .d-pill text {
  font-family: var(--f-mono);
  font-size: 13px;
  fill: var(--bone);
  text-anchor: middle;
  dominant-baseline: middle;
}
.diagram .d-pill--accent rect {
  fill: rgba(47, 174, 111, 0.08);
  stroke: rgba(47, 174, 111, 0.4);
}
.diagram .d-note {
  font-family: var(--f-mono);
  font-size: 11px;
  fill: var(--muted);
  font-weight: 400;
}
.diagram .d-note--em {
  fill: var(--aqua);
}
.diagram .d-arrow path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: dash 1.2s var(--ease-out) 0.5s forwards;
}
@keyframes dash {
  to { stroke-dashoffset: 0; }
}

/* Permission matrix ======================================== */
.perm {
  margin-top: 30px;
}
.perm__h {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.perm__grid {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(243, 238, 229, 0.02);
}
.perm__row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.6fr;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.perm__row:last-child { border-bottom: 0; }
.perm__row--head {
  background: rgba(243, 238, 229, 0.04);
  font-family: var(--f-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.perm__row b {
  color: var(--signal);
  font-family: var(--f-mono);
  font-size: 14px;
}
.perm__row code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  margin-right: 4px;
}
@media (max-width: 720px) {
  .perm__row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }
  .perm__row--head { display: none; }
}

/* Install steps ============================================ */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px 16px;
  align-items: center;
  padding: 16px 20px 18px;
  background: rgba(243, 238, 229, 0.02);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  transition: border-color 320ms var(--ease-out);
}
.step > .step__no {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
.step > h3 {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}
.step > *:not(.step__no):not(h3) {
  grid-column: 1 / -1;
  min-width: 0;
}
.step:hover {
  border-color: rgba(214, 143, 68, 0.35);
}
.step__no {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  color: var(--signal);
  letter-spacing: -0.04em;
  margin: 0;
  text-align: center;
}
.step h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.02em;
}
.step__after {
  margin: 6px 0 0;
  color: var(--bone-2);
  font-size: 14.5px;
}
.step__after code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
@media (max-width: 640px) {
  .step {
    grid-template-columns: 1fr;
    padding: 16px 14px;
    gap: 6px;
  }
  /* collapse the 2-col head into a single stacked column so nothing
     lands in a phantom col 2 that would balloon the card width */
  .step > .step__no,
  .step > h3,
  .step > *:not(.step__no):not(h3) {
    grid-column: 1;
  }
  .step > .step__no { grid-row: 1; align-self: start; text-align: left; }
  .step > h3       { grid-row: 2; align-self: start; }
  .step__no { font-size: 32px; }
  .step h3 { font-size: 19px; }

  /* code blocks: shrink to fit narrow viewports, leave room for the
     copy button without forcing the card to overflow */
  .step .code {
    font-size: 12.5px;
    padding: 14px 56px 14px 14px;
    border-radius: 10px;
  }
  .step .copy {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
}

.code {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 18px 64px 18px 18px;
  margin: 0;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bone);
  white-space: pre;
}
.code .tk-c { color: var(--muted); }
.code .tk-p { color: var(--acid); }

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(243, 238, 229, 0.06);
  border: 1px solid var(--line-soft);
  color: var(--bone-2);
  cursor: pointer;
  transition: background 220ms var(--ease-out), color 220ms var(--ease-out);
}
.copy:hover {
  background: var(--signal);
  color: var(--ink);
}
.copy.is-ok {
  background: var(--acid);
  color: var(--ink);
}

.commands {
  margin-top: 56px;
  padding: 28px;
  background: rgba(243, 238, 229, 0.02);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
}
.commands h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.commands ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 28px;
  font-size: 14.5px;
  color: var(--bone-2);
}
.commands code {
  color: var(--signal);
  background: transparent;
  padding: 0;
}

/* Scenarios ================================================ */
.section--scenarios .lede {
  margin-bottom: 40px;
}
.scenarios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.scenario {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(243, 238, 229, 0.025), transparent);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 360ms var(--ease-out), border-color 360ms var(--ease-out);
}
.scenario:hover {
  transform: translateY(-4px);
  border-color: rgba(111, 213, 166, 0.35);
}
.scenario__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 12px 5px 8px;
  background: rgba(111, 213, 166, 0.08);
  border: 1px solid rgba(111, 213, 166, 0.3);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--aqua);
  letter-spacing: 0.02em;
}
.scenario__hash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--aqua);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  font-family: var(--f-mono);
}
.scenario h3 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--bone);
}
.scenario p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bone-2);
}
.scenario__scene {
  color: var(--bone);
}
.scenario__act {
  padding-left: 14px;
  border-left: 2px solid rgba(214, 143, 68, 0.6);
}
.scenario__win {
  font-size: 13.5px;
  color: var(--muted);
}
.scenario__win i {
  font-style: italic;
  color: var(--signal);
  margin-right: 4px;
}
.scenario code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--bone);
}

/* Adapter callout ========================================== */
.section--adapter .section__h--small {
  font-size: clamp(28px, 4vw, 52px);
  margin: 0 0 24px;
}
.adapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.adapter__copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.adapter code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--bone);
}
.code--block {
  white-space: pre;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 22px 22px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  color: var(--bone);
}
.code--block .tk-c { color: var(--muted); }
.code--block .tk-p { color: var(--signal); }
.code--block .tk-y { color: var(--aqua); }
@media (max-width: 880px) {
  .adapter {
    grid-template-columns: 1fr;
  }
}

/* Install — extra list ===================================== */
.step__list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--bone-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step__list li b {
  color: var(--bone);
  font-weight: 600;
}
.step__list code {
  background: rgba(243, 238, 229, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}
.code .tk-y { color: var(--aqua); }

/* CTA ====================================================== */
.section--cta {
  text-align: center;
}
.cta {
  max-width: 820px;
  margin: 0 auto;
}
.cta h2 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}
.cta p {
  color: var(--bone-2);
  font-size: clamp(16px, 1.3vw, 19px);
  margin: 0 0 30px;
}
.cta .hero__ctas { justify-content: center; }

/* Footer =================================================== */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 50px var(--gut) 70px;
  background: var(--ink);
}
.foot__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--col-max);
  margin: 0 auto 18px;
}
.foot__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-display);
  font-size: 18px;
}
.foot__brand span {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}
.foot__nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-family: var(--f-mono);
  color: var(--bone-2);
}
.foot__nav a:hover { color: var(--signal); }
.foot__meta {
  max-width: var(--col-max);
  margin: 0 auto;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}
