/* Campos Supply design system: tokens, reset, typography, shared components
   and motion. One file, so the first paint waits on one stylesheet less.

   Two themes share every token name:
   - default (store): quiet luxury on deep lead (chumbo) grey, the hero's
     own colour, from header to footer. Off-white ink, sand highlights, an
     editorial serif for titles and Inter for text and prices.
   - [data-theme="dark"] (merchant panel): the original dark monochrome.
   Components only read semantic tokens, so they work in both. */

/* ---------- 1. Primitive palette ---------- */
:root {
  --paper: #f4f1ec;
  --paper-2: #ece7df;
  --paper-3: #e4ddd2;
  --sand-300: #cfc5b6;
  --sand-500: #a89b88;
  --sand-700: #7d705e;
  --lead-900: #131211;
  --lead-800: #1f1e1c;
  --lead-700: #2c2b29;
  --lead-500: #4d4a46;
  --stone-500: #625e59;
  --white-soft: #fbfaf8;
}

/* ---------- 2. Semantic tokens (store, lead grey) ---------- */
:root {
  color-scheme: dark;

  /* Surfaces and ink. The store sits on pure black, to match the hero's space
     loop. Contrast on --bg (#000): --text 20.4:1, --text-2 16.9:1, --muted
     8.1:1 — all well past AA. Cards lift a few points so hairlines read. */
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #0c0c0c;
  --surface-2: #161616;
  --media-bg: #171717;
  --border: rgba(244, 241, 236, 0.12);
  --border-strong: rgba(244, 241, 236, 0.28);
  --text: var(--paper);
  --text-2: #e4ddd2;
  --muted: #a39d94;
  --accent: var(--sand-500);
  --danger: #f2a097;
  --success: #9fd0ac;
  --chrome: linear-gradient(180deg, #fbfaf8 0%, #d6ccbc 55%, #b3a691 100%);
  --glass: rgba(0, 0, 0, 0.82);
  --scrim: rgba(0, 0, 0, 0.62);
  --selection-bg: var(--paper);
  --selection-text: #000000;

  /* Type */
  --font-display: 'Cormorant Garamond', 'Cormorant', 'Times New Roman', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --heading-weight: 400;
  --heading-case: none;
  --heading-tracking: 0.01em;
  --tracking-label: 0.18em;
  --tracking-wide: 0.2em;
  --tracking-wider: 0.3em;
  --fs-2xs: 0.625rem;
  --fs-xs: 0.6875rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  --fs-2xl: clamp(2.5rem, 1.6rem + 4.2vw, 4.25rem);
  --fs-hero: clamp(2.6rem, 1rem + 7.5vw, 6.75rem);

  /* Space: a 4px rhythm, opened up for an editorial pace */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --section-y: clamp(88px, 6rem + 6vw, 168px);

  /* Shape and layout */
  --radius: 2px;
  --radius-lg: 4px;
  --radius-pill: 999px;
  --gutter: 20px;
  --container: 1360px;
  --header-h: 64px;

  /* Elevation: soft, warm, low */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
  --shadow-drawer: -30px 0 80px -40px rgba(0, 0, 0, 0.7);

  /* Motion: long, quiet ease-outs */
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-soft: cubic-bezier(0.55, 0, 1, 0.45);
  --dur-fast: 200ms;
  --dur-base: 450ms;
  --dur-slow: 700ms;
  --dur-reveal: 900ms;
  --dur-zoom: 1400ms;
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
    --header-h: 80px;
  }
}

/* ---------- 3. Dark theme (merchant panel): the original tokens ---------- */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-2: #0f0f12;
  --surface: #151518;
  --surface-2: #1b1b1f;
  --media-bg: #151518;
  --border: #232328;
  --border-strong: #3a3a42;
  --text: #ffffff;
  --text-2: #ededed;
  --muted: #8a8a93;
  --accent: #a1a1aa;
  --danger: #f2777a;
  --success: #8fd6a4;
  --chrome: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  --glass: rgba(10, 10, 12, 0.72);
  --scrim: rgba(0, 0, 0, 0.5);
  --selection-bg: #ededed;
  --selection-text: #0a0a0c;
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --heading-weight: 500;
  --heading-case: uppercase;
  --heading-tracking: 0.2em;
  --radius: 6px;
  --radius-lg: 12px;
  --gutter: 16px;
  --container: 1200px;
  --header-h: 64px;
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-reveal: 400ms;
  --dur-zoom: 500ms;
}

@media (min-width: 768px) {
  :root[data-theme='dark'] {
    --gutter: 24px;
    --header-h: 72px;
  }
}

/* Hero and footer used to be lead bands on a light page. The whole store is
   lead now, so the class only keeps the band in step with the page: same
   ground, same ink, no visible break. The solid --bg stays on purpose: the hero
   isolates its stacking context, and the logo's screen blend needs an opaque
   backdrop to drop its black. */
.on-dark {
  background: var(--bg);
  color: var(--text-2);
}

/* ---------- 4. Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  color: var(--text);
  text-transform: var(--heading-case);
  letter-spacing: var(--heading-tracking);
  line-height: 1.1;
}

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
  border-radius: 1px;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* ---------- 5. Utilities ---------- */

/* The hidden attribute always wins over component display rules (.btn, flex rows). */
[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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;
}

.chrome-text {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--muted);
}

.rule {
  width: 40px;
  height: 1px;
  margin-top: var(--space-4);
  border: 0;
  background: var(--border-strong);
}

/* ---------- 6. Buttons and pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  transition:
    background-color var(--dur-fast) var(--ease-out-soft),
    border-color var(--dur-fast) var(--ease-out-soft),
    color var(--dur-fast) var(--ease-out-soft),
    transform var(--dur-fast) var(--ease-out-soft),
    opacity var(--dur-fast) ease;
}

.btn:hover {
  border-color: var(--text);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn--primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.btn--primary:hover {
  border-color: var(--text-2);
  background: var(--text-2);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text-2);
}

.btn--block {
  width: 100%;
}

.pill {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease-out-soft),
    border-color var(--dur-fast) var(--ease-out-soft),
    color var(--dur-fast) var(--ease-out-soft),
    transform var(--dur-fast) var(--ease-out-soft);
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill:active {
  transform: scale(0.97);
}

.pill[aria-pressed='true'],
.pill:has(input:checked) {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* ---------- 7. Motion ---------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spotlight-pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes shimmer {
  from {
    background-position: -200% 0;
  }
  to {
    background-position: 200% 0;
  }
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* Load-time fade-up for above-the-fold elements. --d sets the delay. */
.fade-up {
  animation: fade-up var(--dur-reveal) var(--ease-out-soft) both;
  animation-delay: var(--d, 0s);
}

/* Scroll reveal. Hidden only when JS is on, so no-JS visitors see content. */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1.2s var(--ease-out-soft) var(--d, 0s),
    transform 1.2s var(--ease-out-soft) var(--d, 0s);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
