/* === BASE === */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

:root {
  --navy: #0A1628;
  --gold: #C9A84C;
  --mid-dark: #142240;
  --mid-light: #A68A3A;
  --bright: #E4C560;
  --parchment: #F0E6C8;
  --periwinkle: #4A5A7A;
  --obsidian: #0D2030;
  --font-display: 'Playfair Display', serif;
  --font-display-sc: 'Playfair Display SC', serif;
  --font-body: 'Space Grotesk', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: #B8C4D4;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* === BUBBLE COLUMN === */
.bubble-column {
  position: fixed;
  right: 0;
  top: 0;
  width: 48px;
  height: 100vh;
  background: rgba(10,22,40,0.15);
  z-index: 100;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.3);
  background: radial-gradient(circle at 35% 35%, rgba(201,168,76,0.15), transparent 70%);
  animation: bubble-rise linear infinite;
}

.b1{width:12px;height:12px;left:8px;animation-duration:6s;animation-delay:0s;}
.b2{width:8px;height:8px;left:22px;animation-duration:8s;animation-delay:1s;}
.b3{width:16px;height:16px;left:14px;animation-duration:5s;animation-delay:0.5s;}
.b4{width:6px;height:6px;left:30px;animation-duration:9s;animation-delay:2s;}
.b5{width:10px;height:10px;left:5px;animation-duration:7s;animation-delay:3s;}
.b6{width:14px;height:14px;left:18px;animation-duration:5.5s;animation-delay:1.5s;}
.b7{width:8px;height:8px;left:28px;animation-duration:8.5s;animation-delay:4s;}
.b8{width:20px;height:20px;left:10px;animation-duration:6.5s;animation-delay:2.5s;}
.b9{width:7px;height:7px;left:34px;animation-duration:7.5s;animation-delay:0.8s;}
.b10{width:11px;height:11px;left:16px;animation-duration:9.5s;animation-delay:3.5s;}

@keyframes bubble-rise {
  0% { bottom: -20px; opacity: 0; transform: translateX(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { bottom: 100vh; opacity: 0; transform: translateX(calc(sin(var(--drift, 0)) * 8px)); }
}

/* === CHAPTERS === */
.chapter {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* === BACKGROUND BUBBLES === */
.bg-bubbles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.bg-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.02) 60%, transparent 70%);
}

/* === THE SURFACE === */
.surface {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.ornate-border {
  position: absolute;
  top: 5%; left: 5%;
  width: 90%; height: 90%;
  pointer-events: none;
}

.border-svg { width: 100%; height: 100%; }
.border-outer, .border-inner {
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  transition: stroke-dashoffset 2s ease;
}
.ornate-border.visible .border-outer,
.ornate-border.visible .border-inner {
  stroke-dashoffset: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 10rem);
  color: var(--gold);
  letter-spacing: 0.08em;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  color: var(--periwinkle);
  text-align: center;
  margin-top: 1.5rem;
  position: relative;
  z-index: 2;
  letter-spacing: 0.04em;
}

.scroll-chevron {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  animation: chevron-pulse 2s ease-in-out infinite;
}

@keyframes chevron-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* === SECTION DIVIDER === */
.section-divider {
  padding: 1rem 0;
  background: var(--navy);
}

.section-divider svg {
  width: 100%;
  height: 80px;
  display: block;
}

.divider-path {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-divider.visible .divider-path {
  stroke-dashoffset: 0;
}

/* === THE CABINET === */
.cabinet {
  min-height: 120vh;
  background: var(--navy);
  padding: 6rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

/* === SPECIMEN CARDS === */
.specimen-card {
  background: var(--mid-dark);
  border: 2px solid var(--gold);
  position: relative;
  padding: 2.5rem;
  max-width: 600px;
  width: 90%;
  transform: rotate(var(--card-rot, 0deg));
}

.specimen-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px;
  right: 6px; bottom: 6px;
  border: 1px solid var(--gold);
  pointer-events: none;
}

/* Stipple pattern */
.specimen-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(201,168,76,0.05) 1px, transparent 1px);
  background-size: 6px 6px;
  pointer-events: none;
}

/* Hover bubbles */
.specimen-card:hover::before {
  box-shadow: 0 -4px 8px rgba(201,168,76,0.1);
}

.card-fleuron {
  position: absolute;
  color: var(--gold);
  font-size: 14px;
  line-height: 1;
}
.card-fleuron.tl { top: -7px; left: -7px; }
.card-fleuron.tr { top: -7px; right: -7px; transform: rotate(90deg); }
.card-fleuron.bl { bottom: -7px; left: -7px; transform: rotate(270deg); }
.card-fleuron.br { bottom: -7px; right: -7px; transform: rotate(180deg); }

.card-label {
  font-family: var(--font-display-sc);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-light);
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.card-body {
  color: #B8C4D4;
  line-height: 1.72;
}

.card-1 { align-self: flex-start; }
.card-2 { align-self: flex-end; }
.card-3 { align-self: center; }

/* === THE AQUARIUM === */
.aquarium {
  min-height: 100vh;
  background: var(--obsidian);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.aquarium-scene {
  width: 90%;
  max-width: 800px;
}

.aquarium-svg {
  width: 100%;
  height: auto;
}

.fish {
  animation: fish-swim 8s ease-in-out infinite alternate;
}
.fish-1 { animation-duration: 8s; }
.fish-2 { animation-duration: 10s; animation-delay: 2s; }
.fish-3 { animation-duration: 7s; animation-delay: 1s; }

@keyframes fish-swim {
  0% { transform: translateX(0); }
  100% { transform: translateX(30px); }
}

.plate-caption {
  font-family: var(--font-display-sc);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--periwinkle);
  text-align: center;
  margin-top: 2rem;
}

/* === THE WORKSHOP === */
.workshop {
  min-height: 120vh;
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.workshop-card {
  background: var(--parchment);
  border: 2px solid var(--navy);
  position: relative;
  padding: 3rem;
  max-width: 800px;
  width: 90%;
}

.workshop-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px;
  right: 6px; bottom: 6px;
  border: 1px solid var(--navy);
  pointer-events: none;
}

.workshop-card .card-label {
  color: var(--navy);
}

.workshop-text {
  color: #1A2744;
}

.workshop-text p {
  margin-bottom: 1rem;
}

.drop-cap {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 8vw, 6rem);
  line-height: 0.8;
  margin-right: 0.5rem;
  color: var(--navy);
}

.text-divider {
  text-align: center;
  margin: 1.5rem 0;
}

.text-divider svg {
  width: 200px;
  height: 20px;
}

/* === THE SEAL === */
.seal {
  min-height: 60vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.wax-seal {
  width: 80px;
  height: 80px;
}

.seal-svg {
  width: 100%;
  height: 100%;
}

.seal-text {
  font-family: var(--font-display-sc);
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--periwinkle);
  text-align: center;
}

/* === REVEAL ANIMATION === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease-out, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: transform, opacity;
}

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

.specimen-card.reveal.visible {
  transform: translateY(0) rotate(var(--card-rot, 0deg));
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .bubble-column { width: 32px; }
  .cabinet { padding: 3rem 1.5rem; }
  .specimen-card {
    transform: rotate(0deg) !important;
    width: 95%;
  }
  .specimen-card.reveal.visible {
    transform: translateY(0) rotate(0deg) !important;
  }
  .card-1, .card-2, .card-3 { align-self: center; }
  .ornate-border { display: none; }
}
