/* ============================================================
   ATLANTIS — The Lost Archive of Color
   Themed from the rarest palette in the collection ("Ember"):
   plum-black · parchment · ember · gold · jewel-teal
   Typography: Cinzel (carved, ancient) + Cormorant (italic) + Manrope (UI)
   ============================================================ */

/* Accessibility: skip-to-content link — off-screen until keyboard-focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--gold, #ffe14d);
  color: #1a1405;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }
#app:focus { outline: none; }
/* visually hidden, still announced by screen readers (route live region) */
.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; }

:root {
  /* surfaces — recovered-relic darkness */
  /* surfaces — "Neon Toxin" (dark identity): violet-black abyss, neon accents */
  --abyss:      #08060e;
  --bg:         #0e0a16;        /* dominant 58% */
  --deep:       #171029;
  --panel:      #241838;        /* neutral 20% */
  --panel-2:    #33244d;        /* violet surface (neutral → secondary) */
  --line:       rgba(200, 180, 255, 0.10);
  --line-soft:  rgba(200, 180, 255, 0.05);
  --chrome:     rgba(14, 10, 22, 0.80);   /* nav/footer surface — tracks the theme */

  /* toxic neon accents — violet / cyan / acid-gold, blended across the site */
  --parchment:  #e3dcef;        /* cool light */
  --ember:      #9d2bff;        /* toxic violet (secondary 12%) */
  --ember-deep: #7a1fd0;
  --gold:       #ffe14d;        /* acid gold accent (4%) */
  --gold-soft:  #ffe98a;
  --gold-bright:#ffe14d;
  --teal:       #3cffd0;        /* neon cyan accent (6%) */
  --teal-soft:  #8bffe6;
  --blue:       #9d2bff;

  --text:       #ecebf6;        /* lavender ivory */
  --muted:      #9a90b5;        /* muted lilac */
  --muted-2:    #685d85;

  /* ALWAYS-LEGIBLE accent inks: *-text leans to --text (for accent-coloured TEXT, auto-tracks
     theme + skin); *-ink is the readable ink ON an accent FILL (skin recomputes via readableOn). */
  --gold-text:  color-mix(in srgb, var(--gold) 60%, var(--text));   /* dark bg → vivid, LED-bright accent text */
  --teal-text:  color-mix(in srgb, var(--teal) 62%, var(--text));
  --ember-text: color-mix(in srgb, var(--ember) 64%, var(--text));
  --gold-ink:   #1a1405;
  --teal-ink:   #04201f;
  --ember-ink:  #ffffff;

  --radius:     16px;
  --radius-sm:  11px;
  --maxw:       1240px;

  --display:     "Cinzel", "Times New Roman", serif;
  --display-orn: "Cinzel Decorative", "Cinzel", serif;
  --serif:       "Cormorant Garamond", Georgia, serif;
  --sans:        "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shadow:    0 30px 70px -24px rgba(0, 0, 0, 0.8);
  --glow-gold: 0 0 40px -10px rgba(255, 225, 77, 0.42);
  --glow-teal: 0 0 32px -10px rgba(60, 255, 208, 0.45);
  --name-stroke: rgba(255, 255, 255, 0.42);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  letter-spacing: 0.004em;
  min-height: 100vh;
  background:
    radial-gradient(1100px 640px at 84% -8%, color-mix(in srgb, var(--gold) 24%, transparent), transparent 60%),
    radial-gradient(900px 560px at -8% 4%, color-mix(in srgb, var(--teal) 26%, transparent), transparent 58%),
    radial-gradient(1100px 760px at 50% 116%, color-mix(in srgb, var(--ember) 24%, transparent), transparent 64%),
    linear-gradient(180deg, var(--abyss) 0%, var(--bg) 38%, var(--deep) 100%),
    var(--bg);
}

/* vignette */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(135% 120% at 50% 0%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: color-mix(in srgb, var(--ember) 32%, transparent); color: #fff; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.25s ease, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #211404; box-shadow: var(--glow-gold);
}
.btn-gold:hover { box-shadow: 0 0 46px -8px color-mix(in srgb, var(--gold) 52%, transparent); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(232, 215, 201, 0.02); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); color: var(--text); }
.btn-teal { background: linear-gradient(135deg, var(--teal-soft), var(--teal)); color: #04201f; font-weight: 700; box-shadow: var(--glow-teal); }
.btn-teal:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ember { background: linear-gradient(135deg, var(--ember), var(--ember-deep)); color: #fff; box-shadow: 0 0 38px -10px color-mix(in srgb, var(--ember) 45%, transparent); }
.btn-ember:hover { transform: translateY(-1px); }
.btn-lg { padding: 16px 34px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(20px, 4vw, 52px);
  background: var(--chrome); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark { display: block; height: 36px; width: auto; filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 11px rgba(95, 220, 236, 0.16)); transition: transform 0.4s cubic-bezier(.2,.8,.2,1), filter 0.3s ease; }
.brand:hover .brand-mark { transform: translateY(-1px) scale(1.04); filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(95, 220, 236, 0.3)); }
.brand-name { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: 0.34em; color: var(--text); background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--gold) 55%, var(--text))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand--footer .brand-mark { height: 32px; }
.nav-links { display: flex; gap: 30px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; transform: translateX(14px); }
/* Treasure / Pricing / Origin stay clearly LIT (legible accent ink) on every theme AND every
   cycling skin — never the dim --muted; the live page is marked by a crisp underline (no blur). */
.nav-links a { position: relative; color: color-mix(in srgb, var(--text) 72%, var(--gold-text)); transition: color 0.2s var(--ease-out); }
.nav-links a:hover, .nav-links a.active { color: color-mix(in srgb, var(--text) 45%, var(--gold-text)); }
.nav-links a::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: -7px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transform-origin: center; transition: transform 0.22s var(--ease-out); }
.nav-links a:hover::after { transform: scaleX(0.5); }
.nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4vw, 52px); position: relative; z-index: 2; }
.section { padding: clamp(60px, 10vw, 120px) 0; animation: fadeUp 0.7s ease both; }
/* the palette page AND explore start close to the nav — no big empty band above the content */
.section--detail, .section--explore { padding-top: clamp(18px, 2.4vw, 34px); }
.section--about { padding-top: clamp(15px, 3.4vw, 38px); }   /* Origin content nudged down a touch */
/* Origin lede — flows IN LINE with the body text (no offset bar / indent / oversized break),
   keeping the serif-italic gold voice as a quiet opening line */
.section--about .prose .pull {
  border-left: 0; padding-left: 0;
  font-size: 19.5px; line-height: 1.55;
  margin: 18px 0 26px; max-width: 64ch;
}
/* Origin closing note — BOLD and always readable: leans hard toward the skin's contrast ink,
   so it's naturally light on dark palettes and dark on light palettes */
.about-note {
  font-size: 15px !important;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: color-mix(in srgb, var(--text) 80%, var(--muted)) !important;
}
.section--pricing { padding-top: clamp(10px, 3.5vw, 38px); }   /* lift the Pricing header up a touch more */
.section--profile { padding-top: clamp(40px, 7vw, 84px); }   /* lift the Profile header up */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 20px; display: inline-flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: "◆"; font-size: 8px; color: var(--ember); }
.h1 { font-family: var(--display-orn); font-size: clamp(48px, 10vw, 124px); line-height: 0.98; font-weight: 700; letter-spacing: 0.1em; }
.h2 { font-family: var(--display); font-size: clamp(28px, 4.4vw, 50px); line-height: 1.1; font-weight: 600; letter-spacing: 0.04em; }
.lead { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 56ch; }

/* ornamental divider */
.ornament { display: flex; align-items: center; gap: 16px; color: var(--gold); max-width: 560px; margin: 38px 0; }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 60%, transparent)); }
.ornament::after { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 60%, transparent), transparent); }
.ornament span { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }

/* ---------- Hero ---------- */
/* the hero FILLS the screen below the sticky nav (82px) so the colour drawer takes the whole
   first view — no skin strip left below it; the text block is vertically centred on the LEFT */
.hero { position: relative; overflow: hidden; min-height: calc(100vh - 82px); min-height: calc(100svh - 82px);
  display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 6vw, 92px) 0; animation: fadeUp 0.9s ease both; }
.hero-inner { position: relative; z-index: 2; }
.hero-ghost {
  position: absolute; right: -2%; top: 8%; z-index: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(180px, 34vw, 460px); letter-spacing: 0.1em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(0, 229, 199, 0.08); pointer-events: none; user-select: none;
}
.hero .h1 { margin: 4px 0 26px; color: var(--parchment); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero .h1 { background: linear-gradient(180deg, #ffffff 6%, var(--gold) 52%, var(--teal-soft)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.hero-soul { font-family: var(--serif); font-style: italic; font-size: clamp(21px, 2.7vw, 31px); color: var(--parchment); max-width: 34ch; line-height: 1.3; }
.hero-soul em { color: var(--gold-soft); font-style: italic; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 42px; }
.hero-strip { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 48px; max-width: 600px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-strip span { flex: 1; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 22px; }
.step { background: linear-gradient(180deg, var(--panel), var(--deep)); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; transition: border-color 0.25s, transform 0.25s; }
.step:hover { border-color: color-mix(in srgb, var(--gold) 35%, transparent); transform: translateY(-4px); }
.step .n { font-family: var(--display); font-size: 30px; color: var(--gold); letter-spacing: 0.1em; }
.step h3 { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: 0.06em; margin: 14px 0 9px; }
.step p { color: var(--muted); font-size: 14px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 8px 0 30px; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; }
.search:focus-within { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted-2); }
.search-clear { flex: none; width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }
.search-clear:hover { color: var(--text); border-color: var(--gold); }
/* vault empty-state — spans the grid, quiet and helpful */
.vault-empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--muted); }
.vault-empty p { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-size: 19px; }
.vault-empty .hint b { color: var(--teal-text); font-style: normal; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 9px 16px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; border: 1px solid var(--line); color: var(--muted); background: rgba(232, 215, 201, 0.02); transition: all 0.15s ease; }
.chip:hover { color: var(--text); }
.chip.active { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 42%, transparent); }
.chip.gold.active { background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 42%, transparent); }
.toolbar-meta { width: 100%; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

/* ---------- Palette grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 22px; }
/* PERF: off-screen cards skip layout & paint entirely (2,000-card vault renders like 20).
   Identical visuals — the browser simply defers drawing until a card nears the viewport. */
.grid > .card { content-visibility: auto; contain-intrinsic-size: 280px 180px; }
/* each card's ground softly wears ITS OWN palette: a translucent wash layered between the
   card's panel background (below) and its content (above) via the isolated stacking context */
.card { position: relative; isolation: isolate; }
.card-wash { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; }
.card { position: relative; min-height: 180px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; padding: 34px 22px 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; transition: transform 0.2s ease, border-color 0.25s, box-shadow 0.25s; text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--gold) 40%, transparent); box-shadow: var(--shadow); }
.card-title { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.5vw, 31px); letter-spacing: 0.02em; line-height: 1.12; }
.card-meta { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.card .badge { position: absolute; top: 13px; left: 13px; }

/* paints text with the palette's proportional gradient; thin stroke keeps every letter legible */
.name-paint {
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 0.7px var(--name-stroke);
  background-repeat: no-repeat; background-size: 100% 100%;
}
.badge { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; font-weight: 700; }
.badge.dark   { background: color-mix(in srgb, var(--ember) 16%, transparent); color: var(--ember-text); }
.badge.light  { background: rgba(232, 215, 201, 0.16); color: var(--parchment); }
.badge.hybrid { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal-soft); }

.card.locked .card-title { opacity: 0.82; }
.card.locked::after { content: "🔒 Pro"; position: absolute; top: 12px; right: 12px; background: rgba(16, 10, 16, 0.85); backdrop-filter: blur(3px); color: var(--gold-soft); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.card.locked:hover { transform: translateY(-2px); }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 44px; align-items: start; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 26px; }
.back-link:hover { color: var(--gold-soft); }
.detail-strip { position: relative; height: 340px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.strip-bands { position: absolute; inset: 0; display: flex; }
.strip-bands span { display: block; transition: flex 0.35s ease; }
.detail-strip.sealed .strip-bands span { filter: blur(15px) saturate(0.85); }
.strip-tags { position: absolute; inset: 0; display: flex; z-index: 2; pointer-events: none; }
.pct-cell { display: flex; align-items: flex-end; padding: 13px; min-width: 0; }

/* centered, frameless treasure chest on Pro pages */
.chest-center {
  position: absolute; inset: 0; z-index: 3; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center;
}
.chest-center .chest { color: var(--gold); filter: drop-shadow(0 6px 18px rgba(0,0,0,0.55)); transition: transform 0.22s ease; }
.chest-center:hover .chest { transform: translateY(-4px); }
.chest-center .chest-txt { display: flex; flex-direction: column; gap: 4px; }
.chest-center .chest-txt b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #f4ede1; text-shadow: 0 2px 14px rgba(0,0,0,0.8), 0 0 2px rgba(0,0,0,0.7); }
.chest-center .chest-txt small { font-size: 12.5px; letter-spacing: 0.1em; color: #f4ede1; opacity: 0.9; text-shadow: 0 1px 10px rgba(0,0,0,0.8), 0 0 2px rgba(0,0,0,0.6); }

/* blurred (sealed) color swatches on Pro pages */
.color-row.locked .color-sw { filter: blur(4px) saturate(0.55); }
/* the % sits over arbitrary palette bands, so the chip is a fixed dark pill with
   fixed near-white ink — deterministically legible on ANY band/theme/skin. */
.detail-strip .pct-tag { font-size: 11px; font-weight: 700; color: #f5f2fb; background: rgba(6, 5, 12, 0.74); padding: 3px 9px; border-radius: 6px; backdrop-filter: blur(2px); letter-spacing: 0.04em; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.34); }
.detail-title { margin-top: 30px; }
.detail-meta { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.creature-note { font-family: var(--serif); font-style: italic; color: var(--gold-soft); font-size: 17px; margin-top: 16px; }
.bio-note { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin-top: 10px; max-width: 56ch; }

.colors { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.color-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; transition: border-color 0.2s; }
.color-row:hover { border-color: var(--line); }
.color-sw { width: 48px; height: 48px; border-radius: 11px; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.14); }
.color-info { flex: 1; min-width: 0; }
.color-hex { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.color-role { font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 2px 0 6px; }
.color-formats { display: flex; gap: 6px; flex-wrap: wrap; }
.fmt { font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); background: rgba(232, 215, 201, 0.03); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; cursor: pointer; transition: all 0.15s ease; }
.fmt:hover { color: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
/* brief in-place confirmation after a copy — teal ✓ state on the chip itself */
[data-copy].copied { color: var(--teal-soft) !important; border-color: color-mix(in srgb, var(--teal) 55%, transparent) !important; }
[data-copy].copied::after { content: " ✓"; }
.color-pct { font-size: 13px; color: var(--gold-soft); font-weight: 700; width: 42px; text-align: right; }

.panel { position: relative; background: linear-gradient(180deg, var(--panel), var(--deep)); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px 28px; margin-bottom: 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 44px -30px rgba(0, 0, 0, 0.6); }
.panel h3 { font-family: var(--display); font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; font-weight: 600; }

.dna-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.dna-label { width: 92px; font-size: 12.5px; color: var(--muted); text-transform: capitalize; flex-shrink: 0; }
.dna-track { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.07); border-radius: 999px; overflow: hidden; }
.dna-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ember), var(--gold)); }
.dna-val { width: 34px; text-align: right; font-size: 12px; color: var(--muted); }

.cat-select { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.cat-groups, .cat-children { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-parent { font-weight: 600; }
/* the selected group's children sit UNDER the group tabs, set off by a faint hairline */
.cat-children { padding-top: 11px; border-top: 1px solid var(--line-soft); align-items: center; }
.cat-children:empty { display: none; }   /* nothing chosen yet → no hairline, no gap */
/* small "Choose" cue above the revealed children (its own line via full width) */
.cat-choose { width: 100%; margin: 0 0 1px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
/* "Other" free-text box — describe any element to apply the palette to */
.cat-other { width: 100%; max-width: 420px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text); font-family: inherit; font-size: 12.5px; }
.cat-other::placeholder { color: var(--muted); }
.cat-other:focus { outline: none; border-color: color-mix(in srgb, var(--teal) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 14%, transparent); }
.cat { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); font-size: 12.5px; color: var(--muted); transition: all 0.16s ease; }
.cat:hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); }
.cat:hover { color: var(--text); }
.cat.active { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.cat-ico { width: 15px; height: 15px; flex: none; opacity: 0.88; }              /* Atlantis line-symbol, inherits colour */
.cat-parent .cat-ico { width: 16px; height: 16px; opacity: 0.95; }

.mockup-stage { border: 1px dashed var(--line); border-radius: 14px; padding: 34px 22px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, 0.02); margin-bottom: 16px; }
.mockup-stage .big { font-size: 30px; margin-bottom: 10px; }
.prompt-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.6; background: var(--abyss); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; color: var(--muted); white-space: pre-wrap; max-height: 260px; overflow: auto; margin-bottom: 14px; }
.prompt-box .k { color: var(--teal-soft); }
.wm-toggle { display: inline-flex; margin: 0 0 14px; }
.wm-note-std { font-size: 11.5px; color: var(--muted); margin: 0 0 14px; }
.wm-note-std a { color: var(--gold-text); font-weight: 600; }
.upload-thumb { max-width: 100%; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); display: block; margin: 0 auto 12px; box-shadow: var(--elev-1); object-fit: contain; }
.row-actions, .export-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 40px; align-items: stretch; }
.price-pergen { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.price-note { margin-top: 6px; opacity: 0.8; }
@media (max-width: 1150px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { background: linear-gradient(180deg, var(--panel), var(--deep)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 21px; display: flex; flex-direction: column; }
.price-card.featured { border-color: color-mix(in srgb, var(--gold) 50%, transparent); box-shadow: 0 0 56px -26px color-mix(in srgb, var(--gold) 42%, transparent); position: relative; }
.price-tier { font-family: var(--display); font-size: 22px; letter-spacing: 0.06em; }
.price-amt { font-size: 40px; font-weight: 700; margin: 14px 0 2px; font-family: var(--sans); }
.price-amt small { font-size: 15px; color: var(--muted); font-weight: 400; }
.price-desc { color: var(--muted); font-size: 13px; min-height: 36px; }
.price-feats { list-style: none; margin: 24px 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.price-feats li { font-size: 13.5px; color: #ddd0c2; display: flex; gap: 10px; align-items: flex-start; }
.price-feats li::before { content: "›"; color: var(--gold); font-weight: 700; }
.price-feats li.off { color: var(--muted-2); }
.price-feats li.off::before { content: "×"; color: var(--muted-2); }
.price-feats li b { color: var(--gold-soft); }

/* ---------- About ---------- */
.prose { max-width: 740px; }
.prose p { color: #ddd0c2; margin-bottom: 18px; font-size: 16px; }
.prose .h2 { margin: 44px 0 16px; }
.prose .pull { font-family: var(--serif); font-style: italic; color: var(--gold-soft); font-size: 26px; line-height: 1.3; border-left: 2px solid color-mix(in srgb, var(--gold) 40%, transparent); padding-left: 22px; margin: 30px 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-soft); background: var(--chrome); margin-top: 60px; position: relative; z-index: 2; }
.footer-grid { max-width: var(--maxw); margin: 0 auto; padding: 60px clamp(20px, 4vw, 52px) 20px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.brand--footer { color: var(--gold-soft); margin-bottom: 16px; }
.footer-soul { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 17px; line-height: 1.5; }
.footer-col h4 { font-family: var(--display); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text); margin-bottom: 15px; font-weight: 600; }
.footer-col a { display: block; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--gold-soft); }
.footer-bottom { max-width: var(--maxw); margin: 0 auto; padding: 16px clamp(20px, 4vw, 52px) 9px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; color: var(--muted-2); font-size: 12px; letter-spacing: 0.04em; flex-wrap: wrap; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.switch input { accent-color: var(--gold); }
/* tiny maker's signature — quiet, serif italic, sits in the footer's empty right corner */
.made-by { font-family: var(--serif); font-style: italic; font-size: 11px; letter-spacing: 0.05em; color: var(--muted-2); opacity: 0.9; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--text); padding: 13px 24px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Lock banner ---------- */
.lock-banner { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, transparent), color-mix(in srgb, var(--ember) 8%, transparent)); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.lock-banner p { font-size: 14px; color: var(--text); }
.lock-banner b { color: var(--gold-soft); }

/* sealed-treasure unlock button (shown on Pro palettes) */
.chest-lock {
  display: inline-flex; align-items: center; gap: 13px;
  padding: 10px 20px 10px 14px; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); box-shadow: var(--glow-gold);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.chest-lock:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 16px 34px -18px rgba(0,0,0,0.55), var(--glow-gold); }
.chest-lock .chest { color: var(--gold); flex-shrink: 0; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)); }
.chest-txt { display: flex; flex-direction: column; line-height: 1.18; }
.chest-txt b { font-family: var(--display); font-size: 13.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.chest-txt small { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .nav-links { display: none; }
  .hero-ghost { display: none; }
}
@media (max-width: 540px) {
  .price-grid { grid-template-columns: 1fr; }
  .detail-strip { height: 230px; }
}

/* theme toggle button */
.theme-toggle { padding: 11px 13px; font-size: 14px; line-height: 1; }

/* ============================================================
   LIGHT MODE — "Soft Coral Shine" (the most inspiring relic of the
   Alabaster family): warm cream · blush · coral · gold · sky · teal.
   Dark (Ember) stays the default; the toggle persists the choice.
   ============================================================ */
:root[data-theme="light"] {
  /* "Aquamarine Frost" (light identity): pale frost surfaces, deep aqua accents */
  --abyss:      #cfe6e4;
  --bg:         #e4f4f2;          /* dominant 60% */
  --deep:       #f5fcfb;          /* frost near-white (accent 4%) */
  --panel:      #f5fcfb;
  --panel-2:    #a9dcdb;          /* neutral 20% */
  --line:       rgba(14, 80, 84, 0.14);
  --line-soft:  rgba(14, 80, 84, 0.06);
  --chrome:     rgba(244, 252, 251, 0.84);

  --parchment:  #0c2f33;          /* deep teal ink (text role) */
  --ember:      #2d8f96;          /* deep aqua (blends into the keystone) */
  --ember-deep: #1e6b72;
  --gold:       #b5841a;          /* gilt — brand anchor, legible on frost */
  --gold-soft:  #cc9620;
  --gold-bright:#e6c24a;
  --teal:       #1e8a94;          /* aqua accent (6%) — legible on frost */
  --teal-soft:  #2aa6b0;
  --blue:       #5fb8be;          /* secondary aqua (10%) */

  --text:       #0c2f33;          /* deep teal ink */
  --muted:      #4c6f72;
  --muted-2:    #84a7a8;
  --gold-ink:   #ffffff;          /* light-theme accents are mid-dark → white ink reads on their fills */
  --teal-ink:   #ffffff;
  --ember-ink:  #ffffff;
  /* light bg → accent text must stay DARK to read; lean it toward the ink */
  --gold-text:  color-mix(in srgb, var(--gold) 36%, var(--text));
  --teal-text:  color-mix(in srgb, var(--teal) 38%, var(--text));
  --ember-text: color-mix(in srgb, var(--ember) 40%, var(--text));

  --shadow:     0 26px 60px -26px rgba(14, 80, 84, 0.20);
  --glow-gold:  0 0 34px -12px rgba(181, 132, 26, 0.28);
  --glow-teal:  0 0 27px -12px rgba(30, 138, 148, 0.26);
  --name-stroke: rgba(14, 80, 84, 0.30);
}

/* light body inherits the token-based gradient from the base `body` rule (tracks Aquamarine Frost) */
:root[data-theme="light"] body::after { background: radial-gradient(135% 120% at 50% 0%, transparent 64%, rgba(14, 80, 84, 0.05) 100%); }
/* nav & footer now use var(--chrome) so they track the theme and any palette skin */

:root[data-theme="light"] .hero .h1 {
  /* deep, legible interleaved accent gradient (every stop mixed toward the dark --text) + crack */
  background-image: var(--crack), linear-gradient(115deg,
    color-mix(in srgb, var(--teal) 40%, var(--text)) 4%,
    color-mix(in srgb, var(--gold) 44%, var(--text)) 32%,
    color-mix(in srgb, var(--ember) 40%, var(--text)) 62%,
    color-mix(in srgb, var(--teal) 44%, var(--text)) 88%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
:root[data-theme="light"] .hero-soul em { color: var(--gold); }

:root[data-theme="light"] .btn-gold { background: linear-gradient(135deg, #e8b24a, #b1801a); color: #241a06; }

:root[data-theme="light"] .dna-track { background: rgba(27, 36, 51, 0.10); }
/* light-theme cream code-block — only on the BASE light theme; a palette skin
   sets its own --abyss/--text, so don't force a light box over a dark skin. */
:root[data-theme="light"]:not(.palette-skin) .prompt-box { color: #5a4636; background: #fbf2e6; }
:root[data-theme="light"]:not(.palette-skin) .prompt-box .k { color: var(--teal); }
:root[data-theme="light"] .price-feats li { color: #4a3829; }
:root[data-theme="light"] .lock-banner p { color: #4a3829; }
:root[data-theme="light"] .prose p { color: #4a3829; }
:root[data-theme="light"] .card.locked::after { background: rgba(255, 255, 255, 0.92); color: var(--gold); border-color: rgba(154, 106, 12, 0.4); }
:root[data-theme="light"] ::selection { background: rgba(238, 90, 31, 0.22); color: #2c1d12; }

/* ============================================================
   Interactive paint-box hero + per-palette page skin
   ============================================================ */
.paintbox {
  position: absolute; inset: 0; z-index: 0; display: grid; gap: 0; padding: 0;
  /* an OPAQUE, RECESSED drawer of colour chips — packed edge-to-edge (no gaps, no band above/below), nothing behind bleeds through */
  background: linear-gradient(180deg, color-mix(in srgb, var(--abyss) 88%, #000), color-mix(in srgb, var(--bg) 78%, #000));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.05), inset 0 0 0 1px rgba(0,0,0,0.45),
              inset 0 13px 30px rgba(0,0,0,0.55), inset 0 -9px 22px rgba(0,0,0,0.42);   /* deep drawer recess */
}
.ptile {
  position: relative; border-radius: 2px; opacity: 1; transform: scale(1);
  /* a raised, glossy colour chip packed wall-to-wall — the beveled rim defines each one WITHOUT a gap */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), inset 0 -2px 4px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(0,0,0,0.16), 0 1px 2px rgba(0,0,0,0.30);
  transition: background-color 0.5s ease, transform 0.16s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s ease, filter 0.22s ease;
  cursor: pointer;
}
/* polished top-light sheen so each chip reads like cut enamel/gem (survives JS colour swaps) */
.ptile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.06) 38%, rgba(0,0,0,0.10) 64%, rgba(0,0,0,0.22) 100%);
}
/* identity crackle — fissures fade in ONLY while a tile is surfaced under the cursor (.cracked) */
.ptile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.22s ease;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><g fill='none' stroke-linecap='round'><g stroke='%23000' stroke-opacity='0.55' stroke-width='1.3'><path d='M50 -4 L46 18 L59 34 L44 52 L54 71 L41 104'/><path d='M46 18 L24 25'/><path d='M59 34 L84 29'/><path d='M44 52 L19 59'/><path d='M44 52 L73 63'/><path d='M54 71 L81 76'/><path d='M54 71 L30 84'/><path d='M-4 42 L19 59'/><path d='M104 50 L73 63'/></g><g stroke='%23fff' stroke-opacity='0.30' stroke-width='0.6' transform='translate(1,1)'><path d='M50 -4 L46 18 L59 34 L44 52 L54 71 L41 104'/><path d='M59 34 L84 29'/><path d='M44 52 L73 63'/><path d='M54 71 L30 84'/></g></g></svg>");
  background-size: 100% 100%;
}
.ptile.cracked::before { opacity: 1; }

/* skin-change "surfacing" sweep — a brief tinted light-streak so a palette change is FELT on any tone */
.skin-sweep {
  position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 28%, var(--sweep, #fff) 50%, transparent 72%);
  filter: blur(34px); will-change: transform, opacity;   /* a soft, minimal colour haze — never a hard streak */
}
.skin-sweep.go { animation: skinSweep 1200ms ease-in-out; }
@keyframes skinSweep {
  0%   { opacity: 0; transform: translateX(-45%); }
  45%  { opacity: 0.15; }
  55%  { opacity: 0.15; }
  100% { opacity: 0; transform: translateX(45%); }
}
@media (prefers-reduced-motion: reduce) { .skin-sweep { display: none; } }

.paint-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  /* bright box stays lit on the right; a firmer (not blurred) veil sits behind the
     headline column on the LEFT so the left-aligned text always reads */
  background: linear-gradient(100deg, color-mix(in srgb, var(--scrim-ink, var(--bg)) 70%, transparent) 0%, color-mix(in srgb, var(--scrim-ink, var(--bg)) 48%, transparent) 16%, color-mix(in srgb, var(--scrim-ink, var(--bg)) 20%, transparent) 34%, transparent 52%),
              linear-gradient(0deg, color-mix(in srgb, var(--scrim-ink, var(--bg)) 34%, transparent) 0%, transparent 16%);
}
/* left-anchor the hero text at the page gutter — the flex column + .wrap's margin:0 auto
   were centring it; justify-content on .hero still centres it vertically */
.hero .hero-inner { position: relative; z-index: 2; width: 100%; margin: 0; }
.hint { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }

/* the page SLOWLY + visibly "wears" a palette — a calm reveal you can follow.
   A touch slower than a glance so the colour change is always something you notice. */
html { transition: background-color 1.5s ease; }
.palette-skin body { transition: background 1.5s ease; }
.nav { transition: background-color 1.5s ease, border-color 1.5s ease; }
/* On a DELIBERATE change — the 15s skin cycle, or a dark/light switch — we briefly arm a
   page-wide colour crossfade so the WHOLE page (not just the chrome) is felt easing across,
   then it's removed so hover/interaction transitions stay snappy. */
html.theme-anim, html.theme-anim * {
  transition: background-color 1.6s ease-in-out, color 1.6s ease-in-out, border-color 1.6s ease-in-out, fill 1.6s ease-in-out !important;
}
@media (prefers-reduced-motion: reduce) {
  html, .palette-skin body, .nav,
  html.theme-anim, html.theme-anim * { transition: none !important; }
}

/* ============================================================
   ATLANTIS · v2 — REFINEMENT LAYER
   Deeper frames, glassy data surfaces, caustic ambient light,
   and a richer interior. Tinted with color-mix() so every frame
   tracks the active theme AND any per-palette page skin.
   ============================================================ */
:root {
  --ring:        color-mix(in srgb, var(--gold) 42%, transparent);
  --ring-2:      color-mix(in srgb, var(--teal) 30%, transparent);
  --glass:       color-mix(in srgb, var(--panel) 87%, transparent);
  --glass-2:     color-mix(in srgb, var(--panel-2) 80%, transparent);
  --sheen:       rgba(255, 255, 255, 0.05);
  --halo-gold:   color-mix(in srgb, var(--gold) 23%, transparent);
  --halo-teal:   color-mix(in srgb, var(--teal) 20%, transparent);
  --frame-shadow: 0 26px 60px -34px rgba(0, 0, 0, 0.85), 0 4px 18px -12px rgba(0, 0, 0, 0.55);
}
:root[data-theme="light"] { --sheen: rgba(255, 255, 255, 0.45); --frame-shadow: 0 24px 54px -32px rgba(19, 52, 58, 0.3), 0 3px 14px -10px rgba(19, 52, 58, 0.18); }

/* ---- gradient-ring frame helper (used by all data/option surfaces) ---- */
.panel, .card, .step, .price-card, .color-row, .mockup-stage, .search, .prompt-box, .detail-strip, .lock-banner, .chest-lock {
  border-color: transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* ---------- Ambient ocean light (caustics + fine grain) ---------- */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 38% at 22% 18%, var(--halo-teal), transparent 70%),
    radial-gradient(46% 40% at 82% 14%, var(--halo-gold), transparent 72%),
    radial-gradient(60% 50% at 50% 112%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%),
    conic-gradient(from 200deg at 50% -10%, transparent, color-mix(in srgb, var(--gold) 10%, transparent), transparent 28%);
  filter: blur(6px) saturate(1.05);
  opacity: 0.85;
  animation: causticDrift 24s ease-in-out infinite alternate;
}
@keyframes causticDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(1.6%, -1.4%, 0) scale(1.05); }
  100% { transform: translate3d(-1.4%, 1.2%, 0) scale(1.02); }
}

/* ---------- Nav & footer — clearer glass, gold hairline ---------- */
.nav { box-shadow: 0 1px 0 var(--sheen) inset, 0 14px 40px -30px rgba(0, 0, 0, 0.9); border-bottom-color: transparent; position: sticky; }
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ring) 22%, var(--ring-2) 60%, transparent); opacity: 0.7; }
/* HOME hero: a clean OPAQUE nav — the paint-box & pattern never show through it — but flush (no heavy
   drop-shadow, so it doesn't "float"), separated only by a fine hairline. */
.nav.nav--hero {
  background: var(--bg);
  backdrop-filter: none;
  box-shadow: none; border-bottom-color: transparent;
}
.nav.nav--hero::after { opacity: 0.5; }
.footer { border-top-color: transparent; }
/* on a skinned page, give the footer its OWN opaque ground so the dot pattern never bleeds through —
   a clean, separated band (the page sinks into a deeper tone at the very bottom). */
.palette-skin .footer { background: var(--abyss); }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ring) 28%, var(--ring-2) 64%, transparent); opacity: 0.7; }

/* ---------- Buttons — softer, layered ---------- */
.btn { position: relative; isolation: isolate; }
.btn-gold, .btn-teal, .btn-ember { box-shadow: var(--glow-gold), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-teal { box-shadow: var(--glow-teal), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-gold::after, .btn-teal::after, .btn-ember::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent 46%); opacity: 0.6;
}
.btn-ghost { backdrop-filter: blur(5px); background: color-mix(in srgb, var(--panel) 50%, transparent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); box-shadow: var(--glow-gold); }

/* ============================================================
   FRAMES — the surfaces behind every option & every datum
   ============================================================ */
.panel, .step, .price-card {
  background:
    linear-gradient(180deg, var(--glass), var(--deep)) padding-box,
    linear-gradient(150deg, var(--ring) 0%, var(--ring-2) 34%, transparent 66%) border-box;
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: var(--frame-shadow), inset 0 1px 0 var(--sheen);
  backdrop-filter: blur(8px);
  position: relative; overflow: hidden;
}
/* top sheen sweep on every frame */
.panel::before, .step::before, .price-card::before, .card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 38%;
  background: linear-gradient(180deg, var(--sheen), transparent);
  opacity: 0.5; pointer-events: none;
}
.step:hover, .price-card:hover { transform: translateY(-5px); border-color: transparent; box-shadow: var(--frame-shadow), 0 0 36px -16px var(--halo-gold), inset 0 1px 0 var(--sheen); }

.step .n { font-family: var(--display); background: linear-gradient(180deg, var(--gold-soft), var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.step { padding: 34px 30px; }

/* ---------- Cards (palette tiles) ---------- */
.card {
  background:
    linear-gradient(180deg, var(--glass), var(--deep)) padding-box,
    linear-gradient(150deg, var(--ring) 0%, transparent 55%) border-box;
  border: 1px solid transparent;
  box-shadow: 0 18px 40px -30px rgba(0,0,0,0.8), inset 0 1px 0 var(--sheen);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, var(--halo-gold), transparent 60%);
  opacity: 0; transition: opacity 0.3s ease;
}
.card:hover { transform: translateY(-6px); border-color: transparent;
  box-shadow: 0 30px 60px -28px rgba(0,0,0,0.85), 0 0 40px -18px var(--halo-gold), inset 0 1px 0 var(--sheen); }
.card:hover::after { opacity: 0.5; }
.card-title { position: relative; z-index: 1; }
.card-meta { position: relative; z-index: 1; opacity: 0.9; }

/* ---------- Badges — glassier ---------- */
.badge { backdrop-filter: blur(3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }

/* ============================================================
   TOOLBAR · SEARCH · CHIPS — option frames
   ============================================================ */
.search {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px solid transparent;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--panel) 80%, transparent)) padding-box,
    linear-gradient(120deg, var(--ring-2), transparent 60%) border-box;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 var(--sheen);
  transition: box-shadow 0.25s ease;
}
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent), inset 0 1px 0 var(--sheen); }
.chip { backdrop-filter: blur(5px); transition: all 0.18s cubic-bezier(.2,.8,.2,1); }
.chip:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--gold) 35%, transparent); color: var(--text); }
.chip.active { box-shadow: 0 0 22px -10px var(--halo-teal); }
.chip.gold.active { box-shadow: 0 0 22px -10px var(--halo-gold); }

/* ============================================================
   PRICING — featured glow, clearer hierarchy
   ============================================================ */
.price-card.featured { box-shadow: var(--frame-shadow), 0 0 64px -30px var(--halo-gold), inset 0 1px 0 var(--sheen); }
.price-card.featured { background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 8%, var(--glass)), var(--deep)) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--gold) 60%, transparent), var(--ring-2) 50%, transparent 80%) border-box; }
.price-amt { background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--gold) 50%, var(--text))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================================
   INTERIOR — palette detail page
   ============================================================ */
/* the colour strip — framed, glossy, deeper */
.detail-strip {
  border: 1px solid transparent;
  border-radius: 22px;
  box-shadow: var(--frame-shadow), inset 0 0 0 1px var(--sheen);
  background:
    linear-gradient(150deg, var(--ring), var(--ring-2) 50%, transparent 80%) border-box;
}
.detail-strip::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -40px 60px -40px rgba(0,0,0,0.55);
}
.strip-bands span { position: relative; }

/* colour rows — each datum gets a real frame + ring-lit swatch */
.colors { gap: 11px; }
.color-row {
  background:
    linear-gradient(180deg, var(--glass), var(--deep)) padding-box,
    linear-gradient(120deg, var(--ring), transparent 60%) border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 var(--sheen), 0 10px 26px -24px rgba(0,0,0,0.7);
  transition: transform 0.18s ease, box-shadow 0.25s ease;
}
.color-row:hover { transform: translateX(3px); box-shadow: inset 0 1px 0 var(--sheen), 0 12px 30px -20px rgba(0,0,0,0.7), -4px 0 0 -1px var(--halo-gold); }
.color-sw { width: 52px; height: 52px; border-radius: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 6px 16px -8px rgba(0,0,0,0.6); position: relative; }
.color-hex { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.fmt { backdrop-filter: blur(3px); }
.color-pct { font-variant-numeric: tabular-nums; }

/* DNA / genome bars — engraved track, luminous fill */
.dna-row { margin-bottom: 13px; }
.dna-track { height: 9px; background: color-mix(in srgb, var(--text) 9%, transparent); box-shadow: inset 0 1px 2px rgba(0,0,0,0.35); }
.dna-fill { position: relative; box-shadow: 0 0 14px -3px var(--halo-gold); }
.dna-fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,0.45), transparent 60%); }
.dna-val { font-variant-numeric: tabular-nums; }

/* Discover panel — option chips + stage */
.cat { backdrop-filter: blur(5px); transition: all 0.18s cubic-bezier(.2,.8,.2,1); }
.cat:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(0,0,0,0.6); }
.cat.active { box-shadow: 0 0 22px -10px var(--halo-teal); }
.mockup-stage {
  border: 1px dashed color-mix(in srgb, var(--text) 18%, transparent);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--teal) 8%, transparent), transparent 60%),
    color-mix(in srgb, var(--panel) 40%, transparent);
  border-radius: 16px;
}
.mockup-stage .big { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4)); }
.prompt-box {
  border: 1px solid transparent;
  background:
    linear-gradient(0deg, var(--abyss), var(--abyss)) padding-box,
    linear-gradient(120deg, var(--ring-2), transparent 55%) border-box;
  box-shadow: inset 0 2px 14px -8px rgba(0,0,0,0.8);
  border-radius: 13px;
}
.prompt-box::-webkit-scrollbar { width: 8px; }
.prompt-box::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 99px; }

/* panel section heads — gold tick + clearer rule */
.panel h3 { position: relative; }
.panel h3::before { content: ""; position: absolute; left: -26px; top: 1px; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(180deg, var(--gold-soft), var(--teal)); box-shadow: 0 0 10px -2px var(--halo-gold); }
.panel { padding-left: 30px; padding-right: 30px; }

/* detail meta + creature note polish */
.detail-meta .badge { font-size: 9.5px; }
.creature-note { position: relative; padding-left: 16px; }
.creature-note::before { content: "❝"; position: absolute; left: -2px; top: -6px; color: color-mix(in srgb, var(--gold) 60%, transparent); font-size: 20px; font-family: var(--serif); }

/* back link — pill */
.back-link { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 60%, transparent); backdrop-filter: blur(5px); transition: all 0.2s ease; }
.back-link:hover { transform: translateX(-2px); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }

/* ---------- Eyebrow / ornament polish ---------- */
.eyebrow { color: var(--gold); }
.h2 { background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 70%, var(--gold))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- Lock / chest accents ---------- */
.lock-banner { background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, transparent), color-mix(in srgb, var(--ember) 9%, transparent)) padding-box,
    linear-gradient(120deg, var(--ring), transparent 60%) border-box;
  border: 1px solid transparent; box-shadow: inset 0 1px 0 var(--sheen); }

/* ---------- Toast ---------- */
.toast { backdrop-filter: blur(8px); background: color-mix(in srgb, var(--panel-2) 94%, transparent); }

/* ============================================================
   Motion / accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* tighten interior layout on wide screens */
@media (min-width: 1100px) { .detail { gap: 52px; } }

/* ============================================================
   CUSTOM TYPOGRAPHY — geometric ATLANTEAN wordmark
   Geometric caps (Jost) + a subtle "fissured stone" crack
   overlay carved into the letters via background-clip:text.
   ============================================================ */
:root {
  --display-geo: "Jost", "Outfit", system-ui, sans-serif;
  --crack: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23000000' stroke-opacity='0.52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40 -5 L52 28 L44 52 L62 84 L54 124'/%3E%3Cpath d='M52 28 L74 34'/%3E%3Cpath d='M120 -5 L132 30 L120 54 L138 82 L128 124'/%3E%3Cpath d='M132 30 L110 36'/%3E%3Cpath d='M210 -5 L222 26 L208 48 L226 70 L214 124'/%3E%3Cpath d='M222 26 L246 32'/%3E%3Cpath d='M300 -5 L290 30 L308 54 L296 86 L312 124'/%3E%3Cpath d='M308 54 L332 58'/%3E%3Cpath d='M380 -5 L392 28 L380 50 L398 80 L388 124'/%3E%3Cpath d='M392 28 L370 34'/%3E%3Cpath d='M470 -5 L460 32 L478 56 L466 88 L480 124'/%3E%3Cpath d='M478 56 L502 60'/%3E%3Cpath d='M545 -5 L558 30 L548 54 L566 86 L556 124'/%3E%3Cpath d='M558 30 L582 36'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-theme="light"] {
  --crack: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40 -5 L52 28 L44 52 L62 84 L54 124'/%3E%3Cpath d='M52 28 L74 34'/%3E%3Cpath d='M120 -5 L132 30 L120 54 L138 82 L128 124'/%3E%3Cpath d='M132 30 L110 36'/%3E%3Cpath d='M210 -5 L222 26 L208 48 L226 70 L214 124'/%3E%3Cpath d='M222 26 L246 32'/%3E%3Cpath d='M300 -5 L290 30 L308 54 L296 86 L312 124'/%3E%3Cpath d='M308 54 L332 58'/%3E%3Cpath d='M380 -5 L392 28 L380 50 L398 80 L388 124'/%3E%3Cpath d='M392 28 L370 34'/%3E%3Cpath d='M470 -5 L460 32 L478 56 L466 88 L480 124'/%3E%3Cpath d='M478 56 L502 60'/%3E%3Cpath d='M545 -5 L558 30 L548 54 L566 86 L556 124'/%3E%3Cpath d='M558 30 L582 36'/%3E%3C/g%3E%3C/svg%3E");
}

.brand-name {
  font-family: var(--display-orn);   /* carved Roman caps — distinct from the body Cinzel */
  font-weight: 700;
  letter-spacing: 0.26em;
  text-indent: 0.26em;            /* re-centre the tracked caps */
  background-image: var(--crack), linear-gradient(110deg, var(--text), color-mix(in srgb, var(--gold) 62%, var(--text)));
  background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.brand--footer .brand-name { background-image: var(--crack), linear-gradient(110deg, var(--gold-soft), color-mix(in srgb, var(--gold) 70%, var(--text))); }
/* nav wordmark: each letter filled with the max-contrast ink (var(--text) — light
   on the dark theme, dark on the light theme, so it can never vanish), the theme
   accents scattered as a crisp 0-blur edge around the letters (no glow). */
/* nav wordmark: a cracked, INTERLEAVED gradient of the theme accents — but every
   stop is mixed toward var(--text), the legible ink (light on the dark theme, dark
   on the light theme), so the letters are gradient + cracked yet always legible.
   On a skinned page applyPaletteSkin overrides this inline with the palette gradient. */
.nav .brand-name {
  font-weight: 900;                /* bolder / more prominent next to the logo */
  /* surfaced-tile treatment: livelier accent mix + a soft radiance in the theme accents */
  text-shadow: 0 0 14px var(--halo-gold), 0 0 28px var(--halo-teal);
  background-image: var(--crack), linear-gradient(100deg,
    color-mix(in srgb, var(--teal) 64%, var(--text)) 4%,
    color-mix(in srgb, var(--gold) 68%, var(--text)) 30%,
    color-mix(in srgb, var(--ember) 64%, var(--text)) 56%,
    color-mix(in srgb, var(--teal) 66%, var(--text)) 80%,
    color-mix(in srgb, var(--gold) 70%, var(--text)) 100%);
}

.hero .h1 {
  font-family: var(--display-orn);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  width: fit-content;   /* the gradient maps to the LETTERS, not the full column — every colour lands on the word */
  /* surfaced-tile treatment: cracked interleaved accent gradient (livelier mix) + soft radiance —
     every stop still mixed toward --text so it stays legible */
  background-image: var(--crack), linear-gradient(115deg,
    color-mix(in srgb, var(--teal) 62%, var(--text)) 4%,
    color-mix(in srgb, var(--gold) 66%, var(--text)) 32%,
    color-mix(in srgb, var(--ember) 62%, var(--text)) 62%,
    color-mix(in srgb, var(--teal) 66%, var(--text)) 88%);
  background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px var(--halo-gold), 0 0 54px var(--halo-teal);
}
/* the giant ghost word behind the hero also goes geometric */
.hero-ghost { font-family: var(--display-geo), var(--display); }

/* ============================================================
   FLOW — compact, reshaped "how it works" rail
   ============================================================ */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.flow-step {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; position: relative;
  border-radius: 14px; border: 1px solid transparent;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 62%, transparent), color-mix(in srgb, var(--panel) 62%, transparent)) padding-box,
    linear-gradient(120deg, var(--ring), transparent 62%) border-box;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 var(--sheen);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.flow-step:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--sheen), 0 14px 30px -22px rgba(0,0,0,0.7); }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; right: -11px; top: 50%; width: 12px; height: 1px;
  background: linear-gradient(90deg, var(--ring), transparent); z-index: 1;
}
.flow-n {
  flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.06em; color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 72%);
  box-shadow: 0 0 18px -8px var(--halo-gold), inset 0 0 0 1px var(--sheen);
}
.flow-txt h3 { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.03em; margin: 0 0 3px; color: var(--text); }
.flow-txt p { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 0; }
@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr; }
  .flow-step:not(:last-child)::after { display: none; }
}

/* ============================================================
   ATLANTIS · v3 — PREMIUM PASS
   A unified design language: one type scale, one spacing rhythm,
   one elevation/motion system, and Atlantean brand details.
   All additive overrides (appended last). color-mix() keeps every
   surface tracking theme + per-palette skin. No structure, route,
   logic, class-name or skin-var changes.
   ============================================================ */

/* ---- 1 · Design tokens (additive; none are SKIN_VARS) ---- */
:root {
  --lh-display: 1.04;
  --lh-tight:   1.12;
  --lh-body:    1.62;
  --ls-display: 0.012em;
  --ls-eyebrow: 0.4em;
  --ls-serif:   -0.005em;
  --h3-size:    clamp(19px, 2.1vw, 26px);
  --deck:       "Cormorant Garamond", Georgia, serif;

  --sp-1: 6px;  --sp-2: 10px; --sp-3: 16px; --sp-4: 24px;
  --sp-5: 36px; --sp-6: 56px; --sp-7: clamp(72px, 9vw, 116px);

  --rule: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 38%, transparent) 30%, color-mix(in srgb, var(--teal) 28%, transparent) 70%, transparent);

  --ease-out:  cubic-bezier(.2, .8, .2, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --dur-1: .16s; --dur-2: .28s; --dur-3: .5s; --reveal-dur: .72s;
  --lift: -4px; --lift-sm: -3px;

  --elev-1: 0 2px 6px -4px rgba(0,0,0,.5), 0 10px 24px -18px rgba(0,0,0,.7);
  --elev-2: var(--frame-shadow);
  --elev-3: 0 34px 66px -28px rgba(0,0,0,.82), 0 8px 24px -14px rgba(0,0,0,.6);

  --ring-strong: linear-gradient(150deg, var(--ring) 0%, var(--ring-2) 38%, transparent 70%);
  --ring-quiet:  linear-gradient(150deg, color-mix(in srgb, var(--gold) 18%, transparent) 0%, transparent 60%);
  --bevel: inset 0 1px 0 var(--sheen), inset 0 0 0 1px color-mix(in srgb, var(--text) 4%, transparent);
  --keystone: linear-gradient(135deg, var(--gold-soft), var(--ember));
  --apex:       color-mix(in srgb, var(--teal) 42%, transparent);
  --apex-halo:  color-mix(in srgb, var(--teal) 19%, transparent);
  --plate-ink:  color-mix(in srgb, var(--muted) 80%, var(--text));
  --quote-gold: color-mix(in srgb, var(--gold-soft) 78%, var(--text));
}
:root[data-theme="light"] {
  --elev-1: 0 2px 6px -4px rgba(19,52,58,.16), 0 10px 24px -18px rgba(19,52,58,.22);
  --elev-3: 0 32px 60px -28px rgba(19,52,58,.28), 0 8px 22px -14px rgba(19,52,58,.20);
}

/* ---- 2 · Typography — deliberate hierarchy & rhythm ---- */
.h2 { line-height: var(--lh-display); letter-spacing: var(--ls-display); font-weight: 600; text-wrap: balance; margin-bottom: var(--sp-5); }
.detail-title .h2 { margin-bottom: 0; }
.eyebrow { font-size: 11.5px; letter-spacing: var(--ls-eyebrow); margin-bottom: var(--sp-3); opacity: 0.92; }
.lead { font-family: var(--deck); font-style: italic; font-size: clamp(18px, 1.9vw, 23px); line-height: 1.4; letter-spacing: var(--ls-serif); max-width: 50ch; color: color-mix(in srgb, var(--text) 78%, var(--muted)); }
.prose h3.h2 { font-size: var(--h3-size) !important; letter-spacing: 0.06em; line-height: var(--lh-tight); margin: var(--sp-6) 0 var(--sp-3); }
.prose p { line-height: var(--lh-body); letter-spacing: 0; max-width: 64ch; margin-bottom: var(--sp-3); }
.prose .pull { margin: var(--sp-5) 0; padding-left: var(--sp-4); }
.card-title { font-weight: 600; letter-spacing: 0.01em; line-height: var(--lh-tight); }
.step h3, .flow-txt h3 { letter-spacing: 0.05em; line-height: var(--lh-tight); }
.panel h3 { letter-spacing: 0.18em; }
.footer-col h4 { letter-spacing: 0.16em; }
.creature-note { font-size: 18.5px; line-height: 1.45; letter-spacing: var(--ls-serif); color: var(--quote-gold); max-width: 42ch; }
/* scope the global +0.004em sans tracking OFF the Cormorant italic voices */
.hero-soul, .pull, .creature-note, .footer-soul, .lead { letter-spacing: var(--ls-serif); }

/* ---- 3 · Editorial spacing & section rhythm ---- */
.section + .section { padding-top: 0; margin-top: var(--sp-7); position: relative; }
.section + .section::before {
  content: ""; position: absolute; left: clamp(20px, 4vw, 52px); right: clamp(20px, 4vw, 52px);
  top: calc(var(--sp-7) * -0.5); height: 1px; background: var(--rule); opacity: 0.6; pointer-events: none;
}
.steps, .grid { gap: var(--sp-4); }
.price-grid { gap: var(--sp-4); margin-top: var(--sp-5); }
.flow { gap: var(--sp-3); margin-top: var(--sp-5); }
.colors { gap: var(--sp-2); margin-top: var(--sp-6); }
.footer { margin-top: var(--sp-2); }
.footer-grid { padding-top: var(--sp-5); gap: clamp(28px, 4vw, 56px); }

/* ---- 4 · Unified elevation / depth system ---- */
.panel { box-shadow: var(--elev-2), var(--bevel); margin-bottom: var(--sp-4); }
.panel h3 {
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: none;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent), 0 2px 0 color-mix(in srgb, var(--gold) 10%, transparent);
}

.card {
  background:
    linear-gradient(180deg, var(--glass), var(--deep)) padding-box,
    var(--ring-strong) border-box;
  box-shadow: var(--elev-2), var(--bevel);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.card:hover { transform: translateY(var(--lift)) scale(1.006); box-shadow: var(--elev-3), 0 0 40px -18px var(--halo-gold), var(--bevel); }

.step, .price-card { transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
.step:hover, .price-card:hover { transform: translateY(var(--lift)); box-shadow: var(--elev-3), 0 0 36px -16px var(--halo-gold), var(--bevel); }

.color-row { box-shadow: var(--elev-1), var(--bevel); transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.color-row:hover { transform: translateX(4px); box-shadow: var(--elev-1), var(--bevel), -6px 0 0 -1px color-mix(in srgb, var(--gold) 55%, transparent); }
.color-sw { transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.color-row:hover .color-sw { transform: scale(1.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 8px 20px -8px rgba(0,0,0,.6); }

.flow-step {
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 62%, transparent), color-mix(in srgb, var(--panel) 62%, transparent)) padding-box,
    var(--ring-quiet) border-box;
  box-shadow: var(--elev-1), var(--bevel);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.flow-step:hover { transform: translateY(var(--lift-sm)); box-shadow: var(--elev-1), var(--bevel), 0 16px 32px -22px rgba(0,0,0,0.7); }
.search {
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--panel) 80%, transparent)) padding-box,
    var(--ring-quiet) border-box;
  box-shadow: var(--elev-1);
}

/* ---- 5 · Motion micro-interactions ---- */
.btn { transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-gold { overflow: hidden; }
.btn-gold::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.42) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s var(--ease-soft);
}
.btn-gold:hover::before { transform: translateX(120%); }
.fmt { transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.fmt:active { transform: scale(.94); }
.toast { transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-soft); }

/* ---- 6 · Atlantean brand details ---- */
.eyebrow::before {
  content: ""; width: 7px; height: 7px; font-size: 0; flex-shrink: 0; border-radius: 1px;
  transform: rotate(45deg); background: var(--keystone); box-shadow: 0 0 10px -2px var(--halo-gold);
}
.ornament::before, .ornament::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 55%, transparent)); }
.ornament span::before, .ornament span::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 12px; vertical-align: middle;
  transform: rotate(45deg); background: color-mix(in srgb, var(--gold) 70%, transparent);
}
.theme-toggle {
  font-size: 15px; line-height: 1; color: var(--gold-text); font-variant-emoji: text;
  transition: color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.theme-toggle:hover { color: var(--gold); transform: rotate(-8deg); }
.creature-note::before { font-size: 26px; top: -10px; opacity: 0.9; }
.detail-meta { font-variant-numeric: tabular-nums; }
.card-seal { font-variant-numeric: tabular-nums; letter-spacing: 0.16em; color: color-mix(in srgb, var(--gold) 55%, var(--muted)); }
.detail-strip.sealed::before {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(80% 120% at 50% 120%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%);
}

/* ---- 7 · Pricing & palette-showcase psychology ---- */
.price-amt { font-family: var(--display); font-size: clamp(34px, 3.5vw, 40px); font-weight: 600; letter-spacing: 0.005em; font-variant-numeric: tabular-nums lining-nums; line-height: 1; margin: 14px 0 2px; }
.price-amt small { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; color: var(--plate-ink); -webkit-text-fill-color: currentColor; }
.price-tier { font-size: 21px; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 88%, var(--gold)); }
.price-feats li::before {
  content: ""; width: 5px; height: 5px; margin-top: 8px; flex-shrink: 0; border-radius: 1px;
  transform: rotate(45deg); background: var(--keystone); box-shadow: 0 0 8px -2px var(--halo-gold);
}
.price-feats li.off { opacity: 0.72; }
.price-feats li.off::before { content: ""; width: 9px; height: 1px; margin-top: 10px; background: var(--muted-2); transform: none; box-shadow: none; border-radius: 0; }
.price-feats li b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.price-trust { text-align: center; margin-top: var(--sp-5); }

/* Studio (last tier) — a teal "summit" crown, subordinate to Pro's gold */
.price-card:not(.featured):last-child {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--teal) 5%, var(--glass)), var(--deep)) padding-box,
    linear-gradient(150deg, var(--apex), var(--ring) 55%, transparent 82%) border-box;
  box-shadow: var(--frame-shadow), 0 0 48px -34px var(--apex-halo), var(--bevel);
}
/* Pro (featured) — treasure-light pull, no badge */
.price-card.featured::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 50% -8%, var(--halo-gold), transparent 58%); opacity: 0.6;
}
.price-card.featured .price-tier { color: color-mix(in srgb, var(--gold) 70%, var(--text)); }

/* ---- 8 · Brand-mark glyph swaps (source-order: locked LAST) ---- */
.card.locked::after {
  content: "SEALED"; letter-spacing: 0.18em; font-size: 9px; padding: 5px 11px;
  background: color-mix(in srgb, var(--abyss) 80%, transparent); color: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 14%, transparent), 0 0 18px -10px var(--halo-gold);
}
:root[data-theme="light"] .card.locked::after { background: color-mix(in srgb, #fff 90%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.card.locked:hover { transform: translateY(-2px) scale(1); }

/* ---- 9 · Cinematic entrance reveal (CSS-only — robust, never stuck) ----
   Each route re-renders #app, so this "surfacing" animation replays on every
   view as a reveal. No IntersectionObserver: content can never be left hidden,
   and reduced-motion users are covered by the global animation-off media query. */
@keyframes surface {
  from { opacity: 0; transform: translateY(20px) scale(.994); }
  to   { opacity: 1; transform: none; }
}
.section { animation: surface var(--reveal-dur) var(--ease-soft) both; }
.section + .section { animation-delay: 0.06s; }
.hero { animation: surface 0.9s var(--ease-soft) both; }
/* don't fade-composite the giant ~1000-card archive grid as one layer (perf) */
.section:has(.grid > .card:nth-of-type(30)) { animation: none; }

/* ---- 10 · Post-review corrections ---- */
/* keep serif-italic emphasis crisp (Cormorant ships no 700 italic → faux-bold) */
.lead b, .lead strong, .hero-soul b, .creature-note b, .footer-soul b { font-weight: 600; }
/* truly centre the eyebrow on centered editorial stacks (inline-flex ignores text-align) */
.eyebrow.is-centered { display: flex; justify-content: center; }
/* guarantee gold-derived text stays legible on light/pastel palette-skinned detail pages */
html.palette-skin .panel h3 { color: color-mix(in srgb, var(--text) 82%, var(--gold)); }
html.palette-skin .color-pct { color: color-mix(in srgb, var(--text) 80%, var(--gold-soft)); }
html.palette-skin .creature-note { color: color-mix(in srgb, var(--text) 76%, var(--gold-soft)); }

/* ============================================================
   11 · Atlantean relic-brush cursor — SITE-WIDE
   Default = an ornate sunken-gold brush (carved handle, fluted
   ferrule, Atlantean diamond pommel, luminous teal bristle-tuft).
   Clickable elements get a "charged-tip" variant (glowing tip +
   gold spark) so it reads like a relic about to apply its colour.
   Hotspot sits on the bristle tip (3,3). Dark outline keeps it
   legible on any palette colour, light or dark theme.
   ============================================================ */
body {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%230a1f33' stroke-width='5.6'/%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%23cf971f' stroke-width='3.6'/%3E%3Cpath d='M11.5 11.5 L25.5 25.5' stroke='%23f7dc86' stroke-width='1.2' opacity='0.9'/%3E%3Cpath d='M27.6 24.4 L30.8 27.6 L27.6 30.8 L24.4 27.6 Z' fill='%23f3cf72' stroke='%230a1f33' stroke-width='0.9'/%3E%3Cpath d='M27.6 26.3 L28.9 27.6 L27.6 28.9 L26.3 27.6 Z' fill='%235fdcec'/%3E%3Cpath d='M8.4 12.6 L12.6 8.4' stroke='%230a1f33' stroke-width='5.2'/%3E%3Cpath d='M8.8 12.2 L12.2 8.8' stroke='%23f3cf72' stroke-width='3'/%3E%3Cpath d='M9.4 11.6 L11.6 9.4' stroke='%23b87d1a' stroke-width='0.7' opacity='0.7'/%3E%3Cpath d='M2.4 2.4 L9.6 5.2 L5.2 9.6 Z' fill='%234fc9d8' stroke='%230a1f33' stroke-width='0.8'/%3E%3Cpath d='M9 7 L2.6 3' stroke='%23d6f7ff' stroke-width='0.8'/%3E%3Cpath d='M8.4 8.4 L3 2.6' stroke='%23d6f7ff' stroke-width='0.8'/%3E%3Cpath d='M7 9 L3 5' stroke='%23a7e9f3' stroke-width='0.7'/%3E%3Ccircle cx='2.7' cy='2.7' r='1.15' fill='%23eafdff'/%3E%3C/g%3E%3C/svg%3E") 3 3,
    auto;
}
/* clickable surfaces → charged-tip variant (themed pointer) */
a, button, summary, [role="button"], .btn, .card, [data-open], .chip, .cat, .fmt,
[data-copy], [data-export], .switch, .switch input, .theme-toggle {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%230a1f33' stroke-width='5.6'/%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%23cf971f' stroke-width='3.6'/%3E%3Cpath d='M11.5 11.5 L25.5 25.5' stroke='%23f7dc86' stroke-width='1.2' opacity='0.9'/%3E%3Cpath d='M27.6 24.4 L30.8 27.6 L27.6 30.8 L24.4 27.6 Z' fill='%23f3cf72' stroke='%230a1f33' stroke-width='0.9'/%3E%3Cpath d='M27.6 26.3 L28.9 27.6 L27.6 28.9 L26.3 27.6 Z' fill='%235fdcec'/%3E%3Cpath d='M8.4 12.6 L12.6 8.4' stroke='%230a1f33' stroke-width='5.2'/%3E%3Cpath d='M8.8 12.2 L12.2 8.8' stroke='%23f3cf72' stroke-width='3'/%3E%3Ccircle cx='3' cy='3' r='3.4' fill='%235fdcec' opacity='0.35'/%3E%3Cpath d='M2.4 2.4 L9.6 5.2 L5.2 9.6 Z' fill='%2370e6f2' stroke='%230a1f33' stroke-width='0.8'/%3E%3Cpath d='M9 7 L2.6 3' stroke='%23ffffff' stroke-width='0.9'/%3E%3Cpath d='M8.4 8.4 L3 2.6' stroke='%23ffffff' stroke-width='0.9'/%3E%3Cpath d='M3 0.6 L3.5 2.5 L5.4 3 L3.5 3.5 L3 5.4 L2.5 3.5 L0.6 3 L2.5 2.5 Z' fill='%23ffe9a8'/%3E%3Ccircle cx='3' cy='3' r='1' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E") 3 3,
    pointer;
}
/* the paint-field tiles keep the plain brush (you are painting) — override base pointer */
.ptile {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%230a1f33' stroke-width='5.6'/%3E%3Cpath d='M10.5 10.5 L27.5 27.5' stroke='%23cf971f' stroke-width='3.6'/%3E%3Cpath d='M11.5 11.5 L25.5 25.5' stroke='%23f7dc86' stroke-width='1.2' opacity='0.9'/%3E%3Cpath d='M27.6 24.4 L30.8 27.6 L27.6 30.8 L24.4 27.6 Z' fill='%23f3cf72' stroke='%230a1f33' stroke-width='0.9'/%3E%3Cpath d='M27.6 26.3 L28.9 27.6 L27.6 28.9 L26.3 27.6 Z' fill='%235fdcec'/%3E%3Cpath d='M8.4 12.6 L12.6 8.4' stroke='%230a1f33' stroke-width='5.2'/%3E%3Cpath d='M8.8 12.2 L12.2 8.8' stroke='%23f3cf72' stroke-width='3'/%3E%3Cpath d='M9.4 11.6 L11.6 9.4' stroke='%23b87d1a' stroke-width='0.7' opacity='0.7'/%3E%3Cpath d='M2.4 2.4 L9.6 5.2 L5.2 9.6 Z' fill='%234fc9d8' stroke='%230a1f33' stroke-width='0.8'/%3E%3Cpath d='M9 7 L2.6 3' stroke='%23d6f7ff' stroke-width='0.8'/%3E%3Cpath d='M8.4 8.4 L3 2.6' stroke='%23d6f7ff' stroke-width='0.8'/%3E%3Cpath d='M7 9 L3 5' stroke='%23a7e9f3' stroke-width='0.7'/%3E%3Ccircle cx='2.7' cy='2.7' r='1.15' fill='%23eafdff'/%3E%3C/g%3E%3C/svg%3E") 3 3,
    pointer;
}
/* text entry stays native; disabled buttons stay blocked */
.search input, input[type="text"], input:not([type]), textarea, [contenteditable="true"] { cursor: text; }
.btn[disabled] { cursor: not-allowed; }

/* ============================================================
   12 · Treasure cards — real colour strip + free marker
   Each card previews its actual palette as one proportional
   hard-stop gradient strip; the 50 free treasures wear a teal
   "Free" seal so the division reads at a glance. Sealed cards
   keep their strip blurred, consistent with the rest of the paywall.
   ============================================================ */
.card { padding-bottom: 30px; }
.card-strip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12px; z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 -6px 14px -10px rgba(0,0,0,0.5);
  transition: height var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
/* a specular bloom that FOLLOWS the cursor across the strip (--mx is set live in bindExplore) */
.card-strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 2;
  background: radial-gradient(26px 70px at var(--mx, 50%) 50%, rgba(255,255,255,0.92), rgba(255,255,255,0.26) 42%, transparent 72%);
  transition: opacity var(--dur-2) var(--ease-out);   /* blend mode is added only on hover (below) to spare ~1000 idle cards the blend-group bookkeeping */
}
/* a one-shot light streak sweeps across as the cursor arrives — the "flash" (لمض) */
.card-strip::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -55%; width: 45%; pointer-events: none; z-index: 3; opacity: 0;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.55), transparent);
}
.card:hover .card-strip {                               /* the treasure band OPENS UP + brightens */
  height: 24px;
  filter: saturate(1.16) brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 -10px 22px -10px rgba(0,0,0,0.55), 0 0 22px -7px var(--halo-gold);
}
.card:hover .card-strip::after { opacity: 1; mix-blend-mode: screen; }
.card:hover .card-strip::before { animation: stripSweep 0.7s var(--ease-out); }
@keyframes stripSweep { 0% { opacity: 0; left: -55%; } 14% { opacity: 1; } 100% { opacity: 0; left: 112%; } }
/* sealed palettes stay hidden beneath the ocean — blur the strip like the detail page */
.card.locked .card-strip { filter: blur(4px) saturate(0.6) brightness(0.92); }
.card.locked:hover .card-strip { filter: blur(3px) saturate(0.7) brightness(0.98); height: 20px; }   /* a teasing peek */
@media (prefers-reduced-motion: reduce) { .card:hover .card-strip::before { animation: none; } }
.free-tag {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(3px);
  color: var(--teal-soft);
  background: color-mix(in srgb, var(--teal) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 42%, transparent);
  box-shadow: 0 0 16px -8px var(--halo-teal);
}
/* free-tag needs a deeper verdigris on the pale light-theme card to stay legible */
:root[data-theme="light"] .free-tag {
  color: #0d5249;
  background: color-mix(in srgb, var(--teal) 20%, #fff);
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
}

/* ============================================================
   13 · Treasure chest · Export tiles · cohesion glow
   ============================================================ */
/* --- the sealed chest: bigger, warmer, treasure-lit --- */
.chest-center .chest { width: 84px; height: auto; filter: drop-shadow(0 8px 22px rgba(0,0,0,0.55)); }
.chest-center:hover .chest { transform: translateY(-5px) scale(1.03); }
.chest-center .chest-txt b { letter-spacing: 0.2em; }

/* --- Export panel: format tiles instead of plain buttons --- */
.panel h3 .h3-note {
  font-family: var(--sans); font-size: 10px; font-weight: 400; letter-spacing: 0.06em;
  text-transform: none; color: var(--muted);
}
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
/* Export is a full-width band BELOW the two-column detail — centred & symmetric in the page middle */
.export-panel { margin-top: 26px; }
.export-panel > h3 { text-align: center; }
.export-panel .export-grid { max-width: 1080px; margin-inline: auto; }
.export-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 14px 14px 13px; border-radius: 13px; text-align: left; border: 1px solid transparent;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 70%, transparent), color-mix(in srgb, var(--panel) 70%, transparent)) padding-box,
    var(--ring-quiet) border-box;
  box-shadow: var(--bevel);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.export-tile:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--elev-1), var(--bevel), 0 0 24px -12px var(--halo-gold); }
.export-tile:active:not(:disabled) { transform: translateY(-1px) scale(.99); }
.export-tile:disabled { opacity: 0.5; }
.export-glyph { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; line-height: 1; letter-spacing: -0.04em; color: var(--gold-soft); }
.export-label { display: flex; flex-direction: column; line-height: 1.1; }
.export-label b { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.05em; color: var(--text); }
.export-label small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.export-copy { position: absolute; top: 11px; right: 12px; font-size: 13px; color: var(--muted-2); transition: color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.export-tile:hover:not(:disabled) .export-copy { color: var(--gold-soft); transform: translateY(-1px); }

/* --- cohesion: bathe the whole detail in the palette's own light so the
       strip, swatches and panels read as one immersive scene --- */
.detail { position: relative; }
.detail > div { position: relative; z-index: 1; }
.detail::before {
  content: ""; position: absolute; left: 0; right: 0; top: -10%; bottom: 0; z-index: 0;
  pointer-events: none; border-radius: 30px;
  background:
    radial-gradient(55% 50% at 25% 0%, var(--halo-gold), transparent 70%),
    radial-gradient(48% 48% at 96% 16%, var(--halo-teal), transparent 72%);
  opacity: 0.5; filter: blur(17px);
}

/* ============================================================
   14 · Living chest + Discover panel harmony
   The sealed chest breathes a soft treasure-light; the Discover
   selector + scrying stage adopt the same frame material as the
   export tiles so the whole interior reads as one set.
   ============================================================ */
@keyframes chestGlow {
  0%, 100% { filter: drop-shadow(0 8px 22px rgba(0,0,0,0.55)) drop-shadow(0 0 10px rgba(95,220,236,0.1)); }
  50%      { filter: drop-shadow(0 10px 26px rgba(0,0,0,0.6))  drop-shadow(0 0 18px rgba(95,220,236,0.26)); }
}
.chest-center .chest { animation: chestGlow 3.4s var(--ease-soft) infinite; }

/* Discover category selector — unified frame material, refined active state */
.cat {
  border: 1px solid transparent;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 65%, transparent), color-mix(in srgb, var(--panel) 65%, transparent)) padding-box,
    var(--ring-quiet) border-box;
  box-shadow: var(--bevel);
}
.cat:hover { box-shadow: var(--bevel), 0 8px 18px -12px rgba(0,0,0,0.6); }
.cat.active {
  color: var(--teal-soft);
  border-color: transparent;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--teal) 14%, var(--panel)), color-mix(in srgb, var(--teal) 14%, var(--panel))) padding-box,
    linear-gradient(120deg, var(--ring-2), var(--ring) 60%, transparent) border-box;
  box-shadow: var(--bevel), 0 0 22px -10px var(--halo-teal);
}

/* the mockup "scrying pool" — a deeper vision surface in the same family */
.mockup-stage {
  border: 1px dashed color-mix(in srgb, var(--teal) 26%, transparent);
  background:
    radial-gradient(130% 95% at 50% 0%, color-mix(in srgb, var(--teal) 11%, transparent), transparent 62%),
    color-mix(in srgb, var(--abyss) 44%, transparent);
  box-shadow: inset 0 0 34px -22px var(--halo-teal), var(--bevel);
}
.mockup-stage .big {
  background: linear-gradient(180deg, var(--teal-soft), var(--gold-soft));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.4));
}
/* prompt readout shares the export-tile rhythm */
.prompt-box { border-radius: 13px; }

/* ============================================================
   THE VAULTS — Explore category selector
   An editorial segmented rail: vault names in Cinzel small-caps,
   an accession seal (№000) per vault, and a moving gold keystone
   underline marking the active one. Chic, minimal, on-identity.
   ============================================================ */
.vaults-row { margin-top: -10px; margin-bottom: 26px; }
.vaults {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  border-bottom: 1px solid var(--line);
}
.vault-tab {
  appearance: none; background: none; border: 0; margin: 0;
  padding: 10px 20px 13px;
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
  color: var(--muted);
  transition: color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.vault-name {
  font-family: var(--display);
  font-weight: 600; font-size: 13px; letter-spacing: 0.13em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
}
.vault-acc {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px; letter-spacing: 0.14em; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--gold) 36%, var(--text));   /* legible in every theme/skin */
  transition: color var(--dur-1) var(--ease-out);
}
/* moving gold keystone underline — only the active tab reveals it */
.vault-tab::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px;
  height: 2px; border-radius: 2px;
  background: var(--keystone);
  box-shadow: 0 0 12px -3px var(--halo-gold);
  transform: scaleX(0); transform-origin: center; opacity: 0;
  transition: transform var(--dur-2) var(--ease-soft), opacity var(--dur-1) var(--ease-out);
}
.vault-tab:hover { color: var(--text); transform: translateY(-1px); }
.vault-tab:hover .vault-acc { color: color-mix(in srgb, var(--gold) 62%, var(--muted)); }

.vault-tab.active { color: var(--text); }
.vault-tab.active .vault-name { font-weight: 700; }
.vault-tab.active .vault-acc { color: var(--gold-soft); }
.vault-tab.active::after { transform: scaleX(1); opacity: 1; }

/* per-vault identity tint on the active accession + underline */
.vault-tab.vault-dark.active   .vault-acc { color: var(--ember-text); }
.vault-tab.vault-hybrid.active .vault-acc { color: var(--teal-soft); }
.vault-tab.vault-dark.active::after   { background: linear-gradient(135deg, var(--gold-soft), var(--ember)); }
.vault-tab.vault-hybrid.active::after { background: linear-gradient(135deg, var(--teal-soft), var(--teal)); box-shadow: 0 0 12px -3px var(--halo-teal); }

/* keyboard focus — a consistent visible ring EVERYWHERE (links, buttons, chips, cards, inputs) */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--teal) 75%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}
.card:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
/* the search pill signals focus on its own border — never a rectangle inside the field */
.search input:focus, .search input:focus-visible { outline: none; }
.search:focus-within { border-color: color-mix(in srgb, var(--teal) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 12%, transparent); }

/* keyboard focus — visible ring, not signalled by color alone */
.vault-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 70%, transparent);
  outline-offset: -3px; border-radius: var(--radius-sm); color: var(--text);
}

/* light theme — keep accession legible (parchment becomes dark ink there) */
:root[data-theme="light"] .vault-acc { color: color-mix(in srgb, var(--gold) 55%, var(--muted)); }
:root[data-theme="light"] .vault-tab.active .vault-acc { color: var(--gold); }
:root[data-theme="light"] .vault-tab.vault-light.active .vault-acc { color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
:root[data-theme="light"] .vault-tab.vault-dark.active .vault-acc { color: var(--gold); }
:root[data-theme="light"] .vault-tab.vault-hybrid.active .vault-acc { color: var(--teal); }

/* responsive — one clean row that scrolls horizontally on narrow screens */
@media (max-width: 560px) {
  .vaults { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .vaults::-webkit-scrollbar { display: none; }
  .vault-tab { padding: 9px 14px 11px; flex: 0 0 auto; }
  .vault-name { font-size: 12px; letter-spacing: 0.08em; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vault-tab, .vault-tab::after { transition: opacity var(--dur-1) ease; }
  .vault-tab:hover { transform: none; }
  .vault-tab.active::after { transform: scaleX(1); }
  .vault-tab:not(.active)::after { transform: scaleX(0); }
}

/* ============================================================
   ACCOUNTS — nav auth slot, user menu, auth modal,
   home flow redesign, favorite button, profile & admin
   (all reuse existing tokens → both themes + skin track free)
   ============================================================ */

/* ---- nav auth slot + user menu ---- */
.auth-slot { display: inline-flex; align-items: center; }
.user-menu { position: relative; }
.user-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px;
  border-radius: 999px; cursor: pointer; color: var(--text); border: 1px solid transparent;
  background: linear-gradient(0deg, var(--glass), var(--glass)) padding-box, var(--ring-quiet) border-box;
  box-shadow: var(--bevel); transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.user-pill:hover { transform: translateY(-1px); box-shadow: var(--bevel), 0 0 22px -12px var(--halo-gold); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  box-shadow: inset 0 0 0 1px var(--sheen), 0 0 14px -6px var(--halo-gold);
}
.user-name { font-size: 13px; font-weight: 600; letter-spacing: .03em; }
.user-caret { font-size: 10px; color: var(--muted); transition: transform var(--dur-2) var(--ease-out); }
.user-menu.open .user-caret { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 184px; z-index: 60;
  display: flex; flex-direction: column; padding: 6px; border-radius: 14px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--glass), var(--deep)) padding-box, var(--ring-strong) border-box;
  box-shadow: var(--elev-2), var(--bevel); backdrop-filter: blur(10px);
}
.user-dropdown[hidden] { display: none; }
.user-dropdown a, .user-dropdown button {
  text-align: left; padding: 10px 12px; border-radius: 9px; font-size: 13px; color: var(--text);
  background: none; border: 0; cursor: pointer; font-family: var(--sans);
}
.user-dropdown a:hover, .user-dropdown button:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold-soft); }

/* ---- auth modal (recovered artifact card) ---- */
body.modal-open { overflow: hidden; }
.auth-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--abyss) 72%, transparent); backdrop-filter: blur(7px) saturate(1.05);
  animation: fadeUp .25s var(--ease-out) both;
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  position: relative; width: min(440px, 100%); padding: 34px 34px 28px; text-align: center; border-radius: 22px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--glass), var(--deep)) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--gold) 60%, transparent), var(--ring-2) 50%, transparent 82%) border-box;
  box-shadow: var(--elev-3), 0 0 60px -30px var(--halo-gold), var(--bevel);
  animation: surface .5s var(--ease-soft) both; max-height: calc(100vh - 40px); overflow-y: auto;
}
.auth-emblem { display: grid; place-items: center; margin-bottom: 10px; }
.auth-emblem img { filter: drop-shadow(0 0 16px var(--halo-teal)); }
.eyebrow.is-centered { justify-content: center; text-align: center; }
.auth-title { margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 16px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.auth-field input {
  width: 100%; padding: 12px 14px; border-radius: 11px; color: var(--text); border: 1px solid transparent; outline: none;
  background: linear-gradient(0deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--panel) 80%, transparent)) padding-box, var(--ring-quiet) border-box;
  box-shadow: var(--bevel); font-family: var(--sans); font-size: 14px;
}
.auth-field input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent), var(--bevel); }
.auth-card[data-mode="signin"] .signup-only { display: none; }
.auth-card[data-mode="signup"] .signin-only { display: none; }
.auth-error { color: #ff9a76; font-size: 13px; }
.auth-error[hidden] { display: none; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-switch button { color: var(--gold-soft); font-weight: 600; text-decoration: underline; background: none; border: 0; cursor: pointer; font-family: var(--sans); }
.auth-close { position: absolute; top: 12px; right: 14px; font-size: 22px; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; }
.auth-close:hover { color: var(--gold-soft); }
:root[data-theme="light"] .auth-error,
:root[data-theme="light"] .admin-act .danger,
:root[data-theme="light"] .fav-x:hover { color: #b23b12; }

/* ---- home flow redesign (additive modifiers) ---- */
.flow-section { padding-top: clamp(36px, 5.5vw, 62px); padding-bottom: clamp(30px, 4.5vw, 50px); }   /* a little breathing room above & below the three steps */
/* bring the footer close to the last section's content (kills the big bottom void) */
#app > .section:last-child { padding-bottom: var(--sp-3); }
/* …but keep the three-steps' breathing room even when it's the last section (placed AFTER the rule
   above so it wins at equal specificity by source order) */
#app > .flow-section:last-child { padding-bottom: clamp(30px, 4.5vw, 50px); }
.flow-lead { margin-top: var(--sp-2); }
.flow--cards { grid-template-columns: repeat(3, 1fr); }
.flow--cards .flow-step { position: relative; flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 26px; min-height: 156px; }
.flow--cards .flow-step::after { display: none !important; }
.flow-glyph { position: absolute; top: 18px; right: 20px; font-size: 18px; color: color-mix(in srgb, var(--gold) 55%, var(--muted)); opacity: .85; }
@media (max-width: 760px) { .flow--cards { grid-template-columns: 1fr; } }

/* =========================================================================
   HOME FLOW — ENGRAVED RELIC PLATE
   Each step is a numbered accession tablet: gilt numeral disc, a cut-gem glyph
   chip, an engraved gold→teal hairline rule, and a crisp 1px inner edge-light
   that ignites on hover. An inline --leg accent walks teal→gold→ember across
   the three cards; --leg only ever feeds decorative borders/halos (never text
   ink), so legibility holds in dark, light AND any per-palette skin. No blur
   on any letter. Reuses .flow-step/.flow-n/.flow-txt/.flow-glyph.
   ========================================================================= */
.flow--relics .flow-step.relic-plate {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--sp-3);
  padding: 26px 24px 24px;
  min-height: 168px;
  border-radius: var(--radius, 14px);
  overflow: hidden;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel) 70%, transparent),
      color-mix(in srgb, var(--panel-2) 74%, transparent)) padding-box,
    linear-gradient(150deg,
      color-mix(in srgb, var(--leg, var(--gold)) 24%, transparent) 0%,
      transparent 58%) border-box;
  border: 1px solid transparent;
  box-shadow: var(--elev-1), var(--bevel);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
/* engraved corner-tick — a museum mount mark (crisp, tinted to --leg) */
.relic-plate::before {
  content: ""; position: absolute; top: 12px; left: 12px; width: 14px; height: 14px;
  border-top: 1px solid color-mix(in srgb, var(--leg, var(--gold)) 42%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--leg, var(--gold)) 42%, transparent);
  opacity: .8; pointer-events: none;
}
/* inner gilt edge-light — crisp 1px inset line, faint at rest, ignites on hover.
   High specificity + display:block !important so it beats both the
   `.flow--cards .flow-step::after { display:none !important }` connector-kill and
   the base `.flow-step:not(:last-child)::after` dash geometry. */
.flow--relics .flow-step.relic-plate::after {
  content: ""; position: absolute; inset: 0; width: auto; height: auto;
  border-radius: inherit; background: none; pointer-events: none;
  display: block !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--leg, var(--gold)) 16%, transparent);
  transition: box-shadow var(--dur-2) var(--ease-out);
}
.relic-plate .relic-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  position: relative; z-index: 1;
}
.relic-plate .flow-n {
  width: 42px; height: 42px; font-size: 13px;
  color: var(--gold-text);
  border: 1px solid color-mix(in srgb, var(--leg, var(--gold)) 40%, transparent);
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--leg, var(--gold)) 16%, transparent), transparent 72%);
  box-shadow: 0 0 18px -8px color-mix(in srgb, var(--leg, var(--gold)) 30%, transparent), inset 0 0 0 1px var(--sheen);
}
/* the glyph — promoted to a chamfered cut-gem chip ringed in the leg accent */
.relic-plate .flow-glyph {
  position: static; top: auto; right: auto;
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  font-size: 14px; line-height: 1; color: var(--gold-text); opacity: .92;
  border: 1px solid color-mix(in srgb, var(--leg, var(--gold)) 34%, transparent);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  background: radial-gradient(120% 120% at 30% 18%, color-mix(in srgb, var(--leg, var(--gold)) 14%, transparent), transparent 68%);
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.relic-plate .relic-rule {
  display: block; height: 1px; width: 100%; background: var(--rule); opacity: .7;
  transform-origin: left center; transition: opacity var(--dur-2) var(--ease-out);
}
.relic-plate .flow-txt { margin-top: auto; }
.relic-plate .flow-txt h3 {
  font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .05em;
  line-height: var(--lh-tight, 1.12); margin: 0 0 5px; color: var(--text);
}
.relic-plate .flow-txt p {
  font-family: var(--serif, "Cormorant Garamond", Georgia, serif); font-size: 14px; line-height: 1.5;
  letter-spacing: var(--ls-serif, -0.005em); margin: 0; color: var(--muted);
}
.flow--relics .flow-step.relic-plate:hover {
  transform: translateY(var(--lift-sm));
  border-color: color-mix(in srgb, var(--leg, var(--gold)) 30%, transparent);
  box-shadow: var(--elev-1), var(--bevel), 0 18px 34px -24px rgba(0,0,0,.7);
}
.flow--relics .flow-step.relic-plate:hover::after {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--leg, var(--gold)) 46%, transparent);
}
.relic-plate:hover .flow-glyph {
  border-color: color-mix(in srgb, var(--leg, var(--gold)) 52%, transparent); transform: translateY(-1px);
}
.relic-plate:hover .relic-rule { opacity: .95; }
@media (prefers-reduced-motion: reduce) {
  .flow--relics .flow-step.relic-plate, .relic-plate .flow-glyph, .relic-plate .relic-rule, .relic-plate::after { transition: none; }
  .flow--relics .flow-step.relic-plate:hover { transform: none; }
}
@media (max-width: 760px) {
  .flow--cards.flow--relics { grid-template-columns: 1fr; }
  .flow--relics .flow-step.relic-plate { min-height: 0; padding: 22px 22px 20px; }
}

/* ---- favorite button ---- */
.detail-actions { margin-top: 18px; }
.fav-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid transparent;
  background: linear-gradient(0deg, var(--glass), var(--glass)) padding-box, var(--ring-quiet) border-box;
  box-shadow: var(--bevel); transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.fav-btn:hover { transform: translateY(-1px); color: var(--text); box-shadow: var(--bevel), 0 0 22px -12px var(--halo-gold); }
.fav-ico { font-size: 14px; color: color-mix(in srgb, var(--gold) 60%, var(--muted)); }
.fav-btn.is-fav { color: #1c1206; border-color: transparent; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); box-shadow: var(--glow-gold), inset 0 1px 0 rgba(255,255,255,.35); }
.fav-btn.is-fav .fav-ico { color: #1c1206; }

/* ---- profile ---- */
.profile-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); margin-top: var(--sp-5); }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.profile-grid .panel { margin-bottom: var(--sp-4); }
.identity-card { display: flex; align-items: center; gap: 18px; }
.identity-card .user-avatar { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.identity-meta { display: flex; flex-direction: column; gap: 4px; }
.id-name { font-family: var(--display); font-size: 20px; display: flex; align-items: center; gap: 10px; }
.id-email { color: var(--muted); font-size: 14px; }
.member-since { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; letter-spacing: .05em; color: var(--plate-ink); }
.id-plan-link { color: var(--teal-soft); font-size: 13px; margin-top: 4px; }
.plan-badge { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; font-weight: 700; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); }
.plan-badge.pro { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-soft); }
.profile-form { display: flex; flex-direction: column; gap: 14px; }
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--glass), var(--deep)) padding-box, linear-gradient(120deg, var(--ring), transparent 60%) border-box; box-shadow: var(--elev-1), var(--bevel); }
.fav-row:hover { transform: translateX(2px); }
.fav-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.fav-name { flex: 1; font-family: var(--display); font-size: 15px; }
.fav-x { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.fav-x:hover { color: #ff9a76; background: color-mix(in srgb, #ff6a3c 12%, transparent); }
.profile-empty { color: var(--muted); }
.profile-logout { display: flex; }

/* ---- admin ---- */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin: var(--sp-5) 0; }
@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .admin-stats { grid-template-columns: 1fr; } }
.stat-card { text-align: left; }
.stat-num { font-family: var(--display); font-size: clamp(30px, 4vw, 40px); font-variant-numeric: tabular-nums lining-nums;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--gold) 50%, var(--text))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-family: var(--display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-table tr:hover td { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.role-badge { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; font-weight: 700; }
.role-badge.admin { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-soft); }
.role-badge.user { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); }
.you-tag { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-soft); border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); border-radius: 999px; padding: 2px 7px; margin-left: 6px; }
.admin-act { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.admin-act .btn { padding: 7px 13px; font-size: 11px; }
.admin-act .danger { color: #ff9a76; border-color: color-mix(in srgb, #ff6a3c 40%, transparent); }
@media (max-width: 760px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .admin-table td { padding: 2px 0; border: 0; }
  .admin-table td::before { content: attr(data-th) " · "; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
}

/* ---- Export — refreshed tiles with program icon chips ---- */
.export-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.export-tile { flex-direction: row; align-items: center; gap: 12px; padding: 13px 14px; }
.export-tile .export-label { flex: 1; min-width: 0; }
.export-ico { position: relative; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.export-ico.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -.04em; color: var(--gold-soft); background: color-mix(in srgb, var(--gold) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 22%, transparent); }
.export-ico.ps { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .01em; color: #31a8ff; background: #001e36; box-shadow: inset 0 0 0 1px rgba(49, 168, 255, .45); }
.export-ico.wheel { background: conic-gradient(from 90deg, #ff5b5b, #ff9f1c, #ffd166, #2ec27e, #00d9d0, #3a86ff, #9b6bff, #ff5b5b); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.export-ico.wheel::after { content: ""; position: absolute; inset: 38%; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent); }
.export-ico.figma { background: color-mix(in srgb, var(--text) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); }
.export-ico.figma svg { display: block; }

/* ---- palette alchemy: Merge (treasure chest) + Randomize ---- */
.alc-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid transparent;
  background: linear-gradient(0deg, var(--glass), var(--glass)) padding-box, var(--ring-quiet) border-box;
  box-shadow: var(--bevel); transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.alc-btn:hover { transform: translateY(-1px); color: var(--text); box-shadow: var(--bevel), 0 0 22px -12px var(--halo-gold); }
.alc-btn:active { transform: translateY(0) scale(.97); }
.rand-btn .alc-ico { font-size: 15px; color: color-mix(in srgb, var(--teal) 75%, var(--muted)); transition: transform var(--dur-2) var(--ease-soft), color var(--dur-1) var(--ease-out); display: inline-block; }

/* Merge = a small wooden treasure chest — locked for free, open for paid */
.chest-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 9px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); border: 1px solid transparent;
  background: linear-gradient(0deg, var(--glass), var(--glass)) padding-box, var(--ring-quiet) border-box;
  box-shadow: var(--bevel); transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.chest-btn:hover { transform: translateY(-1px); box-shadow: var(--bevel), 0 0 24px -12px var(--halo-gold); }
.chest-btn:active { transform: translateY(0) scale(.97); }
.chest-svg { width: 32px; height: 29px; flex-shrink: 0; overflow: visible; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.chest-lid { transform-origin: 7px 17px; transition: transform .5s var(--ease-soft); }
.chest-btn.open .chest-lid { transform: rotate(-52deg); }
.chest-gem { opacity: 0; transform: translateY(3px); transition: opacity .35s ease .12s, transform .5s var(--ease-soft) .12s; }
.chest-btn.open .chest-gem { opacity: 1; transform: translateY(-5px); }
.chest-btn.open .chest-svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)) drop-shadow(0 0 8px color-mix(in srgb, var(--gold) 55%, transparent)); }
.chest-lock { display: none; }
.chest-btn.locked .chest-lock { display: block; }
.chest-btn.locked { color: var(--muted); }
.chest-btn.locked:hover { box-shadow: var(--bevel); transform: none; }
@media (prefers-reduced-motion: reduce) { .chest-lid, .chest-gem { transition: none; } }
.rand-btn:hover .alc-ico { color: var(--teal-soft); transform: rotate(180deg); }

/* the merged signature colour, rising from the chest */
.merge-reveal { margin-top: 12px; }
.merge-reveal[hidden] { display: none; }
.merge-gem {
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; text-align: left;
  min-width: 210px; padding: 16px 22px; border-radius: 16px; border: 1px solid color-mix(in srgb, #fff 26%, transparent);
  box-shadow: var(--elev-2), 0 0 38px -10px currentColor, inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: gemPop .42s var(--ease-soft) both;
}
.merge-gem-name { position: relative; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: .04em; line-height: 1.05; }
.merge-gem-sub { position: relative; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.merge-gem-sub .merge-gem-hex { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; text-transform: none; }
@keyframes gemPop { 0% { opacity: 0; transform: translateY(10px) scale(.7); } 60% { transform: translateY(-2px) scale(1.04); } 100% { opacity: 1; transform: none; } }

/* randomize shake on the palette strip */
@keyframes stripShake { 0%,100% { transform: translateX(0); } 18% { transform: translateX(-6px) rotate(-.4deg); } 38% { transform: translateX(5px) rotate(.4deg); } 58% { transform: translateX(-4px); } 78% { transform: translateX(3px); } }
.detail-strip.shake { animation: stripShake .6s ease both; }
@media (prefers-reduced-motion: reduce) { .merge-gem { animation: none; } .detail-strip.shake { animation: none; } .rand-btn:hover .alc-ico { transform: none; } }

/* ---- palette skin: glowing multi-colour wordmarks (nav + hero) ---- */
/* worn wordmarks pop like a surfaced paint-box chip — the tile's brightness/saturation lift,
   which also amplifies their accent-glow text-shadows */
.skin-wordmark { filter: brightness(1.12) saturate(1.3); }
/* the hero word: richer colour pop so its distinct hues really show, over deeper metal */
.hero .h1.skin-wordmark { filter: brightness(1.07) saturate(1.5); }

/* ============================================================
   LEGIBILITY GUARANTEE — on per-palette skins AND base light, any
   accent-coloured TEXT is clamped toward --text so it can never blend
   into its surface; text on accent FILLS uses a readable ink. The base
   dark theme keeps its vivid accents (already high-contrast).
   ============================================================ */
:is(html.palette-skin, html[data-theme="light"]) :is(
  .eyebrow, .ornament, .step .n, .hero-soul em, .creature-note, .color-pct, .panel h3, .h3-note,
  .price-feats li b, .price-feats li::before, .prose .pull,
  .back-link:hover, .footer-col a:hover, .lock-banner b, .plan-badge.pro, .role-badge.admin,
  .admin-table th, .auth-switch button, .auth-close:hover, .fmt:hover, .user-dropdown a:hover,
  .user-dropdown button:hover, .export-glyph, .export-ico.mono, .card.locked::after, .chip.gold.active,
  .vault-acc, .vault-tab.active .vault-acc, .vault-tab.vault-dark.active .vault-acc, .id-name .plan-badge
) { color: var(--gold-text) !important; }

:is(html.palette-skin, html[data-theme="light"]) :is(
  .chip.active, .badge.hybrid, .cat.active, .prompt-box .k, .id-plan-link, .you-tag, .free-tag,
  .vault-tab.vault-hybrid.active .vault-acc, .rand-btn:hover .alc-ico
) { color: var(--teal-text) !important; }

:is(html.palette-skin, html[data-theme="light"]) .badge.dark { color: var(--ember-text) !important; }

/* text on accent FILLS gets a readable ink on skins (fill is a solid accent there) */
html.palette-skin :is(.btn-gold, .fav-btn.is-fav, .fav-btn.is-fav .fav-ico) { color: var(--gold-ink) !important; }
html.palette-skin .btn-teal { color: var(--teal-ink) !important; }
html.palette-skin .btn-ember { color: var(--ember-ink) !important; }

