:root {
  --bg: #ffffff;
  --bg-alt: #f3f7f8;
  --card: #ffffff;
  --text: #0f1d22;
  --muted: #55666c;
  --line: #dde6e8;
  --accent: #0b7a8a;
  --accent-strong: #075c68;
  --accent-text: #ffffff;
  --accent-soft: rgba(11, 122, 138, 0.1);
  --ok: #15803d;
  --warn: #b45309;
  --deep: #062a30;
  --deep-2: #0a3a42;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 29, 34, .06), 0 8px 24px rgba(15, 29, 34, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1417;
    --bg-alt: #0f1b1f;
    --card: #132328;
    --text: #e6f0f2;
    --muted: #93a7ad;
    --line: #22363c;
    --accent: #2ec4d6;
    --accent-strong: #69d8e5;
    --accent-text: #041416;
    --accent-soft: rgba(46, 196, 214, 0.14);
    --ok: #4ade80;
    --warn: #fbbf24;
    --deep: #071518;
    --deep-2: #0c2228;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-wrap: break-word;
  hyphens: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; hyphens: manual; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.narrow { max-width: 760px; }
.lead { font-size: 1.15rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .75em 1.4em; border-radius: 999px; border: 1.5px solid var(--accent);
  font-weight: 600; font-size: 1rem; line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { color: inherit; border-color: currentColor; background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.small { padding: .45em 1em; font-size: .9rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; white-space: nowrap; align-items: center; gap: 10px; color: var(--text); font-size: 1.12rem; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--text); font-weight: 500; font-size: .95rem; white-space: nowrap; }
.lang { position: relative; display: flex; align-items: center; color: var(--muted); }
.lang svg { position: absolute; left: 9px; pointer-events: none; }
.lang select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: .9rem; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .4em 1em .4em 2.1em; cursor: pointer;
}
.lang select option { color: #0f1d22; background: #fff; }
.menu { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }

/* Hero */
.hero {
  background:
    radial-gradient(1000px 500px at 85% 10%, rgba(46, 196, 214, .25), transparent 60%),
    linear-gradient(160deg, var(--deep) 0%, var(--deep-2) 60%, #0b4a54 100%);
  color: #eef7f8;
  padding: 88px 0 120px;
}
.hero .lead { color: #bdd3d7; max-width: 620px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; font-weight: 600; color: #7fdde8; margin-bottom: 1em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2em; }
.hero .btn.primary { background: #2ec4d6; border-color: #2ec4d6; color: #041416; }
.hero .btn.primary:hover { background: #69d8e5; border-color: #69d8e5; }
.hero-figure { margin: 0; background: #fff; border-radius: var(--radius); padding: 10px; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }

/* Key facts */
.facts { margin-top: -64px; position: relative; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fact, .cards article, .principles article, .tiers article {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.fact p, .cards p, .principles p, .tiers p { color: var(--muted); margin: 0; font-size: .96rem; }
.fact svg, .apps svg { width: 36px; height: 36px; padding: 7px; border-radius: 10px; fill: var(--accent); background: var(--accent-soft); margin-bottom: 14px; }

/* Sections */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); }
.section h2 + .lead { margin-bottom: 40px; }
.cards { margin-top: 8px; }
.diagram { margin: 0 0 40px; }
.diagram img { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 8px; width: 100%; }
.diagram figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; text-align: center; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { counter-increment: step; position: relative; padding: 24px 24px 24px 72px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before {
  content: counter(step); position: absolute; left: 22px; top: 22px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); font-weight: 700; display: grid; place-items: center;
}
.steps p { color: var(--muted); margin: 0; font-size: .96rem; }
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.notes p { margin: 0; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }

.tiers { margin-bottom: 28px; }
.tiers article { border-top: 4px solid var(--ok); }
.tiers article.warn { border-top-color: var(--warn); }

.section.dark { background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%); color: #eef7f8; }
.section.dark .lead { color: #bdd3d7; }
.section.dark .diagram img { border-color: transparent; }
.section.dark .diagram figcaption { color: #93b4ba; }
.section.dark .principles article { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); box-shadow: none; }
.section.dark .principles h3 { color: #7fdde8; }
.section.dark .principles p { color: #c3d6da; }

.more { font-weight: 600; display: inline-block; margin-top: 28px; }

/* Downloads */
.download { background: var(--bg-alt); }
.release { margin-bottom: 40px; }
.release .status { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; background: var(--card); }
.release .status.error { color: var(--warn); }
.release-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.badge { background: var(--accent); color: var(--accent-text); font-weight: 700; padding: .35em .9em; border-radius: 999px; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.files { list-style: none; padding: 0; margin: 0 0 12px; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.file > div { margin-right: auto; display: flex; flex-direction: column; }
.file .sub { color: var(--muted); font-size: .88rem; }
.file .size { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sha {
  font: 600 .72rem/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: .45em .6em; cursor: pointer;
}
.sha:hover { color: var(--accent); border-color: var(--accent); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 0; font-size: .9rem; }
.install { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.install ol { margin: 0 0 1em; padding-left: 1.3em; }
.install li { margin-bottom: .4em; }
.install p { margin: 0; font-size: .92rem; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .92rem; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Language chooser (/) */
.chooser main { max-width: 720px; margin: 10vh auto; padding: 0 24px; }
.chooser ul { list-style: none; padding: 0; columns: 3 160px; }
.chooser li { padding: 4px 0; }

@media (max-width: 1020px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid3, .steps { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { transform: none; }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .menu { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 12px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .grid4, .grid3, .steps, .notes { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 100px; }
  .section { padding: 64px 0; }
  .brand span { display: none; }
  .file { flex-wrap: wrap; }
  .file > div { flex-basis: 100%; }
}
