:root {
  --ink: #080A0D;
  --gold: #D4AF5F;
  --rice: #F3F0E8;
  --mist: #E6EBEF;
  --chrome: #C7D0D9;
  --iris: #302746;
  --cyan: #8EF9FF;
  --titanium: #626B76;
  --slab: "Roboto Slab", Roboto, Georgia, serif;
  --slab-token: "Slab** Sla* Slabb*";
  --serif-jp: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", Roboto, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); color: var(--rice); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--ink);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .18;
  background-image: radial-gradient(circle at 20% 20%, rgba(243,240,232,.18) 0 1px, transparent 1px), radial-gradient(circle at 80% 30%, rgba(199,208,217,.12) 0 1px, transparent 1px);
  background-size: 38px 38px, 57px 57px;
  mix-blend-mode: soft-light;
}

.scroll { position: relative; }

.panel {
  min-height: 100vh;
  position: relative;
  display: grid;
  overflow: hidden;
}

.dark-panel {
  background: radial-gradient(circle at 70% 35%, rgba(48,39,70,.5), transparent 28rem), linear-gradient(135deg, #080A0D, #0c1015 55%, #080A0D);
}

.paper-panel {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(199,208,217,.34) 0 1px, transparent 1px 14%), var(--rice);
}

.site-mark {
  position: absolute;
  top: 42px;
  left: 46px;
  font-family: var(--slab);
  color: var(--chrome);
  font-size: 13px;
  letter-spacing: .34em;
  text-transform: lowercase;
}

.hero { place-items: center; }

.vertical-gate {
  position: absolute;
  top: 18vh;
  bottom: 18vh;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--titanium), var(--cyan), var(--titanium), transparent);
  box-shadow: 0 0 0 rgba(142,249,255,0);
  animation: gateGlow 4.8s ease-in-out forwards;
}

.vertical-gate span {
  position: absolute;
  top: 48%;
  left: 18px;
  writing-mode: vertical-rl;
  font-family: var(--serif-jp);
  color: var(--gold);
  letter-spacing: .5em;
  font-size: 12px;
}

.hero-droplets {
  width: min(78vw, 880px);
  height: 48vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.droplet {
  position: relative;
  width: clamp(118px, 18vw, 210px);
  aspect-ratio: 1;
  border-radius: 58% 42% 61% 39% / 46% 57% 43% 54%;
  background: radial-gradient(circle at 30% 26%, var(--rice), transparent 15%), radial-gradient(circle at 64% 68%, rgba(142,249,255,.78), transparent 23%), linear-gradient(135deg, var(--chrome), var(--iris) 58%, var(--ink));
  box-shadow: inset -18px -22px 42px rgba(8,10,13,.72), inset 20px 16px 36px rgba(243,240,232,.35), 0 0 58px rgba(142,249,255,.14);
  filter: saturate(1.05);
  animation: morph 9s ease-in-out infinite;
}

.droplet::after {
  content: attr(data-label);
  position: absolute;
  margin-top: calc(clamp(118px, 18vw, 210px) + 24px);
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--titanium);
  text-transform: uppercase;
}

.droplet-b { animation-duration: 11s; animation-delay: -2s; }

body.awakened .droplet-a { animation: morph 9s ease-in-out infinite, pulseA 1.8s ease-out 1; }
body.awakened .droplet-b { animation: morph 11s ease-in-out infinite, pulseB 2.3s ease-out .28s 1; }

.particle-field { position: absolute; inset: 18% 24%; pointer-events: none; }
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  opacity: .75;
}

.opening-caption {
  position: absolute;
  left: 9vw;
  bottom: 10vh;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

body.awakened .opening-caption { opacity: 1; transform: translateY(0); }

.chapter {
  display: block;
  font-family: var(--serif-jp);
  color: var(--gold);
  letter-spacing: .34em;
  font-size: 12px;
  margin-bottom: 18px;
}

h1, h2, h3 { font-family: var(--slab); font-weight: 400; margin: 0; letter-spacing: .04em; }
h1 { font-size: clamp(44px, 7vw, 112px); line-height: .95; color: var(--rice); }
h1 em { font-style: normal; color: var(--chrome); }
h2 { font-size: clamp(34px, 5vw, 76px); line-height: 1.02; }
h3 { font-size: clamp(28px, 3vw, 46px); line-height: 1.08; }
p { font-size: clamp(16px, 1.35vw, 20px); line-height: 1.85; font-weight: 300; }

.branch-layer {
  position: fixed;
  top: 0;
  left: 50%;
  width: 28vw;
  height: 100vh;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
  opacity: .72;
}

.branch-layer path {
  fill: none;
  stroke: var(--chrome);
  stroke-width: .22;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: var(--dash, 1);
  filter: drop-shadow(0 0 6px rgba(142,249,255,.28));
}

#branchB { stroke: var(--gold); opacity: .62; }

.editorial {
  grid-template-columns: minmax(70px, 13vw) minmax(260px, 30vw) 1fr;
  gap: 6vw;
  align-items: center;
  padding: 12vh 7vw;
}

.side-label {
  align-self: stretch;
  border-left: 1px solid var(--titanium);
  padding-left: 18px;
  writing-mode: vertical-rl;
  font-family: var(--serif-jp);
  color: var(--titanium);
  letter-spacing: .18em;
  transform: translateY(40px);
  opacity: 0;
  transition: 1s ease;
}

.side-label strong { color: var(--ink); font-family: var(--sans); font-weight: 400; }
.side-label.gold { border-color: var(--gold); color: var(--gold); }
.panel.in-view .side-label { transform: translateY(0); opacity: 1; }

.copy.narrow { max-width: 520px; }
.copy h2, .quiet-field p, .right-copy h2 { color: var(--ink); }
.quiet-field {
  min-height: 58vh;
  position: relative;
  display: grid;
  place-items: end;
  padding: 8vw;
}
.shoji-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--chrome) 1px, transparent 1px), linear-gradient(90deg, var(--chrome) 1px, transparent 1px);
  background-size: 16.66% 25%;
  opacity: .5;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 70%);
}
.quiet-field p { max-width: 410px; position: relative; }

.specimen-panel {
  grid-template-columns: 1fr minmax(300px, 46vw) minmax(260px, 27vw);
  align-items: center;
  gap: 5vw;
  padding: 10vh 7vw;
}
.specimen-label {
  font-family: var(--sans);
  color: var(--titanium);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 11px;
  justify-self: end;
}
.specimen-label span { display: block; color: var(--gold); margin-bottom: 12px; }
.simulation-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.blob, .map-blob {
  width: 70%;
  aspect-ratio: 1;
  border-radius: 53% 47% 35% 65% / 54% 39% 61% 46%;
  background: radial-gradient(circle at 38% 30%, rgba(243,240,232,.82), transparent 13%), radial-gradient(circle at 67% 60%, rgba(142,249,255,.9), transparent 21%), linear-gradient(135deg, var(--chrome), var(--iris) 56%, var(--ink));
  box-shadow: 0 0 86px rgba(142,249,255,.17), inset 0 0 44px rgba(8,10,13,.74);
  animation: bloom 12s ease-in-out infinite;
}
.ring { position: absolute; border: 1px solid rgba(199,208,217,.45); border-radius: 50%; inset: 12%; animation: ringPulse 6s ease-in-out infinite; }
.ring-two { inset: 3%; border-color: rgba(212,175,95,.34); animation-delay: -2s; }
.specimen-text { color: var(--rice); max-width: 380px; }

.twin-columns {
  grid-template-columns: minmax(260px, 1fr) 110px minmax(260px, 1fr);
  align-items: center;
  gap: 5vw;
  padding: 12vh 8vw;
}
.twin-copy {
  min-height: 54vh;
  border-top: 1px solid var(--titanium);
  padding-top: 34px;
  position: relative;
}
.sister-a { align-self: start; }
.sister-b { align-self: end; transform: translateY(9vh); }
.vertical-note {
  position: absolute;
  right: 0;
  top: 34px;
  writing-mode: vertical-rl;
  color: var(--gold);
  font-family: var(--serif-jp);
  letter-spacing: .24em;
}
.cross-seal {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif-jp);
  box-shadow: 0 0 34px rgba(212,175,95,.18);
  animation: sealBreath 5s ease-in-out infinite;
}

.selection { grid-template-columns: minmax(70px, 11vw) 1fr minmax(280px, 34vw); }
.possibility-map { position: relative; height: min(64vh, 620px); display: grid; place-items: center; }
.map-blob { width: min(62vw, 520px); opacity: .92; }
.possibility-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: var(--ink);
  color: var(--ink);
  box-shadow: 0 0 20px rgba(142,249,255,.55);
  cursor: pointer;
  transition: transform .35s ease, background .35s ease;
}
.possibility-dot span {
  position: absolute;
  left: 24px;
  top: -4px;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--titanium);
  text-transform: uppercase;
}
.dot-one { left: 32%; top: 28%; }
.dot-two { right: 27%; top: 48%; }
.dot-three { left: 47%; bottom: 21%; }
.possibility-dot.active, .possibility-dot:hover { transform: scale(1.8); background: var(--cyan); }
.selected-pulse .map-blob { animation: bloom 12s ease-in-out infinite, selectionPulse 1.1s ease-out 1; }
.story-pulse .cross-seal, .story-pulse .seal { animation: sealBreath 2.8s ease-in-out infinite; }

.invitation { place-items: center; padding: 12vh 6vw; }
.invitation-slip {
  width: min(720px, 90vw);
  min-height: 70vh;
  background: linear-gradient(90deg, transparent, rgba(199,208,217,.16), transparent), rgba(243,240,232,.035);
  border: 1px solid rgba(199,208,217,.38);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  position: relative;
}
.chrome-ring {
  width: min(46vw, 290px);
  aspect-ratio: 1;
  border: 1px solid var(--chrome);
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 26px rgba(199,208,217,.18), 0 0 50px rgba(142,249,255,.12);
}
.chrome-ring .droplet { position: absolute; width: 82px; }
.final-a { transform: translateX(-38px) scale(.82); }
.final-b { transform: translateX(38px) scale(.82); animation-delay: -4s; }
.seal {
  color: var(--gold);
  font-family: var(--serif-jp);
  border: 1px solid var(--gold);
  padding: 9px 12px;
  letter-spacing: .2em;
  animation: sealBreath 4.8s ease-in-out infinite;
}
.invitation h2 { color: var(--rice); text-align: center; }
.invitation p { color: var(--chrome); letter-spacing: .28em; text-transform: uppercase; font-size: 12px; }

.cursor-trail {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  border: 1px solid var(--cyan);
  opacity: .35;
  transform: translate(-50%, -50%);
}
.trail-b { border-color: var(--gold); width: 8px; height: 8px; opacity: .28; }

@keyframes gateGlow { to { box-shadow: 0 0 36px rgba(142,249,255,.45); } }
@keyframes morph { 0%,100% { border-radius: 58% 42% 61% 39% / 46% 57% 43% 54%; } 50% { border-radius: 39% 61% 47% 53% / 62% 38% 62% 38%; } }
@keyframes pulseA { 38% { transform: scale(1.08); box-shadow: inset -18px -22px 42px rgba(8,10,13,.72), 0 0 90px rgba(142,249,255,.42); } }
@keyframes pulseB { 45% { transform: scale(1.13); box-shadow: inset -18px -22px 42px rgba(8,10,13,.72), 0 0 82px rgba(212,175,95,.32); } }
@keyframes bloom { 0%,100% { transform: rotate(0deg) scale(1); border-radius: 53% 47% 35% 65% / 54% 39% 61% 46%; } 50% { transform: rotate(8deg) scale(1.04); border-radius: 38% 62% 58% 42% / 39% 55% 45% 61%; } }
@keyframes ringPulse { 50% { transform: scale(1.08); opacity: .35; } }
@keyframes sealBreath { 50% { box-shadow: 0 0 36px rgba(212,175,95,.34); transform: scale(1.03); } }
@keyframes selectionPulse { 40% { filter: drop-shadow(0 0 34px rgba(142,249,255,.48)); transform: scale(1.05); } }

@media (max-width: 820px) {
  .editorial, .specimen-panel, .twin-columns, .selection { grid-template-columns: 1fr; padding: 12vh 8vw; }
  .side-label, .vertical-note { writing-mode: horizontal-tb; position: static; }
  .hero-droplets { width: 86vw; }
  .branch-layer { width: 70vw; opacity: .32; }
  .specimen-label { justify-self: start; }
  .sister-b { transform: none; }
}
