:root {
  --bg: #0f1115;
  --bg-alt: #13161b;
  --card: #1a1e25;
  --card-hover: #222731;
  --border: #2a303b;
  --text: #eceff4;
  --muted: #8a93a3;
  --accent: #ff8a2b;
  --accent-dark: #e2621a;
  --accent-soft: rgba(255, 138, 43, 0.12);
  --clutch: #ff5c5c;
  --multi: #ff8a2b;
  --success: #3ddc84;
  --danger: #ff6b6b;
  --radius: 14px;
  --gutter: 24px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }

code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--card-hover);
  padding: 1px 6px;
  border-radius: 6px;
}

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2 * var(--gutter)); }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: #111; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 17, 21, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; }
.brand img { display: block; width: 198px; height: auto; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.lang { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang a {
  color: var(--muted); font: 600 13px var(--font); padding: 7px 10px;
}
.lang a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.lang a[aria-current="page"] { background: var(--accent); color: #17130f; }

.lang-banner {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 9px 44px 9px 16px; position: relative; font-size: 14px;
  background: #1d1a17; border-bottom: 1px solid rgba(255, 138, 43, 0.35);
}
.lang-banner a { font-weight: 600; }
.lang-banner button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted); font: 20px/1 var(--font);
}
.lang-banner button:hover { color: var(--text); background: var(--card); }

.not-found { text-align: center; padding-top: 40px; }
.not-found h1 { font-size: 72px; margin: 24px 0 8px; color: var(--accent); }
.not-found img { width: 240px; height: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font: 600 15px var(--font); cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: linear-gradient(180deg, #ff9a42, var(--accent-dark)); color: #17130f; }
.btn-primary:hover { background: linear-gradient(180deg, #ffa758, #ec6c22); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--card-hover); }

/* Hero */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(255, 138, 43, 0.16), transparent 70%),
    radial-gradient(700px 380px at -10% 110%, rgba(255, 92, 92, 0.07), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.badge {
  display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255, 138, 43, 0.28);
}
.hero h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 800; }
.hero h1 .accent { color: var(--accent); }
.lead { color: #c3c9d4; font-size: 18px; margin: 20px 0 28px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* App mock */
.mock {
  margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  background: #14171c; border-bottom: 1px solid var(--border);
}
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #2f3541; }
.mock-bar b { margin-left: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mock-body { padding: 18px; }
.mock-head { display: flex; flex-direction: column; margin-bottom: 14px; }
.mock-head strong { font-size: 18px; }
.mock-head small { color: var(--muted); font-size: 12.5px; }
.mock-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mock-list li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; background: #151920; border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.mock-list li.on { border-color: rgba(255, 138, 43, 0.45); background: #1d1a17; }
.mock-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-list li b { color: var(--accent); font-size: 17px; }
.tag {
  font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: #3a404c; color: #d6dbe4;
}
.tag-clutch { background: var(--clutch); color: #1b0d0d; }
.tag-multi { background: var(--multi); color: #1b120a; }
.mock-render { margin-top: 16px; padding: 12px; border-radius: 10px; background: #14171c; border: 1px solid var(--border); }
.mock-render-text { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.mock-progress { height: 6px; border-radius: 6px; background: #262b34; overflow: hidden; }
.mock-progress div { height: 100%; width: 64%; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); border-radius: 6px; }

/* Share code */
.share { padding: 8px 0 40px; }
.share-card {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px 40px; align-items: center;
  padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
}
.share-copy h2 { font-size: 22px; margin-bottom: 6px; }
.share-copy p { margin: 0; color: #c3c9d4; }
.share-copy strong { color: var(--text); }
.share-form { display: flex; gap: 10px; }
.share-form input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px;
  background: #12151a; color: var(--text); border: 1px solid var(--border);
  font: 15px "Cascadia Code", Consolas, monospace;
}
.share-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.share-form input[aria-invalid="true"] { border-color: var(--danger); }
.share-hint { grid-column: 2; margin: 0; font-size: 13px; color: var(--muted); }
.share-hint.error { color: var(--danger); }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-title { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 32px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: #3a4250; background: #1c2129; }
.card h3 { font-size: 18px; margin: 14px 0 8px; }
.card p { margin: 0; color: #b4bbc8; font-size: 15px; }
.icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { counter-increment: step; padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #17130f; font-weight: 800; margin-bottom: 14px;
}
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { margin: 0; color: #b4bbc8; font-size: 15px; }

.notes { margin-top: 28px; padding: 24px 28px; border-radius: var(--radius); border: 1px solid rgba(255, 194, 71, 0.3); background: rgba(255, 194, 71, 0.05); }
.notes h3 { font-size: 17px; margin-bottom: 10px; color: #ffc247; }
.notes ul { margin: 0; padding-left: 20px; color: #c3c9d4; display: grid; gap: 8px; }

details {
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  margin-bottom: 10px; padding: 0 20px;
}
details[open] { background: #1c2129; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; position: relative; padding-right: 28px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 22px; color: var(--accent); }
details[open] summary::after { content: "–"; }
details p { margin: 0 0 18px; color: #c3c9d4; }

.oss { padding: 64px 0; }
.oss-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  padding: 36px; border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 138, 43, 0.16), rgba(255, 138, 43, 0.04));
  border: 1px solid rgba(255, 138, 43, 0.3);
}
.oss h2 { font-size: 26px; margin-bottom: 8px; }
.oss p { margin: 0; color: #c3c9d4; max-width: 36em; }
.oss-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 14px; }
.footer-inner p { margin: 4px 0; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.footer-brand img { display: block; width: 132px; height: auto; margin-right: 4px; }
.muted { color: var(--muted); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .share-card { grid-template-columns: 1fr; }
  .share-hint { grid-column: 1; }
}

@media (max-width: 820px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .brand img { width: 168px; }
  .hero { padding: 40px 0 32px; }
  .lead { font-size: 16.5px; }
  .grid, .steps { grid-template-columns: 1fr; }
  .share-card { padding: 20px; }
  .share-form { flex-direction: column; }
  .section { padding: 52px 0; }
  .oss-inner { padding: 24px; }
  .cta .btn { flex: 1 1 100%; }
}

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