:root {
  --wet-night: #10071F;
  --vermilion: #FF2A6D;
  --aurora-teal: #77FFE1;
  --prism-magenta: #FF4FD8;
  --deep-violet: #6A1B9A;
  --pearl: #F6E7B8;
  --acid: #C8FF00;
  --chrome: #B9B7D8;
  --serif: "Cormorant Garamond", Georgia, serif;
  --jp: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --tech: "Space Grotesk", Inter, system-ui, sans-serif;
  --design-token: "Grotesk**";
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; overflow: hidden; }

body {
  background: var(--wet-night);
  color: var(--pearl);
  font-family: var(--tech);
}

button { font: inherit; }

.shrine-camera {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 52%, rgba(119,255,225,0.14), transparent 18%),
    radial-gradient(circle at 18% 20%, rgba(255,79,216,0.2), transparent 26%),
    radial-gradient(circle at 82% 80%, rgba(106,27,154,0.5), transparent 30%),
    linear-gradient(145deg, #10071F 0%, #180828 42%, #06020c 100%);
}

.shrine-camera::before,
.shrine-camera::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
}

.shrine-camera::before {
  background:
    repeating-conic-gradient(from 12deg, rgba(255,79,216,0.06) 0deg 5deg, transparent 5deg 10deg),
    radial-gradient(circle, transparent 0 28%, rgba(185,183,216,0.08) 28.4% 28.8%, transparent 29.2% 100%);
  animation: slowSpin 32s linear infinite;
  mix-blend-mode: screen;
}

.shrine-camera::after {
  background: linear-gradient(105deg, transparent 20%, rgba(246,231,184,0.08), rgba(119,255,225,0.1), transparent 54%);
  transform: translateX(-34%);
  animation: prismSweep 9s ease-in-out infinite;
}

.grain-layer {
  position: absolute;
  inset: 0;
  opacity: .36;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 24%, rgba(246,231,184,0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 34%, rgba(200,255,0,0.65) 0 1px, transparent 1.8px),
    radial-gradient(circle at 42% 70%, rgba(255,79,216,0.55) 0 1px, transparent 1.7px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 41px 37px, 67px 59px, 83px 71px, 3px 100%;
  animation: shimmerNoise 1.8s steps(2,end) infinite;
  mix-blend-mode: screen;
}

.aurora-wash {
  position: absolute;
  inset: -10%;
  opacity: .2;
  background: conic-gradient(from var(--wash-angle, 0deg), rgba(255,42,109,.0), rgba(255,79,216,.46), rgba(119,255,225,.35), rgba(106,27,154,.5), rgba(255,42,109,.0));
  filter: blur(42px);
  transition: opacity 700ms ease, transform 900ms ease;
}

.film-burn {
  position: absolute;
  width: 34vw;
  height: 56vh;
  border-radius: 50%;
  border: 1px solid rgba(246,231,184,.18);
  filter: blur(.2px);
  opacity: .34;
  mix-blend-mode: screen;
}

.burn-one { left: -13vw; top: 10vh; background: radial-gradient(circle, rgba(255,42,109,.18), transparent 61%); }
.burn-two { right: -13vw; bottom: 3vh; background: radial-gradient(circle, rgba(119,255,225,.16), transparent 60%); }

.chrome-torii {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(760px, 76vw);
  height: 74px;
  transform: translateX(-50%);
  opacity: .88;
}

.chrome-torii span { position: absolute; display: block; background: linear-gradient(90deg, transparent, var(--chrome), var(--pearl), var(--vermilion), transparent); box-shadow: 0 0 28px rgba(255,79,216,.35); }
.chrome-torii span:nth-child(1) { top: 0; left: 0; right: 0; height: 5px; border-radius: 999px; }
.chrome-torii span:nth-child(2) { top: 18px; left: 10%; right: 10%; height: 2px; }
.chrome-torii span:nth-child(3) { top: 26px; left: 50%; width: 2px; height: 48px; background: var(--chrome); }

.exposure-counter {
  position: absolute;
  left: 28px;
  bottom: 30px;
  z-index: 8;
  display: grid;
  gap: 10px;
}

.counter-dot {
  cursor: pointer;
  color: rgba(185,183,216,.68);
  background: rgba(16,7,31,.34);
  border: 1px solid rgba(185,183,216,.18);
  border-radius: 999px;
  padding: 8px 13px;
  text-align: left;
  letter-spacing: .16em;
  font-size: 10px;
  text-transform: uppercase;
  transition: color 250ms ease, border-color 250ms ease, transform 250ms ease, background 250ms ease;
}

.counter-dot.active { color: var(--acid); border-color: rgba(200,255,0,.68); background: rgba(106,27,154,.36); transform: translateX(8px); }

.charm-rail {
  position: absolute;
  top: 12vh;
  bottom: 12vh;
  width: 150px;
  z-index: 5;
  display: flex;
  justify-content: center;
}
.rail-left { left: clamp(18px, 7vw, 116px); }
.rail-right { right: clamp(18px, 7vw, 116px); }
.cord { width: 3px; height: 72%; background: linear-gradient(var(--vermilion), var(--prism-magenta), var(--aurora-teal)); border-radius: 999px; box-shadow: 0 0 18px rgba(255,79,216,.5); }
.omamori {
  position: absolute;
  top: 25%;
  width: 94px;
  min-height: 132px;
  padding: 18px 10px 12px;
  clip-path: polygon(50% 0, 88% 16%, 88% 100%, 12% 100%, 12% 16%);
  text-align: center;
  color: var(--pearl);
  border: 1px solid rgba(246,231,184,.5);
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.45));
  transform-origin: 50% -60px;
  animation: charmSway 4.6s ease-in-out infinite;
}
.rail-right .omamori { animation-delay: -1.4s; }
.omamori-rose { background: linear-gradient(150deg, rgba(255,42,109,.88), rgba(106,27,154,.86)); }
.omamori-teal { background: linear-gradient(150deg, rgba(119,255,225,.72), rgba(106,27,154,.9)); }
.omamori b { display: block; font-family: var(--jp); font-size: 28px; margin-bottom: 12px; }
.omamori span { font-size: 9px; line-height: 1.4; letter-spacing: .16em; text-transform: uppercase; }
.bead-chain { position: absolute; top: 8%; display: grid; gap: 10px; }
.bead-chain i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 30% 20%, white, var(--chrome) 34%, var(--deep-violet)); box-shadow: 0 0 12px rgba(119,255,225,.5); }
.bell { position: absolute; bottom: 13%; color: var(--acid); font-size: 34px; text-shadow: 0 0 22px var(--acid); animation: bellGlow 2.8s ease-in-out infinite; }

.aperture-stage {
  position: relative;
  width: min(86vw, 720px);
  height: min(86vw, 720px);
  max-height: 82vh;
  display: grid;
  place-items: center;
  z-index: 4;
}

.ritual-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 14px rgba(255,79,216,.34)); }
.draw-line { fill: none; stroke: url(#strokeAurora); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1500; stroke-dashoffset: 1500; filter: url(#glow); animation: drawPath 2.8s cubic-bezier(.2,.72,.08,1) forwards; }
.focus-line { animation-delay: .55s; stroke: var(--aurora-teal); }
.charm-line { animation-delay: .9s; stroke: var(--prism-magenta); }
.shide-line { animation-delay: 1.25s; stroke: var(--pearl); }
.ring-line { animation-delay: 1.45s; stroke: rgba(185,183,216,.82); }
.ring-line.delay { animation-delay: 1.7s; stroke: var(--acid); opacity: .64; }

.lens-tilt {
  position: relative;
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
}
.lens-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(246,231,184,.38); box-shadow: inset 0 0 34px rgba(255,79,216,.16), 0 0 34px rgba(119,255,225,.16); }
.outer-ring { inset: -24%; background: conic-gradient(from 0deg, transparent, rgba(255,79,216,.32), transparent, rgba(119,255,225,.25), transparent); animation: slowSpin 18s linear infinite; }
.middle-ring { inset: -11%; background: repeating-conic-gradient(from 16deg, rgba(185,183,216,.14) 0 4deg, transparent 4deg 9deg); animation: reverseSpin 15s linear infinite; }
.inner-ring { inset: 1%; border-color: rgba(200,255,0,.5); animation: pulseRing 3.4s ease-in-out infinite; }

.oracle-aperture {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 45% 34%, rgba(246,231,184,.85) 0 2px, transparent 3px),
    radial-gradient(circle at var(--glint-x, 50%) var(--glint-y, 35%), rgba(246,231,184,.95), rgba(119,255,225,.32) 18%, transparent 36%),
    conic-gradient(from 210deg, rgba(255,42,109,.85), rgba(119,255,225,.86), rgba(106,27,154,.9), rgba(255,79,216,.8), rgba(255,42,109,.85));
  box-shadow: inset 0 0 22px rgba(16,7,31,.8), inset 0 0 90px rgba(255,255,255,.2), 0 0 60px rgba(255,79,216,.38), 0 0 110px rgba(119,255,225,.2);
  animation: apertureReveal 2.5s cubic-bezier(.2,.8,.1,1) both;
}
.oracle-aperture::before { content:""; position:absolute; inset:7%; border-radius:50%; background: radial-gradient(circle, rgba(16,7,31,.58), rgba(16,7,31,.2) 45%, transparent 68%); }
.oracle-aperture::after { content:""; position:absolute; inset:-40%; background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.58), transparent 52%); transform: translateX(-30%) rotate(8deg); animation: lensFlash 4.2s ease-in-out infinite; }
.pearl-glint { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--pearl); box-shadow: 0 0 20px 7px rgba(246,231,184,.82); animation: glintBirth 1.6s ease both; z-index: 5; }
.torii-shadow { position:absolute; width: 74%; height: 44%; top: 26%; border-top: 13px solid rgba(16,7,31,.44); border-bottom: 7px solid rgba(16,7,31,.24); }
.torii-shadow::before, .torii-shadow::after { content:""; position:absolute; top:0; width: 10px; height: 110%; background: rgba(16,7,31,.35); }
.torii-shadow::before { left: 24%; } .torii-shadow::after { right: 24%; }

h1 {
  position: relative;
  z-index: 4;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(58px, 9vw, 116px);
  line-height: .86;
  letter-spacing: .025em;
  color: transparent;
  background: linear-gradient(105deg, var(--pearl), var(--chrome), white, var(--aurora-teal), var(--pearl));
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 28px rgba(246,231,184,.18);
  animation: titleReveal 2.9s ease both, chromeText 3.8s linear infinite;
}
.ritual-phrase {
  position: absolute;
  z-index: 4;
  bottom: 23%;
  margin: 0;
  color: var(--acid);
  font: 600 11px/1 var(--tech);
  letter-spacing: .28em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(200,255,0,.7);
}
.orbit-caption { position:absolute; left:50%; color: rgba(246,231,184,.72); font: 600 10px/1 var(--tech); letter-spacing: .34em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 12px rgba(255,79,216,.46); }
.caption-top { top: 10%; transform: translateX(-50%); }
.caption-bottom { bottom: 10%; transform: translateX(-50%); }

.exposure-copy {
  position: absolute;
  right: clamp(22px, 5vw, 86px);
  bottom: clamp(92px, 12vh, 140px);
  z-index: 7;
  text-align: right;
  transition: opacity 360ms ease, transform 360ms ease;
}
.exposure-copy.changing { opacity: 0; transform: translateY(12px); }
.jp-label { margin:0 0 10px; color: var(--chrome); font-family: var(--jp); font-size: 15px; letter-spacing: .4em; writing-mode: vertical-rl; display: inline-block; vertical-align: top; }
.exposure-copy h2 { margin:0; font-family: var(--serif); font-size: clamp(34px, 5vw, 66px); font-style: italic; font-weight:600; color: var(--pearl); text-shadow: 0 0 24px rgba(255,79,216,.3); }
.exposure-copy p:last-child { margin: 8px 0 0; color: var(--aurora-teal); letter-spacing: .22em; text-transform: uppercase; font-size: 11px; }
.film-counter { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 8; display: flex; gap: 22px; color: rgba(185,183,216,.74); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }

body[data-exposure="1"] .aurora-wash { opacity: .34; transform: rotate(12deg) scale(1.08); }
body[data-exposure="1"] .oracle-aperture { box-shadow: inset 0 0 32px rgba(16,7,31,.75), 0 0 78px rgba(255,79,216,.56); }
body[data-exposure="2"] .aurora-wash { opacity: .55; transform: rotate(50deg) scale(1.18); }
body[data-exposure="2"] .outer-ring { animation-duration: 9s; }
body[data-exposure="3"] .aurora-wash { opacity: .9; filter: blur(24px); }
body[data-exposure="3"] .shrine-camera, body[data-exposure="3"] { background-color: var(--pearl); }
body[data-exposure="3"] .oracle-aperture { background: radial-gradient(circle, rgba(246,231,184,.98), rgba(119,255,225,.72), rgba(255,79,216,.65)); }

@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes glintBirth { 0% { transform: scale(.2); opacity: 0; } 38% { transform: scale(1.6); opacity: 1; } 100% { transform: translate(-72px,-66px) scale(1); } }
@keyframes apertureReveal { 0% { clip-path: circle(2% at 50% 50%); filter: brightness(.4); } 100% { clip-path: circle(75% at 50% 50%); filter: brightness(1); } }
@keyframes titleReveal { 0%, 56% { opacity: 0; transform: translateY(16px) scale(.95); } 100% { opacity: 1; transform: none; } }
@keyframes chromeText { to { background-position: 240% 0; } }
@keyframes lensFlash { 0%, 55% { transform: translateX(-48%) rotate(8deg); opacity: 0; } 72% { opacity: .9; } 100% { transform: translateX(48%) rotate(8deg); opacity: 0; } }
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes reverseSpin { to { transform: rotate(-360deg); } }
@keyframes pulseRing { 0%, 100% { opacity: .5; transform: scale(.98); } 50% { opacity: 1; transform: scale(1.02); } }
@keyframes prismSweep { 0%,100% { transform: translateX(-34%); opacity:.25; } 50% { transform: translateX(34%); opacity:.55; } }
@keyframes shimmerNoise { 0% { transform: translate(0,0); } 100% { transform: translate(2px,-2px); } }
@keyframes charmSway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@keyframes bellGlow { 0%,100% { transform: translateY(0); opacity:.7; } 50% { transform: translateY(6px); opacity:1; } }

@media (max-width: 820px) {
  .charm-rail { opacity: .48; }
  .rail-left { left: -34px; }
  .rail-right { right: -34px; }
  .exposure-copy { right: 20px; bottom: 110px; }
  .exposure-counter { left: 18px; bottom: 82px; }
  .counter-dot { width: 10px; height: 10px; padding: 0; overflow: hidden; color: transparent; }
  .film-counter { width: 92vw; justify-content: space-between; gap: 8px; }
}
