/* ─── Theme variables ─────────────────────────────────────────────── */
/* Default = Hearth (cozy cottage / BookTok). All other themes override
   the same semantic names below. Switch by setting data-theme on <html>. */

:root,
:root[data-theme="hearth"] {
  /* Warm dark — candlelit cottage. Cream text on dark sepia, gold accents. */
  --bg:              #1A130D;  /* Deep cozy brown — like an unlit room */
  --bg-elevated:     #14100A;  /* Slightly darker for showcase */
  --surface:         #2A2018;  /* Card surfaces, slightly raised */
  --text:            #F2E4C9;  /* Warm cream */
  --text-soft:       #C9B594;
  --text-mute:       #8E7E63;
  --border:          #3E3327;
  --accent:          #F6C177;  /* Candle gold — primary warm accent */
  --accent-deep:     #C9954A;
  --accent-2:        #8DAA91;  /* Sage green — bookish */
  --accent-2-deep:   #5C7E66;
  --accent-3:        #E89B5A;  /* Amber candlelight */
  --accent-soft:     #D8A7A7;  /* Dusty rose */
  --invert-bg:       #F2E4C9;  /* Quote section: cream on dark page */
  --invert-text:     #1A130D;
  --invert-text-soft:rgba(26, 19, 13, 0.75);
  --invert-text-mute:rgba(26, 19, 13, 0.55);
  --invert-border:   rgba(26, 19, 13, 0.18);
  --shadow-accent-rgb: 246, 193, 119;
  --error-bg:        #3A1E18;
  --error-border:    #C95436;
  --error-text:      #F4A88B;
  --success-circle:  #8DAA91;
  --halo-radial-1:   246, 193, 119;  /* gold */
  --halo-radial-2:   232, 155, 90;   /* amber */
  --line-overlay:    rgba(242, 228, 201, 0.015);
  --tile-1: #2E2218;
  --tile-2: #3E2D22;
  --tile-3: #2A2E22;
  --tile-4: #1F1812;
  --tile-5: #F6C177;
  --tile-5-text: #1A130D;
  --tile-6: #4A352A;
  --nav-bg:          rgba(26, 19, 13, 0.88);
  --logo-stripe-1:   #C95436;
  --logo-stripe-2:   #D8A7A7;
  --logo-stripe-3:   #F6C177;
  --logo-stripe-4:   #8DAA91;
  --logo-stripe-5:   #F2E4C9;
  --logo-stripe-eye: #1A130D;
  /* Shape language (warm + slightly hand-made) */
  --radius-card:   18px;
  --radius-btn:    999px;
  --radius-input:  12px;
  --radius-tile:   16px;
  --radius-hero:   24px;
  --hero-art-shadow: 0 30px 60px -25px rgba(0,0,0,0.55), 0 8px 22px -8px rgba(0,0,0,0.25);
}

:root[data-theme="bloom"] {
  --bg:              #FFF8F2;
  --bg-elevated:     #FFE9DC;
  --surface:         #FFFFFF;
  --text:            #4A4453;
  --text-soft:       #6B5F75;
  --text-mute:       #A498A8;
  --border:          #F0DCE4;
  --accent:          #F4A6C1;  /* Primary Pink */
  --accent-deep:     #D87BA0;
  --accent-2:        #CDB4FF;  /* Soft Lavender */
  --accent-2-deep:   #A48BE0;
  --accent-3:        #A8E6CF;  /* Mint */
  --accent-soft:     #FFC6A5;  /* Peach */
  --invert-bg:       #4A4453;
  --invert-text:     #FFF8F2;
  --invert-text-soft:rgba(255, 248, 242, 0.75);
  --invert-text-mute:rgba(255, 248, 242, 0.55);
  --invert-border:   rgba(255, 248, 242, 0.18);
  --shadow-accent-rgb: 244, 166, 193;
  --error-bg:        #FFE0E8;
  --error-border:    #F4A6C1;
  --error-text:      #B85780;
  --success-circle:  #A8E6CF;
  --halo-radial-1:   255, 224, 138;
  --halo-radial-2:   244, 166, 193;
  --line-overlay:    rgba(74, 68, 83, 0.01);
  --tile-1: #F4A6C1;
  --tile-2: #CDB4FF;
  --tile-3: #A8E6CF;
  --tile-4: #FFE08A;
  --tile-5: #FFC6A5;
  --tile-5-text: #4A4453;
  --tile-6: #FFD1E8;
  --nav-bg:          rgba(255, 248, 242, 0.92);
  --logo-stripe-1:   #F4A6C1;
  --logo-stripe-2:   #FFC6A5;
  --logo-stripe-3:   #FFE08A;
  --logo-stripe-4:   #A8E6CF;
  --logo-stripe-5:   #CDB4FF;
  --logo-stripe-eye: #FFFFFF;
  /* Shape language (soft and friendly — biggest radii) */
  --radius-card:   28px;
  --radius-btn:    999px;
  --radius-input:  18px;
  --radius-tile:   24px;
  --radius-hero:   32px;
  --hero-art-shadow: 0 24px 50px -22px rgba(244,166,193,0.45), 0 8px 20px -6px rgba(205,180,255,0.25);
}

:root[data-theme="pulse"] {
  --bg:              #121212;
  --bg-elevated:     #1A1A1A;
  --surface:         #232323;
  --text:            #E5E5E5;
  --text-soft:       #B5B5B5;
  --text-mute:       #7A7A7A;
  --border:          #3A3A3A;
  --accent:          #8B5CF6;  /* Electric Purple */
  --accent-deep:     #5B21B6;
  --accent-2:        #22D3EE;  /* Cyan */
  --accent-2-deep:   #0891B2;
  --accent-3:        #FAFAFA;
  --accent-soft:     #5B21B6;
  --invert-bg:       #FAFAFA;
  --invert-text:     #121212;
  --invert-text-soft:rgba(18, 18, 18, 0.75);
  --invert-text-mute:rgba(18, 18, 18, 0.55);
  --invert-border:   rgba(18, 18, 18, 0.18);
  --shadow-accent-rgb: 139, 92, 246;
  --error-bg:        #2A1A1A;
  --error-border:    #EF4444;
  --error-text:      #FCA5A5;
  --success-circle:  #22D3EE;
  --halo-radial-1:   139, 92, 246;
  --halo-radial-2:   34, 211, 238;
  --line-overlay:    rgba(229, 229, 229, 0.015);
  --tile-1: #1F1B2E;
  --tile-2: #2D1F40;
  --tile-3: #1A2A33;
  --tile-4: #232323;
  --tile-5: #8B5CF6;
  --tile-5-text: #FAFAFA;
  --tile-6: #22D3EE;
  --nav-bg:          rgba(18, 18, 18, 0.85);
  --logo-stripe-1:   #8B5CF6;
  --logo-stripe-2:   #22D3EE;
  --logo-stripe-3:   #5B21B6;
  --logo-stripe-4:   #FAFAFA;
  --logo-stripe-5:   #3A3A3A;
  --logo-stripe-eye: #FAFAFA;
  /* Shape language (sharp modern tech) */
  --radius-card:   12px;
  --radius-btn:    8px;
  --radius-input:  6px;
  --radius-tile:   10px;
  --radius-hero:   16px;
  --hero-art-shadow: 0 30px 60px -20px rgba(139,92,246,0.6), 0 12px 28px -8px rgba(34,211,238,0.25);
}

:root[data-theme="neon-grid"] {
  --bg:              #09090B;
  --bg-elevated:     #111827;
  --surface:         #1A1B2E;
  --text:            #F8FAFC;
  --text-soft:       #C7CAD6;
  --text-mute:       #7F8294;
  --border:          #2A2D40;
  --accent:          #00E5FF;  /* Neon Cyan */
  --accent-deep:     #00B3CC;
  --accent-2:        #A855F7;  /* Neon Purple */
  --accent-2-deep:   #7C3AED;
  --accent-3:        #FF4FD8;  /* Hot Pink */
  --accent-soft:     #2563EB;
  --invert-bg:       #F8FAFC;
  --invert-text:     #09090B;
  --invert-text-soft:rgba(9, 9, 11, 0.75);
  --invert-text-mute:rgba(9, 9, 11, 0.55);
  --invert-border:   rgba(9, 9, 11, 0.18);
  --shadow-accent-rgb: 0, 229, 255;
  --error-bg:        #2A0F1A;
  --error-border:    #FF4FD8;
  --error-text:      #FF8FE5;
  --success-circle:  #00E5FF;
  --halo-radial-1:   0, 229, 255;
  --halo-radial-2:   168, 85, 247;
  --line-overlay:    rgba(248, 250, 252, 0.02);
  --tile-1: #1A0F2E;
  --tile-2: #0F1A2E;
  --tile-3: #2E0F2A;
  --tile-4: #111827;
  --tile-5: #00E5FF;
  --tile-5-text: #09090B;
  --tile-6: #A855F7;
  --nav-bg:          rgba(9, 9, 11, 0.85);
  --logo-stripe-1:   #00E5FF;
  --logo-stripe-2:   #A855F7;
  --logo-stripe-3:   #FF4FD8;
  --logo-stripe-4:   #2563EB;
  --logo-stripe-5:   #7C3AED;
  --logo-stripe-eye: #F8FAFC;
  /* Shape language (angular cyber, neon glow) */
  --radius-card:   8px;
  --radius-btn:    4px;
  --radius-input:  4px;
  --radius-tile:   6px;
  --radius-hero:   12px;
  --hero-art-shadow: 0 0 40px rgba(0,229,255,0.5), 0 0 80px rgba(168,85,247,0.35);
}

:root[data-theme="form"] {
  --bg:              #F8F8F6;
  --bg-elevated:     #EFEFEC;
  --surface:         #FFFFFF;
  --text:            #2B2B2B;
  --text-soft:       #5A5A5A;
  --text-mute:       #8B8B8B;
  --border:          #D6D3D1;
  --accent:          #111111;  /* Matte Black */
  --accent-deep:     #000000;
  --accent-2:        #D6C3B3;  /* Warm Beige */
  --accent-2-deep:   #A89580;
  --accent-3:        #8B8B8B;
  --accent-soft:     #CFCFCF;
  --invert-bg:       #111111;
  --invert-text:     #FAFAFA;
  --invert-text-soft:rgba(250, 250, 250, 0.75);
  --invert-text-mute:rgba(250, 250, 250, 0.55);
  --invert-border:   rgba(250, 250, 250, 0.18);
  --shadow-accent-rgb: 17, 17, 17;
  --error-bg:        #F4E4E4;
  --error-border:    #2B2B2B;
  --error-text:      #5A1010;
  --success-circle:  #2B2B2B;
  --halo-radial-1:   214, 195, 179;
  --halo-radial-2:   139, 139, 139;
  --line-overlay:    rgba(43, 43, 43, 0.008);
  --tile-1: #D6C3B3;
  --tile-2: #EFEFEC;
  --tile-3: #CFCFCF;
  --tile-4: #FFFFFF;
  --tile-5: #111111;
  --tile-5-text: #FAFAFA;
  --tile-6: #8B8B8B;
  --nav-bg:          rgba(248, 248, 246, 0.92);
  --logo-stripe-1:   #111111;
  --logo-stripe-2:   #2B2B2B;
  --logo-stripe-3:   #8B8B8B;
  --logo-stripe-4:   #D6C3B3;
  --logo-stripe-5:   #CFCFCF;
  --logo-stripe-eye: #FFFFFF;
  /* Shape language (minimal, premium — almost square) */
  --radius-card:   4px;
  --radius-btn:    2px;
  --radius-input:  2px;
  --radius-tile:   4px;
  --radius-hero:   6px;
  --hero-art-shadow: 0 30px 60px -25px rgba(0,0,0,0.2), 0 8px 20px -8px rgba(0,0,0,0.1);
}

:root[data-theme="realm"] {
  /* Dark fantasy / dungeons. Cream-gold text on near-black stone, dice-purple
     and candle-amber accents. */
  --bg:              #14110D;  /* Stone-black */
  --bg-elevated:     #0F0D0A;
  --surface:         #1F1B14;  /* Card surfaces */
  --text:            #E8D8A8;  /* Antique gold-cream */
  --text-soft:       #B5A77D;
  --text-mute:       #7A6F5A;
  --border:          #3D352A;
  --accent:          #C9A554;  /* Medieval gold */
  --accent-deep:     #8B7332;
  --accent-2:        #6B3FBE;  /* Royal/dice purple */
  --accent-2-deep:   #4A2A8E;
  --accent-3:        #FFB870;  /* Candle warm */
  --accent-soft:     #2A3F5F;  /* Banner blue */
  --invert-bg:       #E8D8A8;
  --invert-text:     #14110D;
  --invert-text-soft:rgba(20, 17, 13, 0.75);
  --invert-text-mute:rgba(20, 17, 13, 0.55);
  --invert-border:   rgba(20, 17, 13, 0.2);
  --shadow-accent-rgb: 201, 165, 84;
  --error-bg:        #2E1418;
  --error-border:    #B84450;
  --error-text:      #E89BA5;
  --success-circle:  #6B8E5E;
  --halo-radial-1:   201, 165, 84;
  --halo-radial-2:   107, 63, 190;
  --line-overlay:    rgba(232, 216, 168, 0.015);
  --tile-1: #2A1F14;
  --tile-2: #3D2A1F;
  --tile-3: #1F2A3F;
  --tile-4: #2A1F35;
  --tile-5: #C9A554;
  --tile-5-text: #14110D;
  --tile-6: #4A352A;
  --nav-bg:          rgba(20, 17, 13, 0.88);
  --logo-stripe-1:   #6B3FBE;
  --logo-stripe-2:   #FFB870;
  --logo-stripe-3:   #C9A554;
  --logo-stripe-4:   #2A3F5F;
  --logo-stripe-5:   #E8D8A8;
  --logo-stripe-eye: #14110D;
  /* Shape language (warm ornate, slightly Gothic) */
  --radius-card:   10px;
  --radius-btn:    6px;
  --radius-input:  6px;
  --radius-tile:   8px;
  --radius-hero:   14px;
  --hero-art-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 60px rgba(255,184,112,0.18);
}

/* ─── Base ───────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(var(--halo-radial-1), 0.08) 0, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(var(--halo-radial-2), 0.06) 0, transparent 40%);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    var(--line-overlay) 3px,
    var(--line-overlay) 4px
  );
  z-index: 1;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.display {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  font-style: italic;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ─── Nav ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  max-width: 1240px;
  margin: 0 auto;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'wght' 800;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* The logo SVG fills are wired to theme vars via CSS classes (set on <use> targets or
   inline <ellipse class="ls-1">, etc.) so the mark recolors with each theme. */
.logo-mark .ls-1 { fill: var(--logo-stripe-1); }
.logo-mark .ls-2 { fill: var(--logo-stripe-2); }
.logo-mark .ls-3 { fill: var(--logo-stripe-3); }
.logo-mark .ls-4 { fill: var(--logo-stripe-4); }
.logo-mark .ls-5 { fill: var(--logo-stripe-5); }
.logo-mark .ls-eye { fill: var(--logo-stripe-eye); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}
nav ul a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s;
}
nav ul a:hover { color: var(--accent); }
.nav-cta {
  background: var(--invert-bg);
  color: var(--invert-text) !important;
  padding: 10px 20px;
  border-radius: var(--radius-btn, 999px);
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover {
  background: var(--accent) !important;
  transform: translateY(-1px);
}

/* ─── Theme toggle (nav) ───────────────────────────────────────── */
.theme-toggle {
  position: relative;
}
.theme-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-toggle__btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.theme-toggle__swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 50%, var(--accent-2) 50%, var(--accent-2) 100%);
  border: 1.5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.theme-toggle__name {
  display: inline-block;
}
.theme-toggle__caret {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}
.theme-toggle__pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.06);
  display: none;
  z-index: 200;
}
.theme-toggle__pop[data-open="true"] { display: block; }
.theme-toggle__pop h6 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 12px;
  font-weight: 500;
}
.theme-toggle__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}
.theme-card:hover { transform: translateY(-1px); border-color: var(--text-soft); }
.theme-card[data-active="true"] {
  border-color: var(--accent);
  background: var(--surface);
}
.theme-card__swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
}
.theme-card__label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.theme-card__label small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
  margin-top: 2px;
}

/* Each theme card's swatch shows that theme's signature colors, regardless of
   which theme is currently active. */
.theme-card[data-theme-name="hearth"]  .theme-card__swatch { background: linear-gradient(135deg, #F6C177 0%, #F6C177 50%, #1A130D 50%, #1A130D 100%); }
.theme-card[data-theme-name="bloom"]   .theme-card__swatch { background: linear-gradient(135deg, #F4A6C1 0%, #F4A6C1 50%, #CDB4FF 50%, #CDB4FF 100%); }
.theme-card[data-theme-name="pulse"]   .theme-card__swatch { background: linear-gradient(135deg, #8B5CF6 0%, #8B5CF6 50%, #22D3EE 50%, #22D3EE 100%); }
.theme-card[data-theme-name="neon-grid"] .theme-card__swatch { background: linear-gradient(135deg, #00E5FF 0%, #00E5FF 50%, #A855F7 50%, #A855F7 100%); }
.theme-card[data-theme-name="form"]    .theme-card__swatch { background: linear-gradient(135deg, #111111 0%, #111111 50%, #D6C3B3 50%, #D6C3B3 100%); }
.theme-card[data-theme-name="realm"]   .theme-card__swatch { background: linear-gradient(135deg, #C9A554 0%, #C9A554 50%, #6B3FBE 50%, #6B3FBE 100%); }

/* ─── Splash overlay (homepage only) ────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: none;
  /* `safe center` keeps the splash vertically centered when there's room
     but falls back to flex-start (no top-clipping) when content overflows
     the viewport — fixes the "have to scroll down to see the cards" bug. */
  align-items: safe center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
html[data-show-splash="true"] .splash { display: flex; }
html[data-show-splash="true"] { overflow: hidden; }
html[data-show-splash="true"] body { overflow: hidden; }

.splash__inner {
  max-width: 920px;
  width: 100%;
  text-align: center;
}
.splash__logo {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
}
.splash__logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.splash__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}
.splash__title em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 500;
}
.splash__sub {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.splash__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
/* 3 + 3 layout: every card spans 2 cols, giving 3 per row. */
.splash__grid > * { grid-column: span 2; }

.splash-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 20px 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  /* Buttons have UA-default align-items that overrides flex's stretch,
     leaving the empty preview span at 0 width. Force stretch. */
  align-items: stretch;
  gap: 12px;
}
.splash-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.15);
}
.splash-card__preview {
  height: 80px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.splash-card__name {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.splash-card__desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* Each splash-card preview shows a thumbnail of that theme's actual splash
   image, independent of the currently-active theme. */
.splash-card__preview {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.splash-card[data-theme-name="hearth"]    .splash-card__preview { background-image: url('/art/hearth.webp'); }
.splash-card[data-theme-name="bloom"]     .splash-card__preview { background-image: url('/art/bloom.webp'); }
.splash-card[data-theme-name="pulse"]     .splash-card__preview { background-image: url('/art/pulse.webp'); }
.splash-card[data-theme-name="neon-grid"] .splash-card__preview { background-image: url('/art/neon-grid.webp'); }
.splash-card[data-theme-name="form"]      .splash-card__preview { background-image: url('/art/form.webp'); }
.splash-card[data-theme-name="realm"]     .splash-card__preview { background-image: url('/art/realm.webp'); }
.splash__skip {
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 12px;
}
.splash__skip:hover { color: var(--text); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: var(--radius-btn, 999px);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 4px 0 var(--accent-deep), 0 8px 20px rgba(var(--shadow-accent-rgb), 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--accent-deep), 0 12px 26px rgba(var(--shadow-accent-rgb), 0.32);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--accent-deep), 0 4px 10px rgba(var(--shadow-accent-rgb), 0.2);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
}
.btn-secondary:hover {
  background: var(--text);
  color: var(--bg);
}

/* ─── Hero ─── */
.hero {
  padding: 80px 0 120px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-soft);
}
.eyebrow .dot {
  width: 8px; height: 8px;
  background: var(--accent-2);
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero h1 {
  font-size: clamp(56px, 9vw, 112px);
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 800;
  margin-bottom: 28px;
}
.hero h1 .accent {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 600;
}
.hero-sub {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 480px;
  margin-bottom: 40px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  justify-self: end;
}
.hero-visual svg {
  width: 100%;
  height: 100%;
}
.hero-stat {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input, 14px);
  padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1.25;
  animation: float 6s ease-in-out infinite;
  color: var(--text-soft);
  text-align: left;
}
.hero-stat strong {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'wght' 700;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.hero-stat span {
  display: block;
  line-height: 1.2;
}
.hero-stat-1 { top: 8%; right: -4%; }
.hero-stat-2 { bottom: 12%; left: -8%; animation-delay: -2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Per-theme hero/about art: only the matching one is visible. */
.theme-art { display: none; }
:root[data-theme="hearth"]    .theme-art[data-theme-art="hearth"],
:root:not([data-theme])       .theme-art[data-theme-art="hearth"],
:root[data-theme="bloom"]     .theme-art[data-theme-art="bloom"],
:root[data-theme="pulse"]     .theme-art[data-theme-art="pulse"],
:root[data-theme="neon-grid"] .theme-art[data-theme-art="neon-grid"],
:root[data-theme="form"]      .theme-art[data-theme-art="form"],
:root[data-theme="realm"]     .theme-art[data-theme-art="realm"] {
  display: block;
}

/* Hero-area: each theme uses its splash image as the illustration.
   The about-area keeps its inline SVG (themed but lighter, complements the
   richer hero photo). */
.hero-visual .theme-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-hero, 28px);
  box-shadow: var(--hero-art-shadow, 0 30px 60px -25px rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(0, 0, 0, 0.15));
}
.hero-visual .theme-art[data-theme-art="hearth"]    { background-image: url('/art/hearth.webp'); }
.hero-visual .theme-art[data-theme-art="bloom"]     { background-image: url('/art/bloom.webp'); }
.hero-visual .theme-art[data-theme-art="pulse"]     { background-image: url('/art/pulse.webp'); }
.hero-visual .theme-art[data-theme-art="neon-grid"] { background-image: url('/art/neon-grid.webp'); }
.hero-visual .theme-art[data-theme-art="form"]      { background-image: url('/art/form.webp'); }
.hero-visual .theme-art[data-theme-art="realm"]     { background-image: url('/art/realm.webp'); }
/* Hide the inline SVG fallbacks inside .hero-visual — bg-image is the source of truth. */
.hero-visual .theme-art > svg { display: none; }

/* ─── Section common ─── */
section { padding: 100px 0; position: relative; }
.section-label {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(36px, 5vw, 56px);
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  margin-bottom: 20px;
  max-width: 760px;
}
.section-title em {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 500;
}
.section-intro {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 580px;
  margin-bottom: 60px;
}

/* ─── What we make ─── */
#makes { background: var(--surface); }
.makes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.make-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card, 24px);
  padding: 36px 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.make-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 7px,
    var(--line-overlay) 7px,
    var(--line-overlay) 8px
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.make-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.18);
}
.make-card:hover::before { opacity: 1; }
.make-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.make-card h3 {
  font-size: 26px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  margin-bottom: 12px;
}
.make-card p {
  color: var(--text-soft);
  margin-bottom: 20px;
  font-size: 15px;
}
.make-card ul {
  list-style: none;
  font-size: 14px;
  color: var(--text-soft);
}
.make-card ul li {
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}
.make-card ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Theme-aware fills inside the make-icon SVGs. The icons retain their shapes
   but recolor via these classes. */
.make-icon .mi-primary   { fill: var(--accent-2); }
.make-icon .mi-secondary { fill: var(--accent-2-deep); }
.make-icon .mi-tertiary  { fill: var(--accent); }
.make-icon .mi-soft      { fill: var(--accent-soft); }
.make-icon .mi-paper     { fill: var(--surface); }
.make-icon .mi-ink       { fill: var(--text); }
.make-icon .mi-gold      { fill: var(--accent-3); }
.make-icon .mi-shadow    { fill: var(--text); opacity: 0.15; }

/* ─── Steps ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.step { position: relative; }
.step-number {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 800;
  font-style: italic;
  font-size: 72px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0.85;
}
.step h4 {
  font-size: 22px;
  margin-bottom: 10px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 600;
}
.step p {
  color: var(--text-soft);
  font-size: 15px;
}

/* ─── Showcase ─── */
#showcase { background: var(--bg-elevated); }
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 180px;
  gap: 16px;
}
.tile {
  border-radius: var(--radius-tile, 20px);
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.tile:hover { transform: translateY(-4px) rotate(-0.5deg); }
.tile-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.tile-art svg { max-width: 80%; max-height: 80%; }
.tile-label {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tile-label strong {
  color: var(--text);
  font-weight: 500;
}
.tile-1 { grid-column: span 2; grid-row: span 2; background: var(--tile-1); }
.tile-2 { grid-column: span 2; background: var(--tile-2); }
.tile-3 { grid-column: span 2; background: var(--tile-3); }
.tile-4 { grid-column: span 2; background: var(--tile-4); }
.tile-5 { grid-column: span 2; background: var(--tile-5); color: var(--tile-5-text); }
.tile-5 .tile-label, .tile-5 .tile-label strong { color: var(--tile-5-text); }
.tile-6 { grid-column: span 4; background: var(--tile-6); }

/* Tile SVG color hooks — same role names as .make-icon. */
.tile-art .ta-primary   { fill: var(--accent-2); }
.tile-art .ta-secondary { fill: var(--accent-2-deep); }
.tile-art .ta-tertiary  { fill: var(--accent); }
.tile-art .ta-soft      { fill: var(--accent-soft); }
.tile-art .ta-paper     { fill: var(--surface); }
.tile-art .ta-ink       { fill: var(--text); }
.tile-art .ta-gold      { fill: var(--accent-3); }
.tile-art .ta-shadow    { fill: var(--text); opacity: 0.2; }
.tile-art .ta-stroke    { stroke: var(--text); }
.tile-art .ta-stroke-2  { stroke: var(--accent-2-deep); }
.tile-art .ta-text      { fill: var(--text); }
.tile-art .ta-text-on-tile-5 { fill: var(--tile-5-text); }

/* ─── About ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.about-text p {
  font-size: 18px;
  color: var(--text-soft);
  margin-bottom: 20px;
}
.about-text p:first-of-type::first-letter {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 800;
  font-style: italic;
  font-size: 64px;
  float: left;
  line-height: 0.85;
  padding: 6px 12px 0 0;
  color: var(--accent);
}
.about-visual {
  position: relative;
  aspect-ratio: 1 / 1;
}
.about-visual svg { width: 100%; height: 100%; }

/* ─── Quote form ─── */
#quote { background: var(--invert-bg); color: var(--invert-text); }
#quote .section-title { color: var(--invert-text); }
#quote .section-title em { color: var(--accent-3); }
#quote .section-intro { color: var(--invert-text-soft); }
#quote .section-label { color: var(--accent-3); }
.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}
.quote-info ul {
  list-style: none;
  margin-top: 32px;
}
.quote-info ul li {
  padding: 16px 0;
  border-bottom: 1px solid var(--invert-border);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.quote-info ul li:last-child { border-bottom: none; }
.quote-info ul li strong {
  display: block;
  color: var(--invert-text);
  margin-bottom: 4px;
  font-weight: 500;
}
.quote-info ul li span {
  color: var(--invert-text-mute);
  font-size: 15px;
}
.quote-info ul li .num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'wght' 700;
  font-size: 28px;
  color: var(--accent-3);
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.quote-form {
  background: var(--surface);
  color: var(--text);
  padding: 40px;
  border-radius: var(--radius-card, 24px);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.4);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.form-field label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input, 12px);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-field textarea {
  resize: vertical;
  min-height: 100px;
}
.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.form-success {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.form-success.show { display: block; }
.form-success svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
}
.form-success .fs-circle { fill: var(--success-circle); }
.form-success .fs-check  { stroke: var(--surface); }
.form-success h3 {
  font-size: 28px;
  margin-bottom: 8px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
}
.form-success p { color: var(--text-soft); }

.form-error {
  display: none;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.45;
}
.form-error.show { display: block; }
.form-submit:disabled { opacity: 0.6; cursor: wait; }

/* ─── FAQ ─── */
.faq {
  max-width: 800px;
  margin: 0 auto;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  cursor: pointer;
}
.faq details[open] summary { color: var(--accent); }
.faq summary {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 600;
  font-size: 22px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: 'DM Sans', sans-serif;
  font-size: 28px;
  font-weight: 300;
  transition: transform 0.2s;
}
.faq details[open] summary::after { content: '−'; }
.faq details p {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 16px;
  max-width: 700px;
}

/* ─── Footer ─── */
footer {
  background: var(--bg-elevated);
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p {
  color: var(--text-soft);
  font-size: 15px;
  max-width: 280px;
}
.footer-col h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col ul { list-style: none; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul a {
  color: var(--text-soft);
  font-size: 15px;
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-mute);
}

/* ─── Policy / Legal pages ─── */
.policy-hero {
  padding: 80px 0 40px;
}
.policy-hero .section-label { color: var(--accent); }
.policy-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  margin-bottom: 12px;
}
.policy-hero h1 em {
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 500;
}
.policy-hero .last-updated {
  color: var(--text-mute);
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}
.policy-content {
  padding: 40px 0 100px;
}
.policy-content .container {
  max-width: 760px;
}
.policy-content h2 {
  font-size: 28px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 700;
  margin-top: 48px;
  margin-bottom: 16px;
}
.policy-content h2:first-child { margin-top: 0; }
.policy-content h3 {
  font-size: 20px;
  font-variation-settings: 'SOFT' 100, 'opsz' 144, 'wght' 600;
  margin-top: 32px;
  margin-bottom: 12px;
}
.policy-content p {
  margin-bottom: 16px;
  color: var(--text-soft);
}
.policy-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-soft);
}
.policy-content ul li {
  margin-bottom: 8px;
}
.policy-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.policy-content strong {
  color: var(--text);
  font-weight: 600;
}
.policy-content .callout {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 12px 12px 0;
  margin: 24px 0;
}
.policy-content .callout p:last-child { margin-bottom: 0; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .container, nav .inner { padding: 0 20px; }
  nav .inner { padding: 14px 20px; }
  nav ul { display: none; }
  .theme-toggle__name { display: none; }
  .theme-toggle__btn { padding: 8px 10px; }
  .splash__grid { grid-template-columns: 1fr; }
  .splash__grid > * { grid-column: 1 / -1; }
  .hero { padding: 50px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 360px; margin: 0 auto; }
  section { padding: 70px 0; }
  .makes-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }
  .tile-1, .tile-2, .tile-3, .tile-4, .tile-5, .tile-6 {
    grid-column: span 2;
    grid-row: span 1;
  }
  .tile-1 { grid-row: span 2; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .quote-grid { grid-template-columns: 1fr; gap: 40px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .policy-hero { padding: 50px 0 30px; }
}

@media (max-width: 500px) {
  .steps { grid-template-columns: 1fr; }
  .hero-stat-1 { top: 4%; right: 4%; }
  .hero-stat-2 { bottom: 6%; left: 4%; }
  .quote-form { padding: 28px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ─── Entrance animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
