/* ==========================================================================
   base.css
   Reset, design tokens, typography, base element styles.
   Load order: base.css -> components.css -> pages.css
   Tokens here are the single source of truth — components.css and
   pages.css consume them, never redefine them.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Font: Inter, self-hosted, Semibold (600) only.
   Headings use this weight directly — no other weight is loaded, so avoid
   requesting font-weight: 700 on var(--font-heading) (forces faux-bold).
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color — matches the app, doesn't fight it */
  --bg: #0E0D0A;        /* page background — near-black, warm */
  --surface: #1A1814;   /* cards, sections, code blocks */
  --border: #2A2620;    /* dividers, card borders */
  --text: #E8E4DC;      /* body text — off-white */
  --muted: #9A938A;     /* secondary text */
  --gold: #E0A340;      /* CTAs, lifetime border, active nav — sparingly */
  --green: #5FB878;     /* pricing checkmarks, success state */
  --red: #DC2626;       /* reference only — appears inside screenshots */

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale — 8px rhythm */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;
  --space-9: 72px;
  --space-10: 80px;
  --space-11: 88px;
  --space-12: 96px;

  /* Layout */
  --content-max: 880px;
  --section-padding: var(--space-8); /* 64px on mobile */
}

/* Section padding steps up on desktop — single token, no per-component overrides */
@media (min-width: 768px) {
  :root {
    --section-padding: var(--space-12); /* 96px on desktop */
  }
}

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Base elements
   -------------------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  max-width: 70ch;
}

/* Prose links: underline carries the affordance so gold stays reserved
   for CTAs and active nav. Gold appears only on hover/focus. */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

/* Prose lists (guide articles, FAQ bodies) */
main ul,
main ol {
  padding-left: var(--space-3);
}

main li + li {
  margin-top: var(--space-1);
}

/* Inline code, kbd, and code blocks — player tags, fingerprints,
   troubleshooting steps the user types */
code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code, kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-2);
  overflow-x: auto;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--section-padding);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gold);
  color: var(--bg);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

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

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@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;
  }
}
