:root {
  --ink: #0b0710;
  --paper: #f4ead6;
  --gold: #e4c48a;
  --gold-deep: #c9a05a;
  --mute: rgba(244, 234, 214, 0.62);
  --line: rgba(228, 196, 138, 0.28);
  --nav-h: 4.4rem;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --display: "Cinzel", "Cormorant Garamond", serif;
  --max: 72rem;
}

[data-theme="sea"] { --accent: #7ec8c8; --accent-2: #f3b7c8; --ink: #06151c; }
[data-theme="door"] { --accent: #e8a45a; --accent-2: #9b5cff; --ink: #140c08; }
[data-theme="halloween"] { --accent: #ff8a3d; --accent-2: #b07cff; --ink: #12080e; }
[data-theme="meadow"] { --accent: #e8c15a; --accent-2: #8fbf6a; --ink: #101408; }
[data-theme="herb"] { --accent: #8fbf6a; --accent-2: #d7c27a; --ink: #0c140c; }
[data-theme="apothecary"] { --accent: #d4a574; --accent-2: #8fbf8a; --ink: #120c08; }
[data-theme="poem"] { --accent: #c9b896; --accent-2: #8aa4c4; --ink: #121018; }
[data-theme="hearth"] { --accent: #e07a5f; --accent-2: #f2cc8f; --ink: #140a08; }
[data-theme="windows"] { --accent: #d4b06a; --accent-2: #6a8ec9; --ink: #080c18; }
[data-theme="rooted"] { --accent: #8a6a3d; --accent-2: #6a8f5a; --ink: #0e120c; }
[data-theme="romcom"] { --accent: #ff7eb6; --accent-2: #6ee7e7; --ink: #120818; }
[data-theme="grinch"] { --accent: #c94b4b; --accent-2: #e8d5a3; --ink: #100808; }
[data-theme="starlight"] { --accent: #d4c4ff; --accent-2: #f0d48a; --ink: #070614; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, .btn { font-family: inherit; cursor: pointer; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.magic-canvas {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}
.floaters {
  position: fixed;
  inset: 0;
  z-index: 17;
  pointer-events: none;
  overflow: hidden;
}
.floaters span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.95) 0%, rgba(228, 196, 138, 0.35) 45%, transparent 70%);
  box-shadow: 0 0 18px rgba(228, 196, 138, 0.55);
  animation: floatForever var(--d, 22s) ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.7s);
  left: calc(6% + var(--i) * 6.5%);
  top: calc(8% + var(--i) * 5.5%);
  opacity: 0.55;
}
.floaters span:nth-child(odd) {
  width: 14px;
  height: 14px;
  --d: 28s;
}
.floaters span:nth-child(3n) {
  width: 6px;
  height: 6px;
  --d: 18s;
  opacity: 0.4;
}
@keyframes floatForever {
  0% { transform: translate3d(0, 0, 0) scale(0.85); }
  25% { transform: translate3d(28px, -70px, 0) scale(1.15); }
  50% { transform: translate3d(-22px, -140px, 0) scale(0.9); }
  75% { transform: translate3d(40px, -70px, 0) scale(1.2); }
  100% { transform: translate3d(0, 0, 0) scale(0.85); }
}
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 19;
  background: radial-gradient(circle, rgba(228, 196, 138, 0.22) 0%, rgba(228, 196, 138, 0.06) 38%, transparent 70%);
  mix-blend-mode: screen;
  transition: transform 0.08s linear;
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(228, 196, 138, 0.42), rgba(11, 7, 16, 0.92) 58%);
  opacity: 1;
  transition: opacity 0.85s ease;
}
.veil.is-off { opacity: 0; }
.veil.leaving {
  opacity: 1;
  transition: opacity 0.45s ease;
}

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  background: linear-gradient(180deg, rgba(0,0,0,.72), transparent);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--display);
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--gold);
}
.brand small {
  display: block;
  letter-spacing: 0.38em;
  font-size: 0.55rem;
  color: var(--mute);
  margin-top: 0.15rem;
}
.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.nav-links a:hover { color: var(--gold); }

.hero {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: end start;
  padding: 7rem 8vw 5rem;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11,7,16,.25) 0%, rgba(11,7,16,.2) 40%, rgba(11,7,16,.88) 100%),
    url("../image/worlds/library.jpg") center/cover no-repeat;
  z-index: -1;
  transform: scale(1.04);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.1) translate3d(-1.2%, -1%, 0); }
}
.eyebrow {
  font-family: var(--display);
  letter-spacing: 0.42em;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: 0.95;
  max-width: 14ch;
  font-style: italic;
  text-shadow: 0 0 48px rgba(228, 196, 138, 0.28);
  animation: titleGlow 5.5s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 28px rgba(228, 196, 138, 0.16); }
  50% { text-shadow: 0 0 64px rgba(228, 196, 138, 0.42); }
}
.hero p.lead {
  max-width: 36rem;
  margin: 1.4rem 0 2rem;
  color: var(--mute);
  font-size: 1.08rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  padding: 0.85rem 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  border-radius: 999px;
  transition: 0.25s ease;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-gold {
  background: var(--gold);
  color: #1a1208;
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover { background: #f0d7a4; color: #1a1208; }
.btn-amazon {
  background: #ff9900;
  border-color: #ff9900;
  color: #111;
  font-weight: 700;
}
.btn-amazon:hover { filter: brightness(1.08); color: #111; }

.section {
  padding: 4.5rem 6vw;
  position: relative;
}
.section h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 0.6rem;
}
.kicker {
  color: var(--mute);
  max-width: 40rem;
  margin-bottom: 2.4rem;
}

.portals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.4rem;
}
.portal {
  position: relative;
  display: block;
  border-radius: 1.1rem;
  overflow: hidden;
  min-height: 26rem;
  isolation: isolate;
  border: 1px solid var(--line);
  transform: translateZ(0);
  transition: transform 0.45s ease, border-color 0.3s ease, box-shadow 0.45s ease;
}
.portal:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(228, 196, 138, 0.35), 0 22px 50px rgba(0, 0, 0, 0.35), 0 0 40px rgba(228, 196, 138, 0.12);
}
.portal img.world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(1.05) contrast(1.05);
  transition: transform 1.1s ease;
}
.portal:hover img.world { transform: scale(1.08); }
.portal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 244, 214, 0.28) 50%, transparent 65%);
  transform: translateX(-130%) skewX(-12deg);
}
.portal:hover::before { animation: sweep 1.05s ease forwards; }
@keyframes sweep {
  to { transform: translateX(130%) skewX(-12deg); }
}
.portal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.78) 70%);
}
.portal-cover {
  width: 5.6rem;
  height: auto;
  border-radius: 0.25rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  margin: 1.2rem 1.2rem 0;
}
.portal-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.2rem 1.2rem 1.3rem;
  z-index: 3;
}
.portal-cover { position: relative; z-index: 3; }
.portal-genre {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.portal h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.15;
}
.portal p {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  color: var(--mute);
}
.badge {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--gold);
}

.world-page { min-height: 100vh; }
.world-hero {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  gap: 3rem;
  align-items: end;
  padding: 7rem 7vw 4rem;
}
.world-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 46%, rgba(0,0,0,.55) 100%),
    var(--world) center/cover no-repeat;
  z-index: -1;
}
.world-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 45% 32% at 72% 18%, rgba(228, 196, 138, 0.22), transparent 70%),
    radial-gradient(ellipse 30% 24% at 20% 80%, rgba(228, 196, 138, 0.12), transparent 65%);
  animation: driftLight 11s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes driftLight {
  from { opacity: 0.55; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
}
.cover-stage,
.world-copy { position: relative; z-index: 1; }
.cover-stage::before {
  content: "";
  position: absolute;
  inset: -16%;
  background: radial-gradient(circle, rgba(228, 196, 138, 0.5) 0%, transparent 68%);
  filter: blur(28px);
  opacity: 0.55;
  animation: aura 5.2s ease-in-out infinite;
  z-index: -1;
}
@keyframes aura {
  0%, 100% { opacity: 0.35; transform: scale(0.96); }
  50% { opacity: 0.7; transform: scale(1.06); }
}
.cover-stage img {
  width: 100%;
  border-radius: 0.35rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08), 0 0 40px rgba(228, 196, 138, 0.18);
  animation: floaty 6.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.world-copy h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.98;
  font-style: italic;
}
.world-copy .sub {
  margin-top: 0.8rem;
  color: var(--mute);
  max-width: 36rem;
  font-size: 1.05rem;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1.1rem 0 1.6rem;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.spoken {
  max-width: 38rem;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.55;
  font-style: italic;
  color: rgba(244,234,214,.92);
  margin: 1.4rem 0 1.8rem;
}
.spoken.live {
  color: var(--accent, var(--gold));
  text-shadow: 0 0 24px rgba(228, 196, 138, 0.45);
  animation: speakGlow 2.4s ease-in-out infinite;
}
@keyframes speakGlow {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}
.buy-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.world-body {
  padding: 3.5rem 7vw 5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.45));
}
.world-body h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  font-weight: 500;
  margin-bottom: 0.8rem;
}
.world-body p { color: var(--mute); max-width: 42rem; }
.note {
  border: 1px solid var(--line);
  padding: 1.4rem;
  border-radius: 1rem;
  color: var(--mute);
  font-size: 0.92rem;
}

.listen-orb {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 35;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(12,8,16,.72);
  color: var(--gold);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 8px rgba(228,196,138,.08), 0 16px 40px rgba(0,0,0,.4);
  animation: pulse 3.4s ease-in-out infinite;
}
.listen-orb::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(228, 196, 138, 0.45);
  animation: spin 14s linear infinite;
}
.listen-orb svg { width: 1.4rem; height: 1.4rem; fill: currentColor; position: relative; z-index: 1; }
.listen-orb.is-on {
  background: var(--gold);
  color: #1a1208;
}
.listen-orb.is-on::before {
  border-style: solid;
  animation-duration: 4s;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(228,196,138,.08), 0 16px 40px rgba(0,0,0,.4); }
  50% { box-shadow: 0 0 0 14px rgba(228,196,138,.16), 0 16px 40px rgba(0,0,0,.4), 0 0 28px rgba(228,196,138,.35); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.listen-label {
  position: fixed;
  right: 5.9rem;
  bottom: 2.35rem;
  z-index: 35;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(0,0,0,.45);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  pointer-events: none;
}

.consent {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(6,4,10,.62);
  padding: 1.5rem;
}
.consent[hidden] { display: none; }
.consent-card {
  max-width: 28rem;
  background: #120c18;
  border: 1px solid var(--line);
  padding: 2rem 1.6rem;
  border-radius: 1.2rem;
  text-align: center;
}
.consent-card h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 2rem;
  margin-bottom: 0.6rem;
}
.consent-card p { color: var(--mute); margin-bottom: 1.3rem; }

.about-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) 1fr;
  gap: 3rem;
  padding: 8rem 7vw 5rem;
  align-items: center;
}
.about-wrap img {
  width: 100%;
  border-radius: 1.4rem;
  object-fit: cover;
  aspect-ratio: 4/5;
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.about-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
}
.about-wrap p { margin-top: 1rem; color: var(--mute); max-width: 38rem; }

.site-foot {
  padding: 2.2rem 6vw 2.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--mute);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg, .cover-stage img, .portal img.world, .listen-orb, .listen-orb::before,
  .hero h1, .cover-stage::before, .world-hero::after, .spoken.live, .floaters span { animation: none; }
  .portal:hover::before { animation: none; }
  .cursor-glow, .magic-canvas, .floaters { display: none; }
}

@media (max-width: 860px) {
  .world-hero, .world-body, .about-wrap {
    grid-template-columns: 1fr;
    padding-left: 1.3rem;
    padding-right: 1.3rem;
  }
  .cover-stage { max-width: 16rem; }
  .hero { padding: 7rem 1.3rem 3.5rem; }
  .nav-links { gap: 0.8rem; font-size: 0.68rem; }
  .listen-label { display: none; }
}
