@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

/* ─── Reset ───────────────────────────────────────────────── */

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

/* ─── Base tokens (light defaults) ───────────────────────── */
/* Defined on .site so .site.dark / .site.light can override  */

:root {
  --nav-h: 60px;
  --radius: 12px;
}

.site {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #007065;
  --accent-2: #008f7a;
  --accent-bg: rgba(0, 112, 101, 0.1);
  --accent-grad: linear-gradient(135deg, #007065 0%, #00a88e 100%);
  --dot-color: rgba(17, 24, 39, 0.18);
  --code-bg: #0d1a18;
  --code-text: #b2f0ea;
  --header-bg: rgba(249, 250, 251, 0.88);
}

/* OS dark mode auto */
@media (prefers-color-scheme: dark) {
  .site {
    --bg: #0f1014;
    --surface: #17181f;
    --text: #e8eaf0;
    --muted: #8b93a8;
    --border: #26283a;
    --accent: #2dd4bf;
    --accent-2: #34d399;
    --accent-bg: rgba(45, 212, 191, 0.12);
    --accent-grad: linear-gradient(135deg, #2dd4bf 0%, #34d399 100%);
    --dot-color: rgba(232, 234, 240, 0.15);
    --code-bg: #0d0e12;
    --code-text: #b2f0ea;
    --header-bg: rgba(15, 16, 20, 0.88);
  }
}

/* Manual dark — overrides OS preference (2-class specificity wins) */
.site.dark {
  --bg: #0f1014;
  --surface: #17181f;
  --text: #e8eaf0;
  --muted: #8b93a8;
  --border: #26283a;
  --accent: #2dd4bf;
  --accent-2: #34d399;
  --accent-bg: rgba(45, 212, 191, 0.12);
  --accent-grad: linear-gradient(135deg, #2dd4bf 0%, #34d399 100%);
  --dot-color: rgba(232, 234, 240, 0.15);
  --code-bg: #0d0e12;
  --code-text: #b2f0ea;
  --header-bg: rgba(15, 16, 20, 0.88);
}

/* Manual light — overrides OS dark preference */
.site.light {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #007065;
  --accent-2: #008f7a;
  --accent-bg: rgba(0, 112, 101, 0.1);
  --accent-grad: linear-gradient(135deg, #007065 0%, #00a88e 100%);
  --dot-color: rgba(17, 24, 39, 0.18);
  --code-bg: #0d1a18;
  --code-text: #b2f0ea;
  --header-bg: rgba(249, 250, 251, 0.88);
}

/* ─── Base ────────────────────────────────────────────────── */

html,
body {
  min-height: 100vh;
}

html {
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: "Manrope", "Avenir Next", "Trebuchet MS", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Decorative gradient — follows OS only (body is outside .site) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      900px 400px at 8% -5%,
      rgba(101, 163, 13, 0.08) 0%,
      transparent 70%
    ),
    radial-gradient(
      1000px 500px at 100% -10%,
      rgba(22, 163, 74, 0.06) 0%,
      transparent 70%
    );
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(
        900px 400px at 8% -5%,
        rgba(77, 124, 15, 0.1) 0%,
        transparent 70%
      ),
      radial-gradient(
        1000px 500px at 100% -10%,
        rgba(22, 163, 74, 0.06) 0%,
        transparent 70%
      );
  }
}

#app {
  display: contents;
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.site-main {
  flex: 1;
}

/* ─── Navbar ──────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 120ms;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link--active {
  color: var(--accent);
}

.nav-link--active:hover {
  color: var(--accent);
}

.nav-logo:focus-visible,
.nav-link:focus-visible,
.mobile-link:focus-visible,
.theme-toggle:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nav-link--ext {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nav-ext-icon {
  opacity: 0.5;
  flex-shrink: 0;
  margin-top: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Theme toggle ────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: color 120ms, background 120ms;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--accent-bg);
}

.theme-icon {
  display: block;
}

/* ─── Hamburger ───────────────────────────────────────────── */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.bar {
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 200ms ease,
    opacity 200ms ease;
  transform-origin: center;
}

.hamburger.is-open .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile menu ─────────────────────────────────────────── */

.mobile-menu {
  display: flex;
  flex-direction: column;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
}

.mobile-link {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-link:last-child {
  border-bottom: none;
}

.mobile-link--active {
  color: var(--accent);
}

.mobile-link--ext {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 800px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

/* ─── Hero ────────────────────────────────────────────────── */

.hero {
  padding: 52px 24px 48px;
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, var(--accent) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.38;
  mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, transparent 20%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, transparent 20%, black 100%);
  pointer-events: none;
}

.hero-grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 52px;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-right {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-title {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.7;
  max-width: 400px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Hero tabs ───────────────────────────────────────────── */

.hero-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.hero-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 120ms;
}

.hero-tab::after {
  content: '';
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  margin-bottom: -2px;
  transition: background 150ms;
}

.hero-tab:hover {
  color: var(--text);
}

.hero-tab--active {
  color: var(--accent);
}

.hero-tab--active::after {
  background: var(--accent);
}

.hero-code .code-dual {
  margin-bottom: 0;
  border-radius: 0;
  border: none;
}

.hero-code .code-block {
  margin-bottom: 0;
  border-radius: 0;
  border: none;
}

.hero-code .code-dual pre {
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 16px 20px;
  height: 380px;
  overflow-y: auto;
}

.hero-code .code-block {
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 16px 20px;
  height: 380px;
  overflow-y: auto;
}

/* ─── Buttons ─────────────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.94rem;
  transition:
    opacity 120ms,
    transform 120ms;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.94rem;
  transition:
    border-color 120ms,
    transform 120ms;
}

.btn-secondary:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

/* ─── Features ────────────────────────────────────────────── */

.features {
  background: var(--surface);
  padding: 88px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 52px;
  color: var(--text);
}

.moonbit-brand {
  color: #CF4F89;
  font-weight: 900;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 18px;
  row-gap: 6px;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
  align-items: start;
}

.feature-icon {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
}

.feat-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.feature-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  align-self: center;
}

.feature-desc {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Comparison ─────────────────────────────────────────── */

.comparison {
  display: none;
  padding: 88px 24px;
  border-bottom: 1px solid var(--border);
}

.comparison-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.cmp-widget {
  /* No outer border — only the code card is boxed */
}

.cmp-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 0 0 20px;
}

.cmp-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms;
}

.cmp-tab::after {
  content: '';
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 150ms;
}

.cmp-tab:hover {
  color: var(--text);
}

.cmp-tab--active {
  color: var(--accent);
}

.cmp-tab--active::after {
  background: var(--accent);
}

@keyframes cmp-slide-a {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes cmp-slide-b {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cmp-anim-wrap.anim-a {
  animation: cmp-slide-a 0.22s ease;
}

.cmp-anim-wrap.anim-b {
  animation: cmp-slide-b 0.22s ease;
}

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

.cmp-progress-track {
  height: 3px;
  background: var(--border);
}

.cmp-progress-fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

@keyframes pf-a {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes pf-b {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.cmp-anim-wrap.anim-a .cmp-progress-fill {
  animation: pf-a 12s linear forwards;
}

.cmp-anim-wrap.anim-b .cmp-progress-fill {
  animation: pf-b 12s linear forwards;
}

.cmp-nav-desc {
  padding: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.cmp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 300px;
}

.cmp-col {
  min-width: 0;
  overflow-y: auto;
}

.cmp-col + .cmp-col {
  border-left: 1px solid var(--border);
}

.cmp-lang-label {
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cmp-col .code-dual {
  margin-bottom: 0;
  border-radius: 0;
  border: none;
}

.cmp-col .code-dual pre {
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 14px 18px;
}

.cmp-col .code-block {
  margin-bottom: 0;
  border-radius: 0;
  border: none;
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 14px 18px;
}

@media (max-width: 680px) {
  .cmp-tabs {
    gap: 16px;
  }

  .cmp-tab {
    font-size: 0.78rem;
  }

  .cmp-cols {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cmp-col {
    max-height: 180px;
    overflow-y: auto;
  }

  .cmp-col + .cmp-col {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* ─── Showcase ───────────────────────────────────────────── */

.showcase {
  padding: 88px 24px;
  background:
    radial-gradient(ellipse 65% 90% at -5% 110%, rgba(0, 112, 101, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse 55% 75% at 107% -5%,  rgba(6, 182, 212, 0.26) 0%, transparent 55%),
    radial-gradient(ellipse 45% 60% at 107% 107%, rgba(167, 139, 250, 0.24) 0%, transparent 50%),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.site.dark .showcase {
  background:
    radial-gradient(ellipse 65% 90% at -5% 110%, rgba(45, 212, 191, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 55% 75% at 107% -5%,  rgba(6, 182, 212, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 45% 60% at 107% 107%, rgba(167, 139, 250, 0.18) 0%, transparent 50%),
    var(--surface);
}

@media (prefers-color-scheme: dark) {
  .site .showcase {
    background:
      radial-gradient(ellipse 65% 90% at -5% 110%, rgba(45, 212, 191, 0.22) 0%, transparent 55%),
      radial-gradient(ellipse 55% 75% at 107% -5%,  rgba(6, 182, 212, 0.18) 0%, transparent 55%),
      radial-gradient(ellipse 45% 60% at 107% 107%, rgba(167, 139, 250, 0.18) 0%, transparent 50%),
      var(--surface);
  }
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 15%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 15%, black 100%);
  pointer-events: none;
}

.showcase-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 0;
}

.showcase-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  transition: transform 150ms, box-shadow 150ms, border-color 150ms;
}

.showcase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.showcase-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.showcase-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
  display: block;
}

.showcase-thumb-placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      -45deg,
      var(--border) 0px,
      var(--border) 1px,
      transparent 1px,
      transparent 12px
    );
  opacity: 0.6;
}

.showcase-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.showcase-title {
  font-weight: 700;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  color: var(--text);
}

.showcase-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.showcase-card--submit {
  border: 2px dashed var(--border);
  box-shadow: none;
}

.showcase-card--submit:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.showcase-thumb--submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-submit-plus {
  position: absolute;
  font-size: 2.4rem;
  font-weight: 200;
  color: var(--muted);
  line-height: 1;
  z-index: 1;
}

@media (max-width: 640px) {
  .showcase {
    padding: 64px 20px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1120px) {
  .showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── Quick Start ─────────────────────────────────────────── */

.quickstart {
  padding: 88px 24px;
}

.quickstart-inner {
  max-width: 760px;
  margin: 0 auto;
}

.section-desc {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 40px;
  text-align: center;
}

.step-label {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.install-block {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: "Menlo", "Consolas", "Monaco", monospace;
  font-size: 0.9rem;
  margin-bottom: 32px;
  overflow-x: auto;
  white-space: pre;
}

.install-block code {
  font: inherit;
  color: inherit;
  background: none;
}

/* Fallback before shiki loads */
.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 24px;
  font-family: "Menlo", "Consolas", "Monaco", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 36px;
}

.code-block code {
  font: inherit;
  color: inherit;
  background: none;
}

/* Shiki highlighted block */
.code-dual {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--border);
}

.code-dual pre {
  margin: 0;
  padding: 14px 18px;
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-x: auto;
  font-family: "Menlo", "Consolas", "Monaco", monospace;
}

.code-dual pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Default: show light, hide dark */
.code-dark {
  display: none;
}

/* OS dark mode */
@media (prefers-color-scheme: dark) {
  .code-light {
    display: none;
  }

  .code-dark {
    display: block;
  }
}

/* Manual overrides */
.site.dark .code-light {
  display: none;
}

.site.dark .code-dark {
  display: block;
}

.site.light .code-light {
  display: block;
}

.site.light .code-dark {
  display: none;
}

.qs-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 40px;
  position: relative;
}

/* Vertical connector line */
.qs-steps::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: 34px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.qs-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 52px;
  padding-bottom: 28px;
  position: relative;
}

.qs-step:last-child {
  padding-bottom: 0;
}

.qs-step-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qs-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}

.qs-step-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 34px;
}

.qs-step-code-wrap {
  position: relative;
}

.qs-step-code {
  margin-bottom: 0;
}

.qs-copy-btn {
  display: flex;
  position: absolute;
  top: 10px;
  right: 10px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.qs-copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.qs-copy-btn--done {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.qs-copy-icon {
  display: block;
}

.quickstart-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 40px;
}

/* ─── Footer ──────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: var(--surface);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 120ms;
}

.footer-link:hover {
  color: var(--text);
}

/* ─── Tablet: stack hero ──────────────────────────────────── */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-left {
    align-items: center;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(2.2rem, 7vw, 3.8rem);
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 64px 20px 60px;
  }

  .features {
    padding: 64px 20px;
  }

  .comparison {
    padding: 64px 20px;
  }

  .quickstart {
    padding: 64px 20px;
  }

  .section-title {
    margin-bottom: 36px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ─── Tour ────────────────────────────────────────────────── */

.tour-main {
  background: var(--bg);
  min-height: calc(100vh - var(--nav-h));
  padding-inline: 1.5rem;
}

.tour-layout {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  max-width: 1280px;
  margin-inline: auto;
  width: 100%;
  min-height: inherit;
}

/* ─── Tour Sidebars ───────────────────────────────────────── */

.tour-sidebar-left,
.tour-sidebar-right {
  padding: 2rem 1rem;
  position: sticky;
  top: var(--nav-h);
  align-self: start;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}


.tour-sidebar-heading,
.tour-toc-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.625rem;
  padding: 0 0.5rem;
}

.tour-section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 1rem 0 0.375rem;
  padding: 0 0.5rem;
}

.tour-section-heading:first-child {
  margin-top: 0;
}

/* ─── Tour Chapter List ───────────────────────────────────── */

.tour-chapter-list,
.tour-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tour-chapter-li {
  margin: 0;
  padding: 0;
}

.tour-chapter-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  line-height: 1.4;
}

.tour-chapter-item:hover {
  background: var(--accent-bg);
}

.tour-chapter-item--active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

/* ─── Tour TOC ────────────────────────────────────────────── */

.tour-toc-item {
  margin: 0;
}

.tour-toc-link {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  line-height: 1.4;
}

.tour-toc-link:hover {
  color: var(--accent);
  background: var(--accent-bg);
}

.tour-toc-item--h3 .tour-toc-link {
  padding-left: 1.125rem;
  font-size: 0.75rem;
}

/* ─── Tour Content ────────────────────────────────────────── */

.tour-content {
  padding: 2.5rem 3rem 6rem;
  min-width: 0;
  border-left: 1px solid var(--border);
}

.tour-not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 1rem;
}

.tour-not-found-code {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--fg-muted);
  margin: 0;
}

/* ─── Markdown Body ───────────────────────────────────────── */

.md-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
  color: var(--text);
  max-width: 700px;
  margin-inline: auto;
}

.md-h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
  line-height: 1.2;
  color: var(--text);
}

.md-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.5rem 0 0.875rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.md-h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 2rem 0 0.625rem;
  color: var(--text);
}

.md-h4,
.md-h5,
.md-h6 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.md-p {
  margin: 0 0 1rem;
}

.md-body code {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
  font-family: "Menlo", "Consolas", "Monaco", monospace;
  color: var(--accent);
}

.md-pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 1.125rem 1.5rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  font-size: 0.82rem;
  line-height: 1.7;
  font-family: "Menlo", "Consolas", "Monaco", monospace;
  color: var(--code-text);
  border: 1px solid var(--border);
}

.md-pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

.md-body .code-dual {
  margin: 0 0 1.5rem;
}

/* code_to_html wraps shiki output in a <code> element;
   display:contents makes it a transparent layout container */
.code-light > code,
.code-dark > code {
  display: contents;
}

.md-ul,
.md-ol {
  padding-left: 1.75rem;
  margin: 0 0 1rem;
}

.md-li {
  margin-bottom: 0.4rem;
}

.md-li .md-p {
  margin-bottom: 0.25rem;
}

.md-li .md-ul,
.md-li .md-ol {
  margin-top: 0.25rem;
}

.md-blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.625rem 1.125rem;
  margin: 0 0 1rem;
  color: var(--muted);
  background: var(--accent-bg);
  border-radius: 0 6px 6px 0;
}

.md-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.md-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md-link:hover {
  opacity: 0.75;
}

.md-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.md-th,
.md-td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.md-th {
  background: var(--accent-bg);
  font-weight: 600;
}

.md-img {
  max-width: 100%;
  border-radius: 6px;
}

/* ─── Tour Responsive ─────────────────────────────────────── */

@media (max-width: 1100px) {
  .tour-layout {
    grid-template-columns: 240px 1fr 220px;
  }
  .tour-content {
    padding: 2rem 2rem;
  }
}

@media (max-width: 860px) {
  .tour-layout {
    grid-template-columns: 1fr;
  }
  .tour-sidebar-left {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    padding: 1rem;
  }
  .tour-sidebar-heading {
    margin: 0 0 0.5rem;
  }
  .tour-sidebar-right {
    display: none;
  }
  .tour-content {
    border-left: none;
    padding: 1.5rem 1rem;
  }
}

/* ─── Components showcase ────────────────────────────────── */

.rui-showcase-demo-code-summary {
  position: absolute;
  inset: 0;
  display: block;
  height: 6.75rem;
  overflow: hidden;
  cursor: pointer;
  list-style: none;
  outline: none;
}

.rui-showcase-demo-code {
  position: relative;
  max-height: 6.75rem;
  overflow: hidden;
}

.rui-showcase-demo-code-peek {
  pointer-events: none;
  user-select: none;
}

.rui-showcase-demo-code-disclosure {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rui-showcase-demo-code-disclosure > .rui-showcase-demo-code-summary {
  pointer-events: auto;
}

.rui-showcase-demo-code-summary::-webkit-details-marker {
  display: none;
}

.rui-showcase-demo-code-summary::marker {
  content: "";
}

.rui-showcase-demo-code-summary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(
        in oklab,
        var(--rui-showcase-code-background) 30%,
        transparent
      )
      26%,
    var(--rui-showcase-code-background) 88%
  );
  pointer-events: none;
}

.rui-showcase-demo-code-toggle {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 2;
  display: inline-flex;
  height: 2rem;
  min-height: 2rem;
  width: 6rem;
  min-width: 6rem;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  border: 1px solid var(--rui-border);
  border-radius: 0.625rem;
  background: var(--rui-background);
  padding: 0 0.75rem;
  color: var(--rui-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.rui-showcase-demo-code-summary:hover .rui-showcase-demo-code-toggle {
  background: var(--rui-muted);
}

.rui-showcase-demo-code-summary:focus-visible
  .rui-showcase-demo-code-toggle {
  outline: 2px solid var(--rui-ring);
  outline-offset: 2px;
}

.rui-showcase-demo-code:has(> .rui-showcase-demo-code-disclosure[open]) {
  max-height: none;
  overflow: visible;
}

.rui-showcase-demo-code-disclosure[open]
  > .rui-showcase-demo-code-summary {
  display: none;
}

.rui-showcase-demo-code:has(> .rui-showcase-demo-code-disclosure[open])
  > .rui-showcase-demo-code-peek {
  overflow-x: auto !important;
  pointer-events: auto;
  user-select: text;
}

.rui-showcase-demo-code-disclosure[open]
  > .rui-showcase-demo-code-panel {
  animation: rui-showcase-code-in 160ms ease-out;
}

.rui-showcase-shiki,
.rui-showcase-shiki > yoorkin-shiki-code {
  display: block;
  min-width: 0;
}

.rui-showcase-shiki .shiki,
.rui-showcase-shiki yoorkin-shiki-code > pre {
  box-sizing: border-box;
  min-width: max-content;
  margin: 0;
  background: transparent !important;
  padding: 1.5rem 0;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
}

.rui-showcase-shiki code {
  display: grid;
  counter-reset: rui-showcase-code-line;
}

/* Keep the unloaded plain-text fallback on the same text baseline as Shiki's
   numbered lines. Highlighting can then replace paint without moving layout. */
.rui-showcase-shiki
  > yoorkin-shiki-code:not([data-shiki-highlighted])
  > pre
  > code {
  display: block;
  box-sizing: border-box;
  padding-inline: 4rem;
}

.rui-showcase-shiki code > .line {
  display: block;
  min-height: 1lh;
  padding: 0 4rem 0 0;
  counter-increment: rui-showcase-code-line;
}

.rui-showcase-shiki code > .line::before {
  content: counter(rui-showcase-code-line);
  display: inline-block;
  box-sizing: border-box;
  width: 4rem;
  padding-right: 1.5rem;
  color: var(--rui-muted-foreground);
  text-align: right;
  opacity: 0.65;
  user-select: none;
}

.rui-showcase-demo-code-peek .shiki,
.rui-showcase-demo-code-peek yoorkin-shiki-code > pre {
  padding: 1.125rem 0;
}

.rui-showcase-demo-section {
  scroll-margin-top: calc(var(--nav-h, 60px) + 1rem);
}

.rui-showcase-rail-link {
  border-radius: 0.5rem;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.rui-showcase-rail-link:hover {
  color: var(--rui-foreground) !important;
}

.rui-showcase-catalog .rui-showcase-rail-link:hover,
.rui-showcase-catalog .rui-showcase-rail-link--active {
  background: var(--rui-accent);
  color: var(--rui-foreground) !important;
}

.rui-showcase-page-navigation-link:hover {
  border-color: color-mix(
    in oklab,
    var(--rui-foreground) 22%,
    var(--rui-border)
  );
  background: var(--rui-accent);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.07);
}

.rui-showcase-page-navigation-link:active {
  background: color-mix(
    in oklab,
    var(--rui-accent) 82%,
    var(--rui-foreground)
  );
  transform: translateY(1px);
}

.rui-showcase-page-navigation-link:focus-visible {
  outline: 2px solid var(--rui-ring);
  outline-offset: 2px;
}

.rui-showcase-rail-link:focus-visible {
  outline: 2px solid var(--rui-ring);
  outline-offset: 2px;
  color: var(--rui-foreground) !important;
}

.rui-showcase-component-toc .rui-showcase-rail-link:hover {
  background: var(--rui-accent);
}

@keyframes rui-showcase-code-in {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rui-showcase-demo-code-disclosure[open]
    > .rui-showcase-demo-code-panel {
    animation: none;
  }

  .rui-showcase-demo-code-toggle,
  .rui-showcase-rail-link,
  .rui-showcase-page-navigation-link {
    transition: none;
  }
}

@media (max-width: 80rem) {
  #rui-showcase {
    --rui-showcase-component-columns: minmax(0, 46rem);
  }

  .rui-showcase-component-toc {
    display: none;
  }
}

@media (max-width: 1024px) {
  #rui-showcase {
    --rui-showcase-catalog-columns: minmax(0, 1fr);
    --rui-showcase-component-columns: minmax(0, 1fr);
  }

  .rui-showcase-component {
    grid-template-columns: minmax(0, 1fr) !important;
    justify-content: stretch !important;
  }

  .rui-showcase-component-toc {
    display: none !important;
  }

  .rui-showcase-catalog {
    display: none !important;
  }

  .rui-showcase-mobile-catalog {
    display: block !important;
  }

  .rui-showcase-mobile-catalog-summary::-webkit-details-marker {
    display: none;
  }

  .rui-showcase-mobile-catalog-summary::marker {
    content: "";
  }

  .rui-showcase-mobile-catalog details[open]
    .rui-showcase-mobile-catalog-summary > :last-child {
    transform: rotate(90deg);
  }

  .rui-showcase-mobile-catalog .rui-showcase-rail-link {
    padding: 0.375rem 0.625rem !important;
  }

  .rui-showcase-mobile-catalog .rui-showcase-rail-link:hover,
  .rui-showcase-mobile-catalog .rui-showcase-rail-link--active {
    background: var(--rui-accent);
    color: var(--rui-foreground) !important;
  }
}

@media (max-width: 640px) {
  #rui-showcase {
    padding: 1rem 0 3rem !important;
  }

  .rui-showcase-page-navigation {
    gap: 0.5rem !important;
  }

  .rui-showcase-page-navigation-link {
    min-height: 2.75rem !important;
    padding: 0.5rem 0.625rem !important;
  }
}
