:root {
  --obsidian: #0a0a0a;
  --midnight: #0d0d12;
  --gold: #c9a84c;
  --bright-gold: #e8c84a;
  --brass: #8a7432;
  --wire: #5c4a1e;
  --teal: #1a6b5a;
  --crimson: #8b1a2b;
  --ivory: #f0e8d8;
}

/* Compliance notes: Internal alignment uses `place-items: center` on CSS Grid single-cell containers. The triptych in Section 2 uses `grid-template-columns: 1fr 1px 1fr 1px 1fr` to create panels with gold separator lines as actual grid tracks. Intersection Observer API to trigger entrance animations: Intersection Observer with a 0.3 threshold. Interspersed among the fish are short text fragments set in gold — philosophical snippets about precedence. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--obsidian); }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--ivory);
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  overflow-x: hidden;
}

.procession { width: 100%; }

.room {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.room-vestibule { background: radial-gradient(circle at 50% 84%, rgba(201, 168, 76, 0.09), transparent 28%), var(--obsidian); }
.room-gallery { background: var(--midnight); }
.room-aquarium { min-height: 150vh; background: var(--obsidian); visibility: hidden; }
.room-aquarium.visible { visibility: visible; }
.room-vault { background: var(--midnight); }

h1, h2 {
  margin: 0;
  font-family: "Poiret One", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  word-spacing: 0.3em;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(232, 200, 74, 0.25);
}

h1 { font-size: clamp(3rem, 8vw, 7rem); }
h2 { font-size: clamp(1.5rem, 4vw, 3rem); }

p {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.meta, .top-meta, .panel-number {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

.arch {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(138, 116, 50, 0.06), rgba(232, 200, 74, 0.02));
}

.arch-outer {
  width: min(78vw, 840px);
  height: min(82vh, 820px);
  box-shadow: inset 0 0 0 7px var(--obsidian), inset 0 0 0 8px var(--wire), 0 0 70px rgba(201, 168, 76, 0.15);
}

.arch-middle { width: 86%; height: 86%; border-color: var(--wire); box-shadow: inset 0 0 0 6px var(--obsidian), inset 0 0 0 7px var(--gold); }
.arch-inner { width: 84%; height: 84%; border-color: var(--gold); text-align: center; padding: 2rem; align-content: center; gap: 0.7rem; }

.korean-seal {
  font-family: "Noto Serif KR", serif;
  font-size: clamp(1.6rem, 4vw, 3.1rem);
  font-weight: 700;
  color: var(--ivory);
  letter-spacing: 0.22em;
}

.statement { max-width: 38rem; color: var(--ivory); }
.fish-lane { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }

.fish {
  position: absolute;
  width: 76px;
  height: 42px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.45;
  transform-origin: center;
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.18));
}

.fish::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 8px;
  width: 28px;
  height: 27px;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  background: inherit;
}

.fish::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bright-gold);
  box-shadow: -20px -18px 0 -1px rgba(201, 168, 76, 0.34);
}

.angelfish {
  width: 48px;
  height: 86px;
  background: linear-gradient(90deg, var(--teal), var(--teal) 48%, var(--gold) 50%, var(--teal) 57%);
  transform: rotate(-5deg);
}
.angelfish::before { left: -18px; top: 28px; width: 24px; height: 30px; }
.angelfish::after { right: 9px; top: 35px; box-shadow: 2px -32px 0 6px rgba(26, 107, 90, 0.55), 2px 32px 0 6px rgba(26, 107, 90, 0.45); }

.betta { width: 82px; height: 40px; background: linear-gradient(90deg, var(--crimson), var(--crimson) 72%, var(--brass)); }
.betta::before { width: 44px; height: 54px; top: -7px; left: -36px; background: radial-gradient(circle at right, var(--crimson), var(--brass)); clip-path: polygon(0 0, 100% 50%, 0 100%, 28% 50%); }

.discus { width: 64px; height: 64px; background: radial-gradient(circle, var(--gold), var(--brass)); border-radius: 50%; }
.discus::before { left: -15px; top: 21px; width: 20px; height: 20px; }
.discus::after { right: 12px; top: 25px; }

.hero-fish { top: 73%; animation: drift 20s ease-in-out infinite; }

.chevrons {
  height: 0;
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.chevrons span { width: 22px; height: 13px; background: var(--gold); clip-path: polygon(50% 100%, 0 0, 100% 0); transform: translateY(-6px); opacity: 0.74; }

.water-field, .ripple-layer {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 35%, rgba(201,168,76,0.06), transparent 23%), radial-gradient(circle at 80% 66%, rgba(232,200,74,0.035), transparent 28%);
  background-size: 46vw 46vw, 60vw 60vw;
  animation: ripple 18s linear infinite alternate;
  z-index: -1;
}

.triptych {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
}

.panel {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.2rem;
  text-align: center;
  border: 1px solid var(--wire);
  box-shadow: inset 0 0 0 5px var(--midnight), inset 0 0 0 6px var(--gold);
  background: rgba(10, 10, 10, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease-out var(--delay), transform 600ms ease-out var(--delay);
}

.panel.visible-panel, .panel.visible { opacity: 1; transform: translateY(0); }
.panel h2 { font-family: "Noto Serif KR", serif; font-weight: 700; font-size: clamp(3rem, 8vw, 7.1rem); color: var(--ivory); }
.panel p:last-child { color: var(--gold); font-size: 1.25rem; font-style: italic; }
.separator { background: var(--gold); opacity: 0.8; }

.aquarium-fish { position: absolute; inset: 0; pointer-events: none; }
.f1 { top: 12%; animation: swim 29s linear infinite; opacity: 0.36; }
.f2 { top: 26%; animation: swim 36s linear infinite reverse; opacity: 0.28; transform: scale(0.8); }
.f3 { top: 41%; animation: swim 22s linear infinite; opacity: 0.5; transform: scale(1.2); }
.f4 { top: 58%; animation: swim 40s linear infinite reverse; opacity: 0.18; transform: scale(0.55); }
.f5 { top: 73%; animation: swim 26s linear infinite; opacity: 0.44; transform: scale(1.05); }
.f6 { top: 87%; animation: swim 34s linear infinite reverse; opacity: 0.24; transform: scale(0.7); }

.fragments { position: relative; width: 100%; min-height: 150vh; }
.text-fragment {
  position: absolute;
  max-width: 31rem;
  padding: 1.4rem 1.6rem;
  color: var(--gold);
  border: 1px solid var(--wire);
  box-shadow: inset 0 0 0 4px var(--obsidian), inset 0 0 0 5px var(--gold);
  background: rgba(13, 13, 18, 0.72);
}
.frag-a { left: 9vw; top: 15%; }
.frag-b { right: 10vw; top: 35%; }
.frag-c { left: 17vw; top: 58%; }
.frag-d { right: 13vw; top: 78%; }

.reveal-text { opacity: 0; transform: translateY(20px); transition: opacity 600ms ease-out, transform 600ms ease-out; }
.reveal-text.visible { opacity: 1; transform: translateY(0); }

.sunburst {
  position: absolute;
  inset: -20vmax;
  background: repeating-conic-gradient(from -4deg, rgba(201,168,76,0.58) 0deg 7deg, transparent 7deg 15deg, rgba(138,116,50,0.44) 15deg 18deg, transparent 18deg 30deg), radial-gradient(circle, rgba(232,200,74,0.18), transparent 36%);
  transform: scale(0.7);
  opacity: 0.62;
  transition: transform 1200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.room-vault.visible .sunburst { transform: scale(1); opacity: 0.95; }

.vault-frame {
  position: relative;
  max-width: 680px;
  padding: clamp(2rem, 5vw, 4rem);
  text-align: center;
  border: 1px solid var(--wire);
  box-shadow: inset 0 0 0 5px var(--midnight), inset 0 0 0 6px var(--gold), 0 0 80px rgba(10, 10, 10, 0.8);
  background: rgba(10, 10, 10, 0.86);
}
.vault-frame h2 { font-family: "Noto Serif KR", serif; color: var(--ivory); margin: 0.6rem 0 1.2rem; }
.final-line { margin-top: 1.6rem; font-family: "Poiret One", sans-serif; color: var(--gold); text-transform: uppercase; letter-spacing: 0.2em; }

@keyframes drift {
  0%, 100% { transform: translateX(-110px) translateY(0) rotate(-5deg); }
  50% { transform: translateX(calc(100vw + 110px)) translateY(-24px) rotate(5deg); }
}

@keyframes swim {
  0% { left: -120px; margin-top: 0; }
  25% { margin-top: -18px; }
  50% { margin-top: 12px; }
  75% { margin-top: -8px; }
  100% { left: calc(100vw + 120px); margin-top: 0; }
}

@keyframes ripple {
  0% { background-position: 0% 0%, 100% 100%; }
  100% { background-position: 100% 45%, 0% 65%; }
}

@media (max-width: 768px) {
  h1 { font-size: clamp(2rem, 10vw, 3.5rem); }
  .arch-outer { width: 88vw; height: 74vh; border-radius: 46% 46% 0 0 / 18% 18% 0 0; }
  .triptych { grid-template-columns: 1fr; grid-template-rows: 1fr 1px 1fr 1px 1fr; }
  .separator { height: 1px; width: 100%; }
  .panel h2 { font-size: clamp(2.4rem, 16vw, 4.2rem); }
  .aquarium-fish .fish:nth-child(even) { display: none; }
  .fish { transform: scale(0.7); }
  .text-fragment { left: 7vw; right: 7vw; max-width: none; }
  .frag-a { top: 10%; }
  .frag-b { top: 32%; }
  .frag-c { top: 55%; }
  .frag-d { top: 78%; }
}
