/* Elektron Geek design tokens. Source of truth: DESIGN.md. Shared by landing/ and theme/. */
:root {
  /* color */
  --eg-ink: #0a0a0b;
  --eg-ink-2: #1c1a17;
  --eg-paper: #f5f3ee;
  --eg-gold: #c9a961;
  --eg-gold-light: #e8d5a3;
  --eg-gold-deep: #7a5c1e;
  --eg-black: #000000;
  --eg-on-black: var(--eg-paper);
  --eg-on-black-muted: rgb(245 243 238 / 0.66);

  --eg-bg: var(--eg-paper);
  --eg-fg: var(--eg-ink);
  --eg-fg-muted: rgb(17 17 17 / 0.62);
  --eg-accent-text: var(--eg-gold-deep);
  --eg-hairline: #e2ddd2;
  --eg-well: #ffffff; /* plate behind every product image (cards, gallery, thumbnails, category row) */

  /* type */
  --eg-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, Roboto, "Segoe UI", sans-serif;
  --eg-size-xs: 13px;
  --eg-size-sm: 15px;
  --eg-size-md: 17px;
  --eg-size-lg: 21px;
  --eg-size-xl: 28px;
  --eg-size-2xl: 40px;
  --eg-size-3xl: 56px;
  --eg-weight-regular: 400;
  --eg-weight-strong: 600;

  /* space */
  --eg-space-1: 4px;
  --eg-space-2: 8px;
  --eg-space-3: 12px;
  --eg-space-4: 16px;
  --eg-space-5: 24px;
  --eg-space-6: 32px;
  --eg-space-7: 48px;
  --eg-space-8: 72px;
  --eg-space-9: 112px;

  /* shape (concentric: inner = outer - padding) */
  --eg-radius-control: 12px;
  --eg-radius-card: 22px;
  --eg-radius-sheet: 28px;
  --eg-radius-pill: 999px; /* every button; fields and selects keep --eg-radius-control */

  /* controls (Wave 5). Only sizes live here; colours come from --eg-fg / --eg-bg / --eg-fg-muted at the point of use,
     because a custom property that holds var(--eg-fg) is resolved on :root and would ignore a black surface. */
  --eg-btn-h: 48px;            /* primary (glitter CTA) and secondary: one height, both surfaces */
  --eg-btn-pad: var(--eg-space-6);
  --eg-btn-size: var(--eg-size-md);
  --eg-btn-weight: var(--eg-weight-strong);
  --eg-field-h: 48px;          /* input, select, textarea, checkout fields */
  --eg-field-pad: var(--eg-space-4);
  --eg-field-size: var(--eg-size-md); /* 17px: above the 16px at which iOS zooms into a focused field */
  --eg-chip-h: 44px;           /* filter chips, condition segments, sidebar rows: selected = ink pill (--eg-fg on --eg-bg) */

  /* glass */
  --eg-glass-fill: rgb(255 255 255 / 0.58);
  --eg-glass-blur: 22px;
  --eg-glass-saturate: 180%;
  --eg-glass-rim-top: rgb(255 255 255 / 0.9);
  --eg-glass-shadow: 0 10px 30px rgb(60 45 20 / 0.16), 0 1px 2px rgb(60 45 20 / 0.12);
  --eg-glass-solid: #ffffff;

  /* thin material */
  --eg-thin-fill: rgb(255 255 255 / 0.6);
  --eg-thin-blur: 30px;

  /* CTA "cristal" */
  --eg-cta-pane-blur: 3px;
  --eg-cta-pane-blur-hover: 1.6px;
  --eg-cta-veil: 0.22;

  /* motion (see DESIGN.md → Motion) */
  --eg-dur-press: 100ms;
  --eg-dur-fast: 200ms;
  --eg-dur: 360ms;
  --eg-dur-exit: 240ms; /* exits: apple.com nav duration; always shorter than --eg-dur */
  --eg-dur-page: 150ms;
  --eg-dur-slow: 600ms;
  --eg-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --eg-ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);
  --eg-ease-exit: cubic-bezier(0.4, 0, 0.6, 1); /* exits: symmetric, like apple.com; no cut at the end of a translate */
  --eg-rise: 16px;
  --eg-settle-scale: 0.98;
  --eg-press-scale: 0.97;
  --eg-press-scale-lg: 0.99;
  --eg-recede-scale: 0.94;
  --eg-hover-scale: 1.02;
  --eg-materialise-scale: 0.96; /* enter scale of a surface that arrives (docks, unit chip, menu panel from 600px, cart badge); blur is never animated */

  /* reviews carousel: drag release spring (read by reviews.js) */
  --eg-spring-damping: 0.8;
  --eg-spring-response: 400ms;
  /* no-overshoot spring for settles with no flick before them: reviews arrows and keys, filter sheet drag release */
  --eg-spring-ui-damping: 1;
  --eg-spring-ui-response: 350ms;

  /* scroll edge under the bar (when built) */
  --eg-bar-fade: 24px;

  /* focus */
  --eg-focus: 2px solid var(--eg-accent-text); /* gold-deep on paper (about 5.5:1), gold-light on black; gold-light alone is 1.3:1 on paper */
  --eg-focus-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --eg-bg: var(--eg-black);
    --eg-fg: var(--eg-paper);
    --eg-fg-muted: rgb(245 243 238 / 0.62);
    --eg-accent-text: var(--eg-gold-light);
    --eg-hairline: rgb(255 255 255 / 0.1);
    --eg-well: var(--eg-ink-2);
    --eg-glass-fill: rgb(255 255 255 / 0.055);
    --eg-glass-rim-top: rgb(255 255 255 / 0.2);
    --eg-glass-shadow: 0 10px 30px rgb(0 0 0 / 0.38), 0 1px 2px rgb(0 0 0 / 0.3);
    --eg-glass-solid: var(--eg-ink-2);
    --eg-thin-fill: rgb(26 24 21 / 0.48);
  }
}

:root[data-theme="dark"] {
  --eg-bg: var(--eg-black);
  --eg-fg: var(--eg-paper);
  --eg-fg-muted: rgb(245 243 238 / 0.62);
  --eg-accent-text: var(--eg-gold-light);
  --eg-hairline: rgb(255 255 255 / 0.1);
  --eg-well: var(--eg-ink-2);
  --eg-glass-fill: rgb(255 255 255 / 0.055);
  --eg-glass-rim-top: rgb(255 255 255 / 0.2);
  --eg-glass-shadow: 0 10px 30px rgb(0 0 0 / 0.38), 0 1px 2px rgb(0 0 0 / 0.3);
  --eg-glass-solid: var(--eg-ink-2);
  --eg-thin-fill: rgb(26 24 21 / 0.48);
}

/* Black surface (hero and closing). Stays black in both color schemes.
   Values copied from the dark-mode block. Never use --eg-gold-deep here. */
[data-surface="black"],
.is-surface-black {
  --eg-bg: var(--eg-black);
  --eg-fg: var(--eg-on-black);
  --eg-fg-muted: var(--eg-on-black-muted);
  --eg-accent-text: var(--eg-gold-light);
  --eg-hairline: rgb(255 255 255 / 0.1);
  --eg-well: var(--eg-ink-2);
  --eg-glass-fill: rgb(255 255 255 / 0.055);
  --eg-glass-rim-top: rgb(255 255 255 / 0.2);
  --eg-glass-shadow: 0 10px 30px rgb(0 0 0 / 0.38), 0 1px 2px rgb(0 0 0 / 0.3);
  --eg-glass-solid: var(--eg-ink-2);
  --eg-thin-fill: rgb(26 24 21 / 0.48);
  background: var(--eg-black);
  color: var(--eg-on-black);
  color-scheme: dark;
}

/* Reduced motion: no movement, no scale. Opacity crossfades stay, short. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --eg-dur-press: 0ms;
    --eg-dur: var(--eg-dur-fast);
    --eg-dur-exit: 150ms;
    --eg-dur-page: 150ms;
    --eg-dur-slow: 0ms;
    --eg-rise: 0px;
    --eg-settle-scale: 1;
    --eg-press-scale: 1;
    --eg-press-scale-lg: 1;
    --eg-recede-scale: 1;
    --eg-hover-scale: 1;
    --eg-materialise-scale: 1;
    --eg-spring-damping: 1;
  }
}
