:root {
  /* ===== Starboard design tokens (source: design-extractor, "Warm Minimalist") =====
     Canonical palette is the light/cream theme. The Sailor's Oracle renders in
     DARK mode, so the aliases at the end map text-primary (navy) -> page
     background and background (cream) -> text. */

  /* Color */
  --color-background: #f5e6cd;      /* warm cream — light-theme page bg */
  --color-surface: #e5e7eb;         /* soft gray — light-theme surfaces */
  --color-accent-primary: #a4e636;  /* electric lime */
  --color-accent-light: #faf9d4;    /* pale accent */
  --color-text-primary: #1b1f3b;    /* deep navy */
  --color-text-secondary: #2d3268;
  --color-text-muted: #4d5198;
  --color-pure-black: #000000;
  --color-pure-white: #ffffff;

  /* Typography */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Chivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing (4px base) */
  --spacing-xs: 2px;  --spacing-sm: 4px;   --spacing-md: 8px;   --spacing-lg: 12px;
  --spacing-xl: 16px; --spacing-2xl: 24px; --spacing-3xl: 32px; --spacing-4xl: 48px;
  --spacing-5xl: 64px; --spacing-6xl: 80px; --spacing-7xl: 96px; --spacing-8xl: 128px;

  /* Border radius scale */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-full: 9999px;

  /* Elevation */
  --shadow-sm: rgba(0, 0, 0, 0.4) 0 2px 8px -2px, rgba(0, 0, 0, 0.3) 0 1px 2px -1px;
  --shadow-lg: rgba(0, 0, 0, 0.5) 0 25px 50px -12px;

  /* ===== Dark-theme mapping used across the oracle ===== */
  --navy: var(--color-text-primary);      /* navy as page background */
  --navy-2: #04041c;
  --surface: var(--color-text-secondary); /* raised panels on dark */
  --periwinkle: var(--color-text-muted);
  --accent: var(--color-accent-primary);
  --accent-deep: #8fc91f;
  --cream: var(--color-background);        /* cream as text */
  --cream-muted: rgba(245, 230, 205, 0.78);
  --cream-soft: rgba(245, 230, 205, 0.6);
  --ink: var(--color-text-primary);        /* navy text on lime */
  --radius: var(--radius-lg);              /* 12px — interactive elements */
  --radius-card: var(--radius-xl);         /* 16px */
  --radius-pill: var(--radius-full);
  --shadow-card: 0 18px 36px rgba(4, 4, 28, 0.55);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--cream);
  background: var(--navy);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Top nav — slim bar with a small centered wordmark */
.nav { display: flex; align-items: center; justify-content: center; height: 62px; padding: 0 20px; border-bottom: 1px solid rgba(245, 230, 205, 0.12); position: relative; z-index: 3; }
.nav-logo { line-height: 0; }
.nav-logo img { height: 28px; width: auto; display: block; }

/* Hero with scattered decorative motifs */
.hero { position: relative; overflow: hidden; min-height: 76vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 56px 20px; }
.hero-inner { position: relative; z-index: 2; max-width: 620px; margin: 0 auto; }
.hero h1 { font-size: clamp(42px, 9vw, 86px); line-height: 1.05; margin: 0 0 18px; }
.hero .lede { font-size: 18px; color: rgba(245, 230, 205, 0.72); margin: 0 auto 26px; }

.motif { position: absolute; z-index: 1; pointer-events: none; opacity: 0.92; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3)); }
.motif--key { top: 11%; left: 6%; width: 92px; transform: rotate(-8deg); }
.motif--crow { top: 30%; left: 19%; width: 90px; }
.motif--compass { top: 20%; right: 6%; width: 112px; }
.motif--anchor { bottom: 20%; left: 8%; width: 96px; }
.motif--eye { bottom: 6%; left: 34%; width: 104px; }
.motif--shell { bottom: 15%; right: 9%; width: 112px; }
.motif--conch { bottom: 3%; right: 5%; width: 104px; transform: rotate(6deg); }
@media (max-width: 820px) {
  .motif { width: 70px !important; opacity: 0.8; }
  .motif--crow, .motif--anchor, .motif--conch { display: none; }
}
@media (max-width: 540px) { .motif { display: none; } }

/* Deck browse section */
.deck-section { max-width: 760px; margin: 0 auto; padding: 12px 20px 80px; }
.deck-label { text-align: center; text-transform: uppercase; letter-spacing: 0.3em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 6px; }
.deck-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; text-align: center; margin: 0 0 18px; }

a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }

h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 6.5vw, 52px);
  line-height: 1.15;
  margin: 0 0 14px;
}

.lede { color: rgba(245, 230, 205, 0.85); max-width: 46ch; margin: 0 auto 4px; }

.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 14px 30px;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Card turn (single image — swaps art at the edge-on midpoint, never mirrors) */
.stage { display: flex; justify-content: center; margin: 6px 0 8px; }
.flip-card {
  width: min(70vw, 300px);
  aspect-ratio: 600 / 776;
  padding: 0; border: 0; background: none; cursor: pointer;
  perspective: 1200px;
}
.card-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 36px rgba(4, 4, 28, 0.55);
  transform: rotateY(0deg);
  transition: transform 0.3s ease;
}
.card-img.turning { transform: rotateY(90deg); }
.tap-hint {
  text-align: center; color: var(--accent); letter-spacing: 0.12em;
  text-transform: uppercase; font-size: 12px; font-weight: 700; margin: 14px 0 0;
  transition: opacity 0.3s ease;
}

/* Reading */
.reading { max-width: 560px; margin: 26px auto 0; opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reading.show { opacity: 1; transform: none; }
.card-name { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 32px; text-align: center; margin: 0 0 6px; }
.card-keywords { text-align: center; text-transform: uppercase; letter-spacing: 0.2em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 18px; }
.teaser { font-size: 18px; color: var(--cream); text-align: center; margin: 0 auto 22px; max-width: 44ch; }
.meaning p { color: var(--cream-muted); margin: 0 0 14px; }
.reflection-line { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--cream); text-align: center; max-width: 44ch; margin: 22px auto 0; }

/* Browse grid — 4 columns (2 on narrow screens) */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.tile { display: block; text-decoration: none; color: inherit; }
.tile img { width: 100%; aspect-ratio: 600 / 776; object-fit: cover; border-radius: var(--radius-lg); box-shadow: 0 8px 18px rgba(4, 4, 28, 0.4); transition: transform 0.15s ease; }
.tile:hover img { transform: translateY(-3px); }
.tile span { display: block; text-align: center; font-size: 13px; margin-top: 7px; color: rgba(245, 230, 205, 0.8); }

.foot { text-align: center; color: var(--cream-soft); font-size: 13px; margin-top: 56px; }
.foot a { color: var(--accent); }

/* Site footer (themed) */
.site-footer { text-align: center; padding: 44px 20px 56px; margin-top: 48px; border-top: 1px solid rgba(245, 230, 205, 0.12); }
.footer-mark { width: 40px; height: auto; opacity: 0.9; display: inline-block; margin: 0 0 10px; }
.footer-line { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--cream); margin: 0 0 4px; }
.footer-line a { color: var(--cream); text-decoration: none; }
.footer-line a:hover { color: var(--accent); }
.footer-fine { font-size: 13px; color: var(--cream-soft); margin: 0; }
.footer-fine a { color: var(--accent); }
.load-error { text-align: center; color: var(--cream-soft); font-size: 13px; margin: 24px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--cream); color: var(--ink); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .card-img, .reading, .tile img, .toast { transition: none !important; }
}
