/* ============================================================
   DEEP ARK GAMES — The Black Book Series
   A dark mythic TTRPG publisher website
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --void: #0a0a0c;
  --depth: #111115;
  --surface: #1a1a20;
  --surface-raised: #22222a;
  --parchment: #e8e0d4;
  --parchment-dim: #b8b0a4;
  --stone: #7a7568;
  --gold: #c9a84c;
  --gold-bright: #e8d5a3;
  --gold-dim: #8a7340;
  --blood: #8b2e2e;
  --blood-bright: #a63a3a;
  --flame: #d4a574;

  --font-display: 'Pirata One', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Crimson Text', serif;
  --font-book: 'Crimson Text', serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--void);
  color: var(--parchment);
  line-height: 1.65;
  font-size: 18px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.lightbox-open {
  overflow: hidden;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

::selection {
  background: rgba(201, 168, 76, 0.3);
  color: var(--gold-bright);
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.display {
  font-family: var(--font-display);
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--void);
}
::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ── Grain Overlay ────────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.25rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.4s var(--ease-out-expo), backdrop-filter 0.4s var(--ease-out-expo);
}

.nav--scrolled {
  background-color: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: text-shadow 0.3s ease;
}

.nav__logo:hover {
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

.nav__links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  text-decoration: none;
  position: relative;
  padding-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease-out-expo), left 0.3s var(--ease-out-expo);
}

.nav__links a:hover {
  color: var(--gold);
}

.nav__links a:hover::after {
  width: 100%;
  left: 0;
}

.nav__cta {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease, background 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.nav__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-out-expo);
  z-index: -1;
}

.nav__cta:hover {
  color: var(--void);
}

.nav__cta:hover::before {
  transform: translateY(0);
}

/* ── Mobile Nav Toggle ────────────────────────────────────── */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--gold);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, #1a1510 0%, var(--void) 70%);
  z-index: 0;
}

/* Hero Art Grid Background */
.hero__art-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0;
  opacity: 0.35;
  filter: blur(3px) saturate(0.7);
  transform: scale(1.1);
  animation: artGridPan 20s var(--ease-in-out-sine) infinite alternate;
}

@keyframes artGridPan {
  from {
    transform: scale(1.1) translate(0, 0);
  }
  to {
    transform: scale(1.15) translate(-1%, -1%);
  }
}

.hero__art-cell {
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero__art-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.55);
}

.hero__embers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.ember {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--flame);
  border-radius: 50%;
  opacity: 0;
  animation: rise var(--dur) linear infinite;
  animation-delay: var(--delay);
  left: var(--x);
  bottom: -10px;
  box-shadow: 0 0 4px var(--flame), 0 0 8px var(--gold);
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-110vh) scale(0.2);
    opacity: 0;
  }
}

.hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10,10,12,0.3) 20%, var(--void) 75%);
  z-index: 3;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 4;
  max-width: 900px;
  animation: heroRise 1.2s var(--ease-out-expo) both;
}

.hero__overline {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: block;
  animation: heroRise 1s 0.2s var(--ease-out-expo) both;
}

.hero__title {
  font-family: var(--font-book);
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 5rem);
  color: var(--parchment);
  margin-bottom: 1.25rem;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
  animation: heroRise 1s 0.35s var(--ease-out-expo) both;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.hero__title span {
  display: block;
  font-size: 0.32em;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  margin-top: 0.75rem;
  text-transform: uppercase;
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--parchment-dim);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.5;
  animation: heroRise 1s 0.5s var(--ease-out-expo) both;
}

.hero__ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroRise 1s 0.65s var(--ease-out-expo) both;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1rem 2.25rem;
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--gold);
  color: var(--void);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.25);
}

.btn--primary:hover {
  box-shadow: 0 6px 30px rgba(201, 168, 76, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  box-shadow: inset 0 0 0 0 var(--gold);
  transition: color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, transform 0.2s ease;
}

.btn--outline:hover {
  color: var(--void);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 40px var(--gold);
}

.btn--blood {
  background: var(--blood);
  color: var(--parchment);
  box-shadow: 0 4px 20px rgba(139, 46, 46, 0.3);
}

.btn--blood:hover {
  background: var(--blood-bright);
  box-shadow: 0 6px 30px rgba(139, 46, 46, 0.45);
}

/* ── Kickstarter Banner ───────────────────────────────────── */
.ks-banner {
  position: relative;
  background: linear-gradient(135deg, var(--blood) 0%, #5c1a1a 100%);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(232, 208, 164, 0.1);
  border-bottom: 1px solid rgba(232, 208, 164, 0.1);
  z-index: 10;
}

.ks-banner__text {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment);
}

.ks-banner__text strong {
  color: var(--gold-bright);
  font-weight: 400;
}

.ks-banner__btn {
  font-size: 0.7rem;
  padding: 0.7rem 1.5rem;
  background: var(--parchment);
  color: var(--blood);
  text-decoration: none;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.3s ease, transform 0.2s ease;
}

.ks-banner__btn:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
}

/* ── Section Base ─────────────────────────────────────────── */
.section {
  padding: 7rem 2rem;
  position: relative;
}

.section__header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section__overline {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}

.section__title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 1rem;
  color: var(--parchment);
}

.section__desc {
  font-size: 1.15rem;
  color: var(--parchment-dim);
  line-height: 1.6;
}

/* ── Ornaments ────────────────────────────────────────────── */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  color: var(--gold-dim);
}

.ornament::before,
.ornament::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.ornament--large::before,
.ornament--large::after {
  width: 120px;
}

/* ── Books Section ────────────────────────────────────────── */
.books {
  background: var(--depth);
}

.books__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.book-card {
  background: var(--surface);
  border: 1px solid rgba(201, 168, 76, 0.08);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  position: relative;
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease, border-color 0.4s ease;
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(201, 168, 76, 0.15);
  border-color: rgba(201, 168, 76, 0.2);
}

.book-card:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.book-card__cover {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 3/4;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s ease;
}

.book-card:hover .book-card__cover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

/* Mystery Card Cover */
.book-card__cover--mystery {
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-card__mystery-mark {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--gold-dim);
  opacity: 0.5;
  z-index: 1;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
}

.book-card:hover .book-card__mystery-mark {
  opacity: 0.8;
  transform: scale(1.1);
}

.book-card__mystery-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(201,168,76,0.06) 0%, transparent 60%),
              radial-gradient(circle at 70% 30%, rgba(139,46,46,0.05) 0%, transparent 50%);
  animation: fogDrift 8s ease-in-out infinite alternate;
}

@keyframes fogDrift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-3%, 2%) scale(1.05);
  }
}

.book-card__family {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.book-card__title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--parchment);
}

.book-card__status {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid;
}

.book-card__status--live {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

.book-card__status--coming {
  color: var(--blood-bright);
  border-color: var(--blood);
  background: rgba(139, 46, 46, 0.1);
}

.book-card__status--planned {
  color: var(--stone);
  border-color: var(--stone);
  background: rgba(122, 117, 104, 0.08);
}

.book-card__desc {
  font-size: 1rem;
  color: var(--parchment-dim);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.book-card__cta {
  font-size: 0.7rem;
  padding: 0.75rem 1.75rem;
}

/* ── Gallery Section ──────────────────────────────────────── */
.gallery {
  background: var(--void);
  overflow: hidden;
}

.gallery--relics {
  background: var(--depth);
}

.gallery__scroll {
  display: flex;
  gap: 1.5rem;
  padding: 0 max(2rem, calc((100vw - 1200px) / 2));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(2rem, calc((100vw - 1200px) / 2));
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) var(--void);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.gallery__scroll::-webkit-scrollbar {
  height: 6px;
}

.gallery__scroll::-webkit-scrollbar-track {
  background: var(--void);
}

.gallery__scroll::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 3px;
}

.gallery__scroll--grabbing {
  cursor: grabbing;
}

.gallery__scroll--grabbing .gallery__item {
  cursor: grabbing;
}

.gallery__item {
  flex: 0 0 auto;
  width: 320px;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.06);
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out-expo);
  cursor: zoom-in;
  touch-action: pan-x pan-y pinch-zoom;
}

.gallery__item:hover,
.gallery__item:focus-visible {
  border-color: rgba(201, 168, 76, 0.25);
  transform: translateY(-4px);
}

.gallery__item img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out-expo);
  pointer-events: none;
  -webkit-user-drag: none;
}

.gallery__item:hover img {
  transform: scale(1.06);
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.8) 0%, transparent 50%);
  pointer-events: none;
}

.gallery__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  transform: translateY(4px);
  opacity: 0.8;
  transition: transform 0.4s var(--ease-out-expo), opacity 0.4s ease;
  pointer-events: none;
}

.gallery__item:hover .gallery__caption {
  transform: translateY(0);
  opacity: 1;
  color: var(--gold);
}

/* ── Lore Section ─────────────────────────────────────────── */
.lore {
  background: var(--depth);
  position: relative;
}

.lore__bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(6rem, 20vw, 14rem);
  color: rgba(201, 168, 76, 0.02);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.lore__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.lore__quote {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.5;
  color: var(--parchment);
  font-style: italic;
  margin-bottom: 2rem;
}

.lore__quote::before {
  content: '“';
  font-family: var(--font-display);
  font-size: 3em;
  line-height: 0.1;
  vertical-align: bottom;
  color: var(--gold-dim);
  margin-right: 0.1em;
}

.lore__body {
  font-size: 1.1rem;
  color: var(--parchment-dim);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.lore__families {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.lore__family {
  text-align: center;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.lore__family:hover {
  opacity: 1;
}

.lore__family img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.2));
}

.lore__family span {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--parchment-dim);
}

/* ── Apothecary: Draw a Potion ───────────────────────────── */
.apothecary {
  background: var(--depth);
  text-align: center;
  overflow: hidden;
}

.apothecary__stage {
  position: relative;
  width: 280px;
  height: 400px;
  margin: 0 auto 3rem;
  perspective: 1200px;
}

.apothecary__deck {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.apothecary__deck::before,
.apothecary__deck::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid rgba(201, 168, 76, 0.15);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translate3d(0, 0, 0);
  transition: transform 0.4s var(--ease-out-expo);
}

.apothecary__deck::before {
  transform: translate3d(6px, 4px, -10px) rotate(2deg);
}

.apothecary__deck::after {
  transform: translate3d(-6px, 6px, -20px) rotate(-2deg);
}

.apothecary__deck--shuffling::before {
  animation: deckShuffle1 0.65s var(--ease-out-expo) 2 alternate;
}

.apothecary__deck--shuffling::after {
  animation: deckShuffle2 0.65s var(--ease-out-expo) 2 alternate;
}

@keyframes deckShuffle1 {
  to { transform: translate3d(20px, 0, -10px) rotate(8deg); }
}

@keyframes deckShuffle2 {
  to { transform: translate3d(-20px, 0, -20px) rotate(-8deg); }
}

.apothecary__card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-out-expo), box-shadow 0.4s ease;
  cursor: pointer;
}

.apothecary__card:hover {
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

.apothecary__card--flipped {
  transform: rotateY(180deg);
}

.apothecary__card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.apothecary__card-front {
  background: var(--surface-raised);
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.apothecary__card-back {
  background: var(--surface);
  border: 1px solid rgba(201, 168, 76, 0.25);
  transform: rotateY(180deg);
}

.apothecary__card-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(201, 168, 76, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(139, 46, 46, 0.06) 0%, transparent 40%);
}

.apothecary__card-back img {
  width: 100%;
  height: 65%;
  object-fit: cover;
  display: block;
}

.apothecary__card-back-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(10,10,12,0.95) 0%, rgba(10,10,12,0.7) 70%, transparent 100%);
}

.apothecary__card-icon {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--gold-dim);
  opacity: 0.6;
  margin-bottom: 1rem;
}

.apothecary__card-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}

.apothecary__name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--parchment);
  margin-bottom: 0.5rem;
}

.apothecary__teaser {
  font-size: 0.9rem;
  color: var(--parchment-dim);
  font-style: italic;
  line-height: 1.5;
}

.apothecary__result {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.apothecary--revealed .apothecary__result {
  opacity: 1;
  transform: translateY(0);
}

.apothecary__draw,
.apothecary__again {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.apothecary__draw {
  background: var(--gold);
  color: var(--void);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.25);
}

.apothecary__draw:hover,
.apothecary__again:hover {
  transform: translateY(-2px);
}

.apothecary__again {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}

.apothecary__again:disabled,
.apothecary__draw:disabled {
  opacity: 0.5;
  cursor: wait;
}

.apothecary__again {
  display: none;
}

.apothecary--revealed .apothecary__draw {
  display: none;
}

.apothecary--revealed .apothecary__again {
  display: inline-block;
}

/* ── Newsletter Section ───────────────────────────────────── */
.newsletter {
  background: linear-gradient(180deg, var(--surface) 0%, var(--depth) 100%);
  text-align: center;
  border-top: 1px solid rgba(201, 168, 76, 0.06);
}

.newsletter__form {
  max-width: 520px;
  margin: 2.5rem auto 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter__input {
  flex: 1 1 280px;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 1rem 1.25rem;
  background: var(--void);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--parchment);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter__input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.newsletter__input::placeholder {
  color: var(--stone);
  font-style: italic;
}

.newsletter__note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--stone);
  font-style: italic;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--void);
  padding: 4rem 2rem 2rem;
  border-top: 1px solid rgba(201, 168, 76, 0.06);
  text-align: center;
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer__tagline {
  font-size: 1rem;
  color: var(--stone);
  margin-bottom: 2rem;
  font-style: italic;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  list-style: none;
}

.footer__links a {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__links a:hover {
  color: var(--gold);
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--stone);
  border-top: 1px solid rgba(201, 168, 76, 0.05);
  padding-top: 1.5rem;
}

/* ── Scroll Reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 12, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out-expo);
  cursor: zoom-out;
}

.lightbox--active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 90vw;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6);
  transform: scale(0.96);
  transition: transform 0.4s var(--ease-out-expo);
  cursor: default;
}

.lightbox--active .lightbox__img {
  transform: scale(1);
}

.lightbox__caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  pointer-events: none;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.65);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lightbox__close:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(34, 34, 42, 0.9);
}

/* ── Drag Scroll ──────────────────────────────────────────── */
.gallery__scroll {
  cursor: grab;
}

.gallery__scroll:active {
  cursor: grabbing;
}

.gallery__scroll--dragging {
  scroll-snap-type: none;
  user-select: none;
  cursor: grabbing;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroRise {
  from {
    transform: translateY(18px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    padding: 1rem 1.5rem;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s var(--ease-out-expo);
    border-left: 1px solid rgba(201, 168, 76, 0.1);
  }

  .nav__links--open {
    right: 0;
  }

  .nav__toggle {
    display: flex;
    z-index: 1001;
  }

  .nav__cta {
    display: none;
  }

  .hero {
    padding: 6rem 1.5rem 3rem;
  }

  .hero__art-grid {
    opacity: 0.25;
    filter: blur(5px) saturate(0.6);
  }

  .section {
    padding: 4rem 1.5rem;
  }

  .ks-banner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  .gallery__item {
    width: 260px;
  }

  .gallery__item img {
    height: 340px;
  }

  .apothecary__stage {
    width: 240px;
    height: 340px;
  }

  .apothecary__name {
    font-size: 1rem;
  }

  .lore__families {
    gap: 1.25rem;
  }

  .footer__links {
    gap: 1.25rem;
  }
}

/* Deep Ark Codex CTA */
.codex-cta {
  background: linear-gradient(180deg, var(--depth) 0%, rgba(17, 17, 21, 0.95) 100%);
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.section__cta {
  text-align: center;
  margin-top: 1.5rem;
}

.section__cta-note {
  margin-top: 1rem;
  color: var(--stone);
  font-size: 0.9rem;
  font-style: italic;
}

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

  html {
    scroll-behavior: auto;
  }
}
