/* ==========================================================================
   Eclipse Forge — base.css
   Static stylesheet. Theme-setting-driven values arrive as CSS custom
   properties from the {% style %} block in layout/theme.liquid; everything
   here consumes them with hard fallbacks so the sheet is valid standalone.
   Fonts (@font-face for Cinzel + Inter) are appended in Phase 1.
   ========================================================================== */

/* ---- design tokens (fallbacks; overridden by theme.liquid :root) ---------- */
:root {
  --color-bg: #0a0a0c;
  --color-surface: #141418;
  --color-text: #e8e6e3;
  --color-text-muted: #9a9691;
  --color-ember: #cf1a2b;
  --color-border: #26262c;

  /* per-SKU glow — default ember; per-page/card override via --glow */
  --glow: var(--color-ember);
  --glow-soft: color-mix(in srgb, var(--glow) 40%, transparent);

  --font-heading: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --page-width: 1400px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --space-section: 96px;
  --radius: 4px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;

  --grain-opacity: 0.05;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.1; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ---- type scale ----------------------------------------------------------- */
.h-display {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.h1 { font-family: var(--font-heading); font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: 0.03em; text-transform: uppercase; }
.h2 { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: 0.03em; text-transform: uppercase; }
.h3 { font-family: var(--font-heading); font-size: 1.2rem; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.text-muted { color: var(--color-text-muted); }

/* Rich-text (RTE) content — restore list/link styling stripped by the reset */
.rte > *:first-child { margin-top: 0; }
.rte > *:last-child { margin-bottom: 0; }
.rte ul, .rte ol { margin: 0 0 1em; padding-left: 1.4em; }
.rte ul { list-style: disc; }
.rte ol { list-style: decimal; }
.rte li { margin-bottom: 0.4em; }
.rte strong, .rte b { color: var(--color-text); font-weight: 600; }
.rte a { color: var(--glow); text-decoration: underline; text-underline-offset: 2px; }

/* ---- layout utilities ----------------------------------------------------- */
.page-width {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section-spacing { padding-block: var(--space-section); }
.stack > * + * { margin-top: var(--flow, 1rem); }

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.6em;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn--primary {
  background: var(--glow);
  color: #0a0a0c;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px -8px var(--glow-soft);
  color: #0a0a0c;
}
.btn--ghost {
  border-color: var(--color-border);
  color: var(--color-text);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--glow); box-shadow: 0 0 24px -10px var(--glow-soft); }
.btn[aria-disabled="true"],
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn--full { width: 100%; }

/* ---- forms ---------------------------------------------------------------- */
.field {
  width: 100%;
  padding: 0.85em 1em;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.field:focus { outline: none; border-color: var(--glow); box-shadow: 0 0 0 3px var(--glow-soft); }
.field::placeholder { color: var(--color-text-muted); }

/* ---- a11y helpers --------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-to-content-link {
  position: fixed;
  top: -60px; left: 1rem;
  z-index: 1000;
  padding: 0.6em 1em;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--glow);
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-to-content-link:focus { top: 1rem; }

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

/* ---- atmosphere: film-grain overlay --------------------------------------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- scroll-reveal (JS toggles .is-visible) ------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Never hide content when JS is unavailable. */
.no-js .reveal { opacity: 1; transform: none; }

/* ---- reduced motion: kill all motion, snap to end states ------------------ */
@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;
  }
  .reveal { opacity: 1; transform: none; }
}


/* sale % badge — shared price snippet (card + PDP) */
.price__save { display: inline-block; align-self: center; margin-left: 0.15rem; padding: 0.22em 0.55em; font-family: var(--font-body); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; line-height: 1; white-space: nowrap; color: #0a0a0c; background: var(--color-ember); border-radius: 999px; }
