/* ==========================================================================
   AOS — All One System
   base.css: design tokens, reset, layout primitives, shared components
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: dark;

  /* Grays */
  --bg: #0d0f13;
  --bg-elev: #12151a;
  --surface: #171b21;
  --surface-2: #1d222a;
  --surface-3: #262c36;
  --line: #2a303a;
  --line-soft: #1e232b;

  /* Text (all pass WCAG AA on --bg and --surface-2) */
  --text: #eef1f5;
  --text-muted: #a0a9b8;
  --text-dim: #8892a3;

  /* Electric blue */
  --blue: #1a66ff;          /* fills; white text on it is 4.8:1 */
  --blue-bright: #4d8dff;   /* text, icons, accents on dark */
  --blue-soft: rgba(26, 102, 255, 0.14);
  --blue-glow: rgba(26, 102, 255, 0.45);

  /* Status */
  --danger: #ff7b7b;
  --warning: #ffb547;
  --success: #3ddc97;

  /* Shape + type */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--blue); color: #fff; }

/* ---------- Utilities ---------- */
[hidden] { display: none !important; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
@media (min-width: 640px) {
  .container { width: min(100% - 3rem, var(--container)); }
}

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; text-decoration: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.25rem; height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Brand wordmark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand-o { color: var(--blue-bright); text-shadow: 0 0 18px var(--blue-glow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.75; transform: none; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 28px -10px var(--blue-glow);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 36px -8px var(--blue-glow); }

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.btn-secondary:hover { border-color: #3b4350; background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.btn-sm { min-height: 44px; padding: 0 1.1rem; font-size: 0.92rem; }
.btn-lg { min-height: 54px; padding: 0 1.9rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Header + navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(13, 15, 19, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(13, 15, 19, 0.88); }

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-menu { display: flex; align-items: center; gap: 2rem; margin-left: auto; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 879px) {
  .nav-toggle { display: grid; }
  .nav-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 1rem 1.25rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.7);
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: 0.85rem 0.9rem; font-size: 1rem; }
  .nav-actions { flex-direction: column; align-items: stretch; }
  .nav-actions .btn { width: 100%; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-elev); }
.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding: 3.5rem 0 2.5rem;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
}
.footer-brand p { margin-top: 0.9rem; max-width: 30ch; color: var(--text-muted); font-size: 0.95rem; }
.footer-col h2 {
  margin-bottom: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-col li + li { margin-top: 0.55rem; }
.footer-col a { color: var(--text-muted); font-size: 0.95rem; }
.footer-col a:hover { color: var(--text); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ---------- Long-form text (legal pages) ---------- */
.prose { max-width: 720px; padding: 4rem 0 6rem; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1rem; }
.prose p { color: var(--text-muted); margin-top: 1rem; }
.notice {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
