:root {
  color-scheme: light dark;
  --accent: #1fa880;
  --accent-strong: #08775a;
  --accent-soft: rgba(31, 168, 128, 0.13);
  --bg: #f3f5f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-muted: #e9edef;
  --text: #15191b;
  --muted: #5e686d;
  --line: rgba(25, 35, 40, 0.12);
  --shadow: 0 20px 60px rgba(28, 49, 44, 0.10);
  --code: #edf1f2;
  --radius: 26px;
  --content: 1120px;
}

[data-theme="dark"] {
  --accent: #25bd91;
  --accent-strong: #58dfb8;
  --accent-soft: rgba(37, 189, 145, 0.14);
  --bg: #0a0d0e;
  --surface: rgba(28, 32, 34, 0.86);
  --surface-solid: #1a1e20;
  --surface-muted: #242a2c;
  --text: #f5f7f7;
  --muted: #a5adb1;
  --line: rgba(255, 255, 255, 0.11);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
  --code: #242a2c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #25bd91;
    --accent-strong: #58dfb8;
    --accent-soft: rgba(37, 189, 145, 0.14);
    --bg: #0a0d0e;
    --surface: rgba(28, 32, 34, 0.86);
    --surface-solid: #1a1e20;
    --surface-muted: #242a2c;
    --text: #f5f7f7;
    --muted: #a5adb1;
    --line: rgba(255, 255, 255, 0.11);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
    --code: #242a2c;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -5%, var(--accent-soft), transparent 33rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
button, input { font: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--surface-solid);
  background: var(--text);
  border-radius: 999px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

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

.nav-wrap {
  width: min(var(--content), calc(100% - 36px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 5px 16px rgba(22, 75, 61, 0.18);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a,
.icon-button {
  min-height: 44px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.site-nav a:hover, .site-nav a[aria-current="page"], .icon-button:hover {
  color: var(--text);
  background: var(--accent-soft);
}
.icon-button { width: 44px; padding: 0; font-size: 1.05rem; }
.menu-button { display: none; }
.theme-button-mobile { display: none; }

.shell {
  width: min(var(--content), calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: 690px;
  padding: 76px 0 68px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.82fr);
  align-items: center;
  gap: clamp(44px, 7vw, 100px);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 780;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(3.1rem, 7vw, 6.35rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero-copy {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.75;
}

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

.button {
  min-height: 52px;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--text);
  background: var(--surface);
  font-weight: 760;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(20, 50, 43, 0.05);
}
.button.primary {
  color: #061d16;
  background: linear-gradient(135deg, #54e4b3, #25bd91);
  border-color: transparent;
}
.button:hover { transform: translateY(-1px); }

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.device {
  position: relative;
  max-width: 410px;
  margin: 0 auto;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 48px;
  background: #0b0e0f;
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(255,255,255,0.04);
  transform: rotate(2deg);
}

.device-screen {
  min-height: 625px;
  padding: 28px 20px 22px;
  overflow: hidden;
  border-radius: 36px;
  color: #f6f7f7;
  background:
    radial-gradient(circle at 50% 0, rgba(31, 168, 128, 0.14), transparent 20rem),
    #050707;
}

.demo-status { display: flex; justify-content: space-between; color: #90999c; font-size: 0.75rem; }
.demo-toolbar { margin: 30px 0 28px; display: flex; align-items: center; justify-content: space-between; }
.demo-title { font-size: 2rem; font-weight: 780; letter-spacing: -0.04em; }
.demo-dots { display: flex; gap: 5px; }
.demo-dots span { width: 7px; height: 7px; border-radius: 50%; background: #25bd91; }
.demo-group-title { margin: 0 0 11px; color: #b8bfc1; font-weight: 720; }

.server-card {
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: #191d1f;
}
.server-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.server-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #5de2b8; background: rgba(37,189,145,0.15); font-size: 1.15rem; font-weight: 800; }
.server-name { overflow: hidden; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.server-meta { color: #8e979a; font-size: 0.78rem; }
.server-state { color: #48d5aa; font-size: 0.78rem; font-weight: 720; white-space: nowrap; }
.metric-line { height: 5px; margin-top: 13px; border-radius: 999px; background: #2b3234; overflow: hidden; }
.metric-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1fa880, #56d9b2); }
.demo-footer { margin-top: 25px; display: flex; justify-content: center; gap: 10px; }
.demo-pill { width: 72px; height: 9px; border-radius: 999px; background: #1d2425; }
.demo-pill.active { background: #25bd91; }

.section { padding: 88px 0; }
.section.compact { padding: 62px 0; }
.section-heading { max-width: 760px; margin-bottom: 36px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.8rem); line-height: 1.08; letter-spacing: -0.05em; }
.section-heading p { margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  min-height: 260px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(20, 50, 43, 0.04);
}
.feature-card.wide { grid-column: span 2; }
.feature-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 42px; border-radius: 17px; color: var(--accent-strong); background: var(--accent-soft); font-size: 1.25rem; font-weight: 800; }
.feature-card h3 { margin: 0; font-size: 1.35rem; line-height: 1.35; letter-spacing: -0.025em; }
.feature-card p { margin: 12px 0 0; color: var(--muted); }

.game-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.game-chip { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.game-chip strong { display: block; margin-bottom: 5px; font-size: 1.05rem; }
.game-chip span { color: var(--muted); font-size: 0.9rem; }

.callout {
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 32px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}
.callout h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.04em; }
.callout p { margin: 12px 0 0; color: var(--muted); }

.site-footer { margin-top: 70px; padding: 44px 0 55px; border-top: 1px solid var(--line); }
.footer-grid { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.footer-brand { font-weight: 780; }
.footer-note { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 0.86rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; text-decoration: none; }

.doc-hero { padding: 64px 0 30px; }
.doc-hero h1 { margin: 0; font-size: clamp(2.55rem, 6vw, 5rem); line-height: 1; letter-spacing: -0.06em; }
.doc-hero p { max-width: 730px; margin: 20px 0 0; color: var(--muted); font-size: 1.08rem; }

.doc-layout { padding: 25px 0 90px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 98px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.toc strong { display: block; margin-bottom: 9px; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.toc a { display: block; padding: 6px 7px; color: var(--muted); border-radius: 8px; font-size: 0.87rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--accent-soft); }
.toc a.sub { padding-left: 18px; font-size: 0.8rem; }

.doc-content { min-width: 0; padding: clamp(26px, 5vw, 58px); border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.doc-content > :first-child { margin-top: 0; }
.doc-content h1 { display: none; }
.doc-content h2 { margin: 3.2rem 0 1rem; padding-top: 0.8rem; font-size: 1.9rem; line-height: 1.25; letter-spacing: -0.035em; border-top: 1px solid var(--line); }
.doc-content h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-content h3 { margin: 2.2rem 0 0.8rem; font-size: 1.35rem; line-height: 1.35; letter-spacing: -0.02em; }
.doc-content p, .doc-content li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.doc-content ul, .doc-content ol { padding-left: 1.35rem; }
.doc-content li + li { margin-top: 0.35rem; }
.doc-content blockquote { margin: 1.5rem 0; padding: 16px 20px; border-left: 4px solid var(--accent); border-radius: 0 14px 14px 0; background: var(--accent-soft); }
.doc-content blockquote p { margin: 0; }
.table-wrap { margin: 1.5rem 0 2rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.doc-content table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--surface-solid); }
.doc-content th, .doc-content td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-content th { background: var(--surface-muted); font-size: 0.86rem; }
.doc-content tr:last-child td { border-bottom: 0; }
.doc-content code { padding: 0.14em 0.38em; border-radius: 6px; background: var(--code); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.doc-content pre { margin: 1.4rem 0; padding: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--code); line-height: 1.55; }
.doc-content pre code { padding: 0; background: transparent; }
.doc-content hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--line); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 58px; }
  .hero-copy { max-width: 760px; }
  .device { width: min(100%, 410px); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card.wide { grid-column: span 2; }
  .game-list { grid-template-columns: repeat(2, 1fr); }
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: none; }
}

@media (max-width: 700px) {
  .nav-wrap { min-height: 64px; }
  .menu-button { display: inline-flex; margin-left: auto; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    padding: 10px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { justify-content: flex-start; }
  .site-nav .theme-button-mobile {
    width: 100%;
    min-height: 44px;
    padding: 9px 13px;
    display: inline-flex;
    justify-content: flex-start;
    color: var(--muted);
    border-top: 1px solid var(--line);
    border-radius: 10px;
  }
  .theme-button-desktop { display: none; }
  .hero { min-height: auto; padding: 52px 0 55px; }
  .hero h1 { font-size: clamp(3rem, 16vw, 4.8rem); }
  .device-screen { min-height: 560px; }
  .section { padding: 66px 0; }
  .feature-grid, .game-list { grid-template-columns: 1fr; }
  .feature-card.wide { grid-column: auto; }
  .feature-card { min-height: 220px; }
  .callout { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .doc-hero { padding-top: 48px; }
  .doc-layout { padding-top: 10px; }
  .doc-content { margin-inline: -2px; padding: 24px 19px 35px; border-radius: 22px; }
  .doc-content h2 { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
