/* Voltmoss web — the app's "Volt Moss" palette (design-system/MASTER.md),
   one accent, hairlines not boxes. System fonts: the app loads Space Grotesk
   and Geist from Google Fonts, but a legal page must read without waiting on a
   font request, so the stack here is native. */
:root {
  color-scheme: light dark;
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --surface-alt: #f1f0ec;
  --hairline: #e7e5e0;
  --text: #1b1b18;
  --muted: #6e6b64;
  --accent: #2e7d5b;
  --accent-soft: #e4f0e9;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0b0a;
    --surface: #151513;
    --surface-alt: #1d1d1a;
    --hairline: rgba(255, 255, 255, 0.08);
    --text: #f2f1ed;
    --muted: #97948c;
    --accent: #5bc488;
    --accent-soft: #14291d;
    --on-accent: #06130c;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(60% 40% at 15% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    radial-gradient(50% 35% at 100% 100%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--canvas);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

/* Top bar ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--canvas) 80%, transparent);
  border-bottom: 1px solid var(--hairline);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a[aria-current="page"] {
  color: var(--text);
}

/* Landing -------------------------------------------------------------------- */
.hero {
  padding: 84px 0 48px;
  display: grid;
  gap: 24px;
  max-width: 720px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 56ch;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.button:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.features {
  padding: 24px 0 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px;
  background: var(--surface);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Legal pages ---------------------------------------------------------------- */
.legal-page {
  padding: 56px 0 96px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 0.72fr);
  gap: 40px;
  align-items: start;
}

.legal-aside {
  position: sticky;
  top: 92px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}

.legal-aside h3 {
  margin: 0;
  font-size: 1.1rem;
}

.legal-aside p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.legal-aside .button {
  justify-content: center;
}

.legal-doc {
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 52px);
  background: var(--surface);
}

.legal-doc h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.legal-doc h2 {
  margin: 40px 0 10px;
  font-size: 1.32rem;
  letter-spacing: -0.01em;
}

.legal-doc h3 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
}

.legal-doc p,
.legal-doc li {
  color: var(--text);
  font-size: 1rem;
}

.legal-doc .lead {
  color: var(--muted);
  font-size: 1.08rem;
}

.legal-doc ul {
  padding-left: 20px;
}

.legal-doc li {
  margin: 6px 0;
}

.legal-doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 12px 0;
}

.legal-doc th,
.legal-doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.legal-doc th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
  margin: 18px 0;
}

.callout p {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 6px;
}

/* Footer --------------------------------------------------------------------- */
.site-footer {
  padding: 24px 0 46px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
}

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

.footer-links a {
  color: var(--muted);
}

/* In-app context ---------------------------------------------------------------
   The app opens these pages with `?webview=1` (strip the site chrome) and
   `?lang=<code>` (render in the app's language); legal-webview.js carries both
   across first-party links. */
html.webview .topbar,
html.webview .site-footer {
  display: none;
}

html.webview .legal-page {
  padding-top: 20px;
}

html.webview .legal-aside {
  display: none;
}

html.webview .legal-layout {
  grid-template-columns: minmax(0, 1fr);
}

/* Set by i18n.js only while a translation bundle is in flight, so the English
   copy never flashes before being swapped. i18n.js always clears it — including
   on a failed or slow fetch — and a browser that never runs the script never
   sets it, so the English page stays readable either way. */
html.i18n-pending body {
  visibility: hidden;
}

@media (max-width: 760px) {
  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-aside {
    position: static;
  }

  .hero {
    padding-top: 56px;
  }
}
