/* Astromi website — one stylesheet for every page.
   Tokens follow the brand guide (night → aubergine → mauve → dusty-rose → pearl, cream ground;
   Fraunces for display, Inter for text, Space Mono for labels). Dark only: the site is night. */

:root {
  --night: #0B0A0F;
  --aubergine: #382539;
  --mauve: #8D5D6F;
  --dusty-rose: #CCAFAB;
  --pearl: #E2D8CF;
  --cream: #ECE7E1;

  --surface-page: var(--night);
  --surface-raised: #17121B;
  --surface-sunken: #070609;
  --border-hairline: #241B27;
  --border-control: var(--mauve);
  --text-primary: var(--cream);
  --text-secondary: var(--dusty-rose);
  --text-muted: #A97A8B;
  --action-primary: var(--pearl);
  --on-action-primary: var(--night);
  --focus-ring: var(--dusty-rose);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;

  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--surface-page); color: var(--text-primary);
  font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* type */
.eyebrow { font: 400 11px/16px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); margin: 0; }
.handle { font: 400 12px/16px var(--mono); color: var(--text-muted); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
.title-large { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; }
.title-medium { font-size: 22px; line-height: 1.2; }
.title-small { font-size: 18px; line-height: 1.3; }
.lede { color: var(--text-secondary); font-size: 17px; line-height: 1.6; max-width: 62ch; margin: 0; }
p { margin: 0; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }

/* buttons: all pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--action-primary); color: var(--on-action-primary); }
.btn-primary:hover { background: var(--cream); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-hairline); }
.btn-ghost:hover { border-color: var(--border-control); }
.btn-small { min-height: 34px; padding: 0 16px; font: 400 11px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20; background: rgba(11, 10, 15, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-hairline);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); }
.brand img { height: 30px; width: auto; }
.site-nav { display: flex; gap: 28px; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--text-secondary); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); }
@media (max-width: 820px) { .site-nav { display: none; } }

/* sections */
.section { padding-block: clamp(64px, 10vw, 120px); border-top: 1px solid var(--border-hairline); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.split > * { min-width: 0; }
.stack { display: grid; gap: 16px; }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* facts row: one figure each, mono-free */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(40px, 6vw, 72px); }
.fact { border-top: 1px solid var(--border-hairline); padding-top: 18px; display: grid; gap: 6px; }
.fact b { font: 600 26px/1.1 var(--display); }
.fact span { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 680px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--surface-raised); border: 1px solid var(--border-hairline); border-radius: 16px; padding: 24px; display: grid; gap: 10px; align-content: start; }
.card .eyebrow { margin-bottom: 4px; }
.card p { color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; }

/* footer */
.site-footer { border-top: 1px solid var(--border-hairline); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--text-muted); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { text-decoration: none; color: var(--text-secondary); }
.site-footer a:hover { color: var(--text-primary); }

/* plain document pages (terms, privacy, invite, 404) */
.doc { padding-block: clamp(48px, 8vw, 96px); }
.doc .wrap { max-width: 760px; display: grid; gap: 20px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.1; }
.doc h2 { font-size: 22px; line-height: 1.25; margin-top: 16px; }
.doc h3 { font-size: 18px; margin-top: 8px; }
.doc p, .doc li { color: var(--text-secondary); line-height: 1.7; }
.doc ul, .doc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc a { color: var(--text-primary); }

/* legal pages: one language at a time (assets/js/legal.js) */
.lang-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border-hairline); border-radius: 999px; justify-self: start; }
.lang-switch button { font: 400 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
  background: transparent; border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--action-primary); color: var(--on-action-primary); }
.legal article { display: grid; gap: 16px; }
.js .legal article[lang]:not(.active) { display: none; }
.legal .updated { font: 400 12px/1.5 var(--mono); color: var(--text-muted); }
