/*
 * James E Ventures shared design tokens.
 * Section themes preserve each experience's existing character while sharing
 * the global identity, interaction, layout, type and motion primitives.
 */
:root,
:root[data-jev-theme="studio"] {
  color-scheme: dark;

  /* Global palette */
  --jev-black: #070604;
  --jev-charcoal: #12100c;
  --jev-panel: #17120d;
  --jev-velvet: #5d1b1b;
  --jev-velvet-dark: #190808;
  --jev-ivory: #f7eedb;
  --jev-muted: #cfc1a5;
  --jev-gold: #e0b45c;
  --jev-gold-soft: #f0d48a;
  --jev-gold-deep: #7e5519;
  --jev-bronze: #8f6d3a;
  --jev-rose: #e8b4c8;
  --jev-rose-deep: #9a4f72;
  --jev-lavender: #c4b5e0;
  --jev-champagne: #f5e6c8;

  /* Typography and responsive scale */
  --jev-font-display: "Bodoni 72", "Bodoni MT", Didot, "Times New Roman", serif;
  --jev-font-body: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  --jev-font-label: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  --jev-text-xs: 0.75rem;
  --jev-text-sm: 0.875rem;
  --jev-text-base: 1rem;
  --jev-text-lg: 1.25rem;
  --jev-heading: clamp(2.25rem, 7vw, 5rem);

  /* Spacing, layout and shape */
  --jev-space-1: 0.5rem;
  --jev-space-2: 0.75rem;
  --jev-space-3: 1rem;
  --jev-space-4: 1.5rem;
  --jev-space-5: 2rem;
  --jev-space-6: 3rem;
  --jev-space-7: 5rem;
  --jev-content-width: 80rem;
  --jev-reading-width: 72ch;
  --jev-control-height: 3rem;
  --jev-radius-sm: 4px;
  --jev-radius-md: 10px;
  --jev-radius-lg: 16px;

  /* Borders, focus, surfaces, elevation and motion */
  --jev-border: rgba(224, 180, 92, 0.42);
  --jev-border-rose: rgba(232, 180, 200, 0.28);
  --jev-glass: rgba(247, 238, 219, 0.07);
  --jev-focus: #ffe6a2;
  --jev-line: rgba(214, 168, 77, 0.28);
  --jev-shadow-gold: 0 18px 80px rgba(224, 180, 92, 0.28), 0 0 40px rgba(232, 180, 200, 0.08);
  --jev-shadow-panel: 0 24px 80px rgba(0, 0, 0, 0.42);
  --jev-shadow-glitter: 0 0 24px rgba(240, 212, 138, 0.35), 0 0 48px rgba(232, 180, 200, 0.12);
  --jev-ease: cubic-bezier(0.19, 1, 0.22, 1);
  --jev-motion-fast: 160ms;
  --jev-motion-standard: 280ms;

  /* Studio compatibility aliases */
  --font-display: var(--jev-font-display);
  --font-body: var(--jev-font-body);
  --space-1: var(--jev-space-1);
  --space-2: var(--jev-space-2);
  --space-3: var(--jev-space-3);
  --space-4: var(--jev-space-4);
  --space-5: var(--jev-space-5);
  --space-6: var(--jev-space-6);
  --space-7: var(--jev-space-7);
  --radius-sm: var(--jev-radius-sm);
  --radius-md: var(--jev-radius-md);
  --shadow-gold: var(--jev-shadow-gold);
  --shadow-panel: var(--jev-shadow-panel);
  --shadow-glitter: var(--jev-shadow-glitter);
  --ease-studio: var(--jev-ease);
}

/* National Archive of the Duck Universe: original archive palette. */
:root {
  --jev-duck-black: #080806;
  --jev-duck-ink: #11100d;
  --jev-duck-oak: #24160d;
  --jev-duck-oak-light: #432918;
  --jev-duck-stone: #79756b;
  --jev-duck-stone-dark: #2b2a25;
  --jev-duck-paper: #e8dcc2;
  --jev-duck-paper-bright: #f5ead3;
  --jev-duck-muted: #b9ad94;
  --jev-duck-brass: #c7a15b;
  --jev-duck-brass-pale: #ead394;
  --jev-duck-brass-dark: #755527;
  --jev-duck-oxblood: #641b20;
  --jev-duck-green: #243b34;
  --jev-duck-blue: #182d3a;
  --jev-duck-line: rgba(199, 161, 91, 0.34);
  --jev-duck-line-soft: rgba(232, 220, 194, 0.13);
  --jev-duck-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --jev-duck-font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --jev-duck-font-label: "Arial Narrow", "Avenir Next Condensed", "Segoe UI", sans-serif;
  --jev-duck-page: min(1280px, calc(100% - 2rem));
  --jev-duck-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Timeline N: restrained documentary palette. */
  --jev-timeline-bg: #080907;
  --jev-timeline-bg-raised: #11130f;
  --jev-timeline-paper: #d9cfb4;
  --jev-timeline-paper-bright: #eee6d2;
  --jev-timeline-ink: #191814;
  --jev-timeline-muted: #8f8979;
  --jev-timeline-red: #6f211c;
  --jev-timeline-gold: #b69862;
  --jev-timeline-line: rgba(230, 221, 198, 0.18);
  --jev-timeline-focus: #f0d48a;
  --jev-timeline-font-display: "IM Fell English", Georgia, serif;
  --jev-timeline-font-body: Inter, system-ui, sans-serif;

  /* Shared interface system: stable foundations, with each venture free to theme itself. */
  --jev-ui-ink: #f7eedb;
  --jev-ui-ink-soft: #dfc9a9;
  --jev-ui-paper: #24160d;
  --jev-ui-surface: #342318;
  --jev-ui-line: rgba(224, 180, 92, 0.32);
  --jev-ui-muted: #c5b294;
  --jev-ui-accent: #e0b45c;
  --jev-ui-accent-strong: #c7a15b;
  --jev-ui-coral: #e8b4c8;
  --jev-ui-blue: #c4b5e0;
  --jev-ui-radius-sm: 0.65rem;
  --jev-ui-radius-md: 1.15rem;
  --jev-ui-radius-lg: 1.75rem;
  --jev-ui-content: 78rem;
  --jev-ui-reading: 68ch;
  --jev-ui-control: 2.75rem;
}


* {
  box-sizing: border-box;
}

html {
  background: var(--jev-black);
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgba(224, 180, 92, 0.2), transparent 50%),
    radial-gradient(circle at 100% 20%, rgba(154, 79, 114, 0.14), transparent 32rem),
    radial-gradient(circle at 0% 70%, rgba(93, 27, 27, 0.22), transparent 30rem),
    radial-gradient(circle at 80% 90%, rgba(196, 181, 224, 0.06), transparent 24rem),
    linear-gradient(90deg, rgba(214, 168, 77, 0.07) 1px, transparent 1px) 0 0 / 92px 92px,
    linear-gradient(0deg, rgba(214, 168, 77, 0.05) 1px, transparent 1px) 0 0 / 92px 92px,
    var(--jev-black);
  color: var(--jev-ivory);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

body.is-splashing {
  overflow: hidden;
}

/* Soft foil / glitter film over the whole stage */
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 236, 180, 0.55), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(232, 180, 200, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 44% 32%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 61% 78%, rgba(224, 180, 92, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 76% 22%, rgba(196, 181, 224, 0.35), transparent),
    radial-gradient(1px 1px at 88% 55%, rgba(255, 236, 180, 0.4), transparent),
    radial-gradient(1px 1px at 8% 88%, rgba(232, 180, 200, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 52% 48%, rgba(255, 255, 255, 0.2), transparent),
    linear-gradient(115deg, transparent 0 46%, rgba(214, 168, 77, 0.08) 46% 47%, transparent 47%),
    linear-gradient(245deg, transparent 0 46%, rgba(247, 238, 219, 0.04) 46% 47%, transparent 47%);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    360px 360px,
    360px 360px;
  opacity: 0.9;
  animation: glitter-drift 18s ease-in-out infinite alternate;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(93, 27, 27, 0.12), transparent 50%);
  opacity: 0.8;
}

@keyframes glitter-drift {
  from {
    opacity: 0.75;
    filter: brightness(0.95);
  }
  to {
    opacity: 1;
    filter: brightness(1.08);
  }
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--jev-gold);
  color: var(--jev-black);
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--jev-ivory);
  color: var(--jev-black);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--jev-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 0.35s var(--ease-studio),
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease;
}

.button:hover {
  transform: translateY(-3px);
  border-color: var(--jev-gold-soft);
  box-shadow: var(--shadow-glitter);
}

.button--primary {
  background: linear-gradient(135deg, var(--jev-gold-soft) 0%, var(--jev-gold) 40%, #c4893a 100%);
  color: var(--jev-black);
  box-shadow: var(--shadow-gold);
  border-color: rgba(255, 236, 180, 0.5);
  position: relative;
  overflow: hidden;
}

.button--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-studio);
}

.button--primary:hover::after {
  transform: translateX(120%);
}

.button--ghost {
  background: rgba(7, 6, 4, 0.45);
  color: var(--jev-ivory);
  backdrop-filter: blur(8px);
}

.button--ghost:hover {
  border-color: var(--jev-rose);
  color: var(--jev-champagne);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--jev-gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(224, 180, 92, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  body::before {
    animation: none !important;
  }
}
