/* app/assets/css/base.css
   Design tokens and reset for the Reviewer 3000 storefront.
   Entirely separate from the review-site theme system in site/themes/. */

:root {
  /* Surfaces */
  --bg:           #0c0c10;
  --bg-elevated:  #131318;
  --bg-card:      #18181f;

  /* Text */
  --fg:           #e6e6f0;
  --fg-muted:     #8b8bb5; /* ≥4.5:1 on --bg-elevated cards (was #7878a0 ≈4.37:1) */

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.16);

  /* Accent — indigo */
  --accent:       #5b5ee8;
  --accent-light: #818cf8;
  --accent-subtle:rgba(99,102,241,0.14);
  --accent-fg:    #ffffff;

  /* Status */
  --green:        #22c55e;
  --green-subtle: rgba(34,197,94,0.12);
  --danger:       #ef4444;

  /* Shape */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --radius-pill:  999px;

  /* Elevation */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:    0 20px 60px rgba(0,0,0,.65);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Fira Code", "Consolas", monospace;

  /* Widths */
  --maxw-prose: 680px;
  --maxw-wide:  1120px;

  /* Z-index layers */
  --z-nav:   100;
  --z-modal: 200;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:           #ffffff;
    --bg-elevated:  #f4f4f8;
    --bg-card:      #ebebf2;

    --fg:           #111118;
    --fg-muted:     #55556c;

    --border:       rgba(0,0,0,0.07);
    --border-hover: rgba(0,0,0,0.16);

    --accent:       #4f46e5;
    --accent-light: #4f46e5;
    --accent-subtle:rgba(79,70,229,0.10);
    --accent-fg:    #ffffff;

    --green:        #16a34a;
    --green-subtle: rgba(22,163,74,0.10);

    --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:    0 4px 16px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.07);
    --shadow-lg:    0 20px 60px rgba(0,0,0,.16);
  }
}

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

/* Author-level display rules (for example an inline display:flex) otherwise
   override the browser's built-in [hidden] rule. Keep hidden UI genuinely out
   of both the layout and the accessibility tree on every storefront page. */
[hidden] { display: none !important; }

html {
  color-scheme: dark light;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a  { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, select { font: inherit; }

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

/* ── Keyboard focus (a11y) ──────────────────────────────────
   A visible ring for keyboard users on every interactive control, without
   showing a ring on mouse click (:focus-visible). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.card:focus-visible,
.theme-card:focus-visible,
.palette-swatch:focus-visible,
.source-toggle:focus-visible,
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Reduced motion (a11y) ──────────────────────────────────
   Honor prefers-reduced-motion: kill animations, transitions, and smooth
   scroll for users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
