/* ============================================================
   human-to-code landing — plain CSS, light/dark themable
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --text: #111114;
  --text-soft: #55555e;
  --border: #e6e6ea;
  --card: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 10px 30px rgba(17, 17, 20, 0.08);

  --accent-a: #ff5f3c;      /* warm orange-red */
  --accent-b: #e11d48;      /* rose */
  --pipe-a: #ff8a5c;
  --pipe-b: #ff3d2e;
  --pipe-casing: rgba(255, 61, 46, 0.14);
  --wire: rgba(225, 29, 72, 0.30);
  --pill-bg: #111114;
  --pill-text: #ffd76a;
  --term-bg: #16161c;
  --term-text: #e8e8ef;
  --bubble-bg: #ffffff;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0d0d11;
  --bg-soft: #14141a;
  --text: #f2f2f6;
  --text-soft: #a0a0ab;
  --border: #26262e;
  --card: #16161c;
  --nav-bg: rgba(13, 13, 17, 0.82);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --pipe-casing: rgba(255, 92, 61, 0.18);
  --wire: rgba(255, 138, 92, 0.38);
  --pill-bg: #1d1d24;
  --term-bg: #101016;
  --bubble-bg: #1b1b22;
}

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
@media (min-width: 1400px) { html { font-size: 18px; } }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ============================================================
   NAV
   ============================================================ */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 26px;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--text-soft);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }
.ext { font-size: 0.8em; }
.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.github-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.github-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.github-mark, .github-fallback-star { flex: none; }
.github-metric { min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.github-pill[data-stars-loaded="true"] .github-fallback-star { display: none; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.06); }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 110px) 16px 40px;
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 34px 34px;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 82px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 42%,
    color-mix(in srgb, var(--bg) 38%, transparent) 62%,
    color-mix(in srgb, var(--bg) 78%, transparent) 82%,
    var(--bg) 100%
  );
}
.hero-grid {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
}
.hero-spacer { min-height: 1px; }

/* --- wires (full-hero background art) --- */
.wires {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.wires-svg { width: 100%; height: 100%; }

.wire-set path { opacity: 0.55; }
.wire-bright use {
  stroke-dasharray: 90 1400;
  animation: wire-run 7s linear infinite;
}
.wire-bright use:nth-child(2) { animation-duration: 5.5s; animation-delay: -2s; }
.wire-bright use:nth-child(3) { animation-duration: 8.5s; animation-delay: -4s; }
@keyframes wire-run { to { stroke-dashoffset: -1490; } }

.wire-nodes circle {
  fill: var(--bg);
  stroke: var(--pipe-b);
  stroke-width: 2;
}
.wire-nodes .merge-node {
  fill: var(--pipe-b);
  stroke: var(--pipe-a);
  animation: merge-pulse 1.8s ease-in-out infinite;
  transform-origin: 620px 400px;
  filter: drop-shadow(0 0 8px var(--pipe-b));
}
@keyframes merge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

/* --- hero copy --- */
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2.6rem, 6.2vw, 4.9rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.grad-text {
  background: linear-gradient(92deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 20px;
  font-size: clamp(1.18rem, 2.2vw, 1.5rem);
  color: var(--text-soft);
  max-width: 34em;
}
.hero-sub strong { color: var(--text); }

/* --- glowing command pill (the pipe output feeds this) --- */
.cmd-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 16px 22px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  animation: pill-lightning 1.6s ease-in-out infinite;
}
@keyframes pill-lightning {
  0%, 100% { box-shadow: 0 0 12px 0 rgba(255, 61, 46, 0.25), 0 0 0 0 rgba(255, 61, 46, 0.30); }
  50% { box-shadow: 0 0 34px 6px rgba(255, 61, 46, 0.45), 0 0 90px 12px rgba(255, 138, 92, 0.25); }
}
.cmd-prompt { color: var(--pipe-a); }
.cmd-copy {
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cmd-copy:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.08); }
.cmd-copy.copied { background: #22c55e; color: #fff; }

/* --- CTA buttons --- */
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.12rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost { border: 1px solid var(--border); background: var(--card); color: var(--text); }

/* --- interactive editor demo --- */
.editor-demo {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 54px;
}
.editor-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 5px;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 14px 40px rgba(20, 20, 30, 0.08);
}
.editor-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 138px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.editor-tab:hover { color: var(--text); }
.editor-tab.active {
  color: var(--text);
  background: var(--bg);
  box-shadow: 0 3px 14px rgba(20, 20, 30, 0.1);
}
.editor-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-a) 45%, transparent); outline-offset: 2px; }
.editor-tab img { flex: none; border-radius: 3px; }
.editor-tab .rust-logo, .term-file .rust-logo { padding: 2px; background: #fff; border-radius: 5px; }
.lang-logo-human {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset;
}
.demo-panel[hidden] { display: none; }
.demo-panel.active { animation: demo-enter 0.28s ease-out; }
@keyframes demo-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 22px;
}
.term {
  display: flex;
  min-height: 338px;
  flex-direction: column;
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(10, 10, 18, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.3s ease;
}
.term:hover { transform: translateY(-4px); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 0.9rem;
  color: #9a9aa6;
}
.term-file { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin-left: 10px; }
.term-file img { flex: none; border-radius: 3px; }
.term-file .lang-logo-human { width: 18px; height: 18px; border-radius: 5px; font-size: 0.6rem; }
.term-title { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-title em { font-style: normal; opacity: 0.6; }
.dot { width: 12px; height: 12px; flex: none; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.term-body {
  flex: 1;
  padding: 28px 30px 30px;
  font-family: var(--mono);
  font-size: clamp(0.92rem, 1.45vw, 1.12rem);
  line-height: 1.72;
  overflow-x: auto;
  tab-size: 2;
}
.t-prompt { color: var(--pipe-a); }
.t-kw { color: #ff7ab2; }
.t-fn { color: #82aaff; }
.t-str { color: #c3e88d; }
.t-type { color: #c792ea; }
.term-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 30px 22px;
  font-size: 0.86rem;
  color: #9a9aa6;
  font-family: var(--mono);
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #28c840;
  animation: status-blink 1.8s ease-in-out infinite;
}
@keyframes status-blink { 50% { opacity: 0.35; } }

.demo-arrow .arrow-path {
  stroke-dasharray: 90;
  animation: arrow-dash 1.8s ease-in-out infinite;
}
.demo-arrow { display: grid; place-items: center; }
@keyframes arrow-dash {
  0% { stroke-dashoffset: 90; opacity: 0; }
  35% { opacity: 1; }
  70%, 100% { stroke-dashoffset: 0; opacity: 1; }
}

/* ============================================================
   LANGUAGES MARQUEE
   ============================================================ */
.langs {
  padding: clamp(56px, 8vw, 100px) 0 40px;
  text-align: center;
}
.langs-title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.langs-sub { margin-top: 10px; color: var(--text-soft); font-size: 1.2rem; }

.marquees { margin-top: 44px; display: grid; gap: 0; }
.marquee {
  overflow: hidden;
  padding: 34px 0; /* room for the vertical scatter */
  margin: -22px 0; /* let neighbouring rows interleave */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(34px, 5vw, 84px);
  width: max-content;
  animation: marquee var(--speed, 40s) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee[data-direction="right"] .marquee-track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* big, loosely scattered icon bubbles */
.bubble {
  --size: 110px;
  --dy: 0px;
  display: block;
  transform: translateY(var(--dy));
}
.bubble-icon {
  display: grid;
  place-items: center;
  width: clamp(72px, calc(var(--size) * 0.75 + 2vw), var(--size));
  height: clamp(72px, calc(var(--size) * 0.75 + 2vw), var(--size));
  border-radius: 50%;
  background: var(--bubble-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: var(--fade, 1);
  animation: bubble-float var(--float, 5s) ease-in-out var(--delay, 0s) infinite alternate;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
@keyframes bubble-float {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}
.bubble:hover .bubble-icon {
  transform: translateY(-8px) scale(1.1);
  opacity: 1;
  box-shadow: 0 18px 40px rgba(255, 61, 46, 0.24);
  animation-play-state: paused;
}
.bubble-icon img { width: 50%; height: 50%; object-fit: contain; }
.noscript-langs { color: var(--text-soft); padding: 0 16px; }

/* ============================================================
   CONTENT SECTIONS (examples / playground / docs)
   ============================================================ */
.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 7vw, 100px) 16px 20px;
}
.section-title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.section-sub { margin-top: 10px; color: var(--text-soft); font-size: 1.2rem; }
.section-sub a { color: var(--accent-b); font-weight: 700; }
.section-note { margin-top: 26px; color: var(--text-soft); font-size: 1.05rem; }
.section code, .section-note code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* --- shared code blocks --- */
.code-block {
  margin-top: 16px;
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.65;
  overflow-x: auto;
}
.t-cmt { color: #8b8b98; }
.t-ok { color: #4ade80; }
.t-marker { color: #ffd76a; font-weight: 700; }
.t-key { color: #82aaff; }
.t-num { color: #f78c6c; }

/* --- quick start --- */
.qs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  margin-top: 32px;
}
.qs-provider-pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-soft);
  font-size: 1rem;
}
.qs-provider-pick select {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.qs-steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.qs-step {
  padding: 22px 0 26px;
  border-top: 1px solid var(--bg-soft);
}
.qs-step:first-child { border-top: none; }
.qs-head { display: flex; align-items: center; gap: 14px; }
.qs-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-a);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}
.qs-head h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.qs-step > p { margin: 12px 0 0; color: var(--text-soft); font-size: 1.05rem; max-width: 62ch; }
.qs-inline { margin-top: 14px; color: var(--text-soft); font-size: 1.02rem; max-width: 62ch; }
.qs-step .code-block { max-width: 720px; }

/* --- examples tabbed --- */
.ex-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  border-bottom: 1px solid var(--bg-soft);
}
.ex-tab {
  flex: 0 1 auto;
  background: none;
  border: none;
  padding: 12px 0;
  margin-bottom: -1px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s ease;
  position: relative;
}
.ex-tab:hover { color: var(--text); }
.ex-tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent-a);
  padding-bottom: calc(12px - 2px);
}
.ex-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 0.85rem;
}
.ex-tab.active .ex-num { background: var(--accent-a); color: #fff; }
.ex-label { font-size: 0.95rem; white-space: nowrap; }
@media (max-width: 640px) {
  .ex-label { display: none; }
  .ex-tab { padding: 12px 8px; font-size: 0.9rem; }
}

.ex-content {
  margin-top: 32px;
}
.ex-panel {
  display: none;
}
.ex-panel.active { display: block; }
.ex-panel p { color: var(--text-soft); font-size: 1.02rem; margin-bottom: 16px; }

/* --- docs --- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 36px;
}
.docs-card {
  border-radius: 18px;
  background: var(--card);
  padding: 24px;
}
.docs-card h3 { font-size: 1.25rem; font-weight: 800; }
.docs-card p { margin-top: 10px; color: var(--text-soft); font-size: 1.02rem; }
.docs-card a { color: var(--accent-b); font-weight: 700; }
.docs-list { margin: 12px 0 0 18px; color: var(--text-soft); display: grid; gap: 8px; font-size: 1.02rem; }

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-soft);
  font-size: 1rem;
}
.footer a { color: var(--text); font-weight: 600; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }
/* graceful no-JS: everything stays visible */
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Wires stay put as the viewport narrows: the fan is pinned to the left edge
   (xMinYMid slice), so it overflows off-screen instead of squashing. The
   spacer column shrinks first, then disappears; the art fades behind text. */
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1.55fr); }
  .wires { opacity: 0.8; }
}
@media (max-width: 1020px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-spacer { display: none; }
  .wires { opacity: 0.45; left: -18vw; } /* slide the fan partly off-screen */
}
@media (max-width: 640px) {
  .wires { opacity: 0.3; left: -42vw; }
}
@media (max-width: 640px) {
  html { font-size: 16px; }
  html, body { overflow-x: hidden; }
  body, main, .nav-wrap, .hero, .langs, .section, .footer { width: 100%; max-width: 100%; }
  main, .hero-grid, .hero-content, .editor-demo, .demo-panel, .demo, .term,
  .langs, .marquees, .section, .qs-steps, .qs-step, .ex-content, .ex-panel,
  .docs-grid, .docs-card { min-width: 0; }

  .nav {
    gap: 8px;
    padding: 10px 12px;
  }
  .brand {
    min-width: 0;
    gap: 8px;
    font-size: 1rem;
    line-height: 1.05;
  }
  .brand-mark { width: 38px; height: 38px; flex: none; border-radius: 10px; font-size: 0.78rem; }
  .brand-name { overflow-wrap: anywhere; }
  .nav-actions { flex: none; gap: 7px; }
  .github-pill, .theme-toggle { height: 38px; min-height: 38px; }
  .github-pill { padding: 0 11px; justify-content: center; }

  .hero { padding: 34px 12px 34px; }
  .hero::after { height: 60px; }
  .hero-grid { width: 100%; gap: 0; }
  .hero-title { font-size: clamp(2.15rem, 12vw, 3.3rem); overflow-wrap: anywhere; }
  .hero-sub { margin-top: 16px; font-size: 1.05rem; }
  .cmd-pill {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    margin-top: 24px;
    padding: 11px 12px;
    font-size: 0.9rem;
  }
  .cmd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmd-copy { width: 34px; height: 34px; flex: none; }
  .hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn { justify-content: center; min-width: 0; padding: 12px 14px; font-size: 0.95rem; text-align: center; }

  .editor-demo { margin-top: 36px; }
  .editor-tabs {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    margin-bottom: 14px;
    padding: 4px;
    scrollbar-width: thin;
  }
  .editor-tab { min-width: 116px; padding: 9px 12px; font-size: 0.86rem; }
  .demo { grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; }
  .demo-arrow { justify-self: center; transform: rotate(90deg); }
  .term { width: 100%; min-width: 0; min-height: 280px; border-radius: 16px; }
  .term-bar { min-height: 48px; padding: 10px 12px; gap: 5px; font-size: 0.78rem; }
  .term-file { min-width: 0; margin-left: 5px; gap: 6px; }
  .dot { width: 9px; height: 9px; }
  .term-body {
    width: 100%;
    min-width: 0;
    padding: 18px 16px 20px;
    font-size: 0.82rem;
    line-height: 1.62;
    overscroll-behavior-inline: contain;
  }
  .term-status { min-width: 0; padding: 0 16px 17px; font-size: 0.72rem; overflow-wrap: anywhere; }

  .langs { padding: 54px 12px 30px; overflow: hidden; }
  .langs-title, .section-title { font-size: clamp(1.8rem, 10vw, 2.35rem); overflow-wrap: anywhere; }
  .langs-sub, .section-sub { font-size: 1rem; overflow-wrap: anywhere; }
  .marquees { width: calc(100% + 24px); margin: 28px -12px 0; overflow: hidden; }
  .marquee { max-width: 100%; padding: 24px 0; margin: -15px 0; }
  .bubble-icon { width: 62px; height: 62px; }

  .section { padding: 54px 12px 18px; overflow: hidden; }
  .section p, .section li, .footer { overflow-wrap: anywhere; }
  .section p code, .section li code { overflow-wrap: anywhere; word-break: break-word; }
  .code-block { width: 100%; max-width: 100%; min-width: 0; padding: 13px 14px; font-size: 0.8rem; }
  .qs-controls { width: 100%; margin-top: 24px; }
  .qs-provider-pick { width: 100%; min-width: 0; align-items: stretch; flex-direction: column; gap: 7px; }
  .qs-provider-pick select { width: 100%; min-width: 0; padding: 10px 11px; text-overflow: ellipsis; }
  .qs-steps { margin-top: 28px; }
  .qs-head { min-width: 0; align-items: flex-start; gap: 10px; }
  .qs-n { width: 30px; height: 30px; font-size: 0.92rem; }
  .qs-head h3 { min-width: 0; font-size: 1.12rem; overflow-wrap: anywhere; }
  .qs-step > p, .qs-inline { font-size: 0.96rem; }

  .ex-nav { width: 100%; justify-content: space-around; gap: 4px; overflow: hidden; }
  .ex-tab { flex: 1; justify-content: center; min-width: 0; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 26px; }
  .docs-card { width: 100%; padding: 17px 14px; border-radius: 14px; overflow: hidden; }
  .docs-list { margin-left: 16px; }

}

@media (max-width: 360px) {
  .nav { padding-inline: 8px; }
  .brand { gap: 6px; font-size: 0.9rem; }
  .brand-mark, .github-pill, .theme-toggle { width: 34px; height: 34px; min-height: 34px; }
  .github-pill { gap: 0; padding: 0; }
  .github-pill .github-metric, .github-pill .github-fallback-star { display: none; }
  .nav-actions { gap: 5px; }
  .hero, .section { padding-inline: 10px; }
  .hero-title { font-size: clamp(1.9rem, 12vw, 2.5rem); }
  .hero-cta { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .editor-tab { min-width: 104px; padding-inline: 9px; }
  .term-body { padding-inline: 12px; font-size: 0.76rem; }
  .term-status { padding-inline: 12px; }
  .langs { padding-inline: 10px; }
  .marquees { width: calc(100% + 20px); margin-left: -10px; margin-right: -10px; }
  .section-title, .langs-title { font-size: 1.72rem; }
  .qs-head h3 { font-size: 1.04rem; }
  .footer { padding-inline: 10px; font-size: 0.88rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .wire-bright use, .merge-node, .cmd-pill, .arrow-path, .status-dot, .bubble-icon { animation: none !important; }
  .wire-bright use { stroke-dasharray: none; }
  .marquee-track { animation-duration: 240s !important; }
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
