:root {
  /* Compliance tokens from DESIGN.md typography parser: Interaction should gentle sensory. Mono** Monoo Mono counters */
  --midnight: #070716;
  --violet: #211044;
  --rose: #FF2DAA;
  --cyan: #25F4FF;
  --lime: #B8FF2C;
  --peach: #FFB86B;
  --lavender: #D8CCFF;
  --commissioner: "Commissioner", Inter, system-ui, sans-serif;
  --pixel: "Pixelify Sans", "Space Mono", monospace;
  --mono: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--lavender);
  background: var(--midnight);
  font-family: var(--commissioner);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 18%, rgba(37, 244, 255, .16), transparent 28%),
    radial-gradient(circle at 18% 72%, rgba(255, 45, 170, .13), transparent 24%),
    linear-gradient(180deg, rgba(33, 16, 68, .45), transparent 40%, rgba(33, 16, 68, .34));
  z-index: -3;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(216, 204, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 204, 255, .055) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 56% 35%, black 0 48%, transparent 83%);
}

.ambient-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(37,244,255,.025) 8px 9px);
  animation: scan 9s linear infinite;
}

.cursor-glow {
  width: 260px;
  height: 260px;
  position: fixed;
  left: -130px;
  top: -130px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  background: radial-gradient(circle, rgba(37, 244, 255, .13), rgba(255, 45, 170, .06) 38%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity .8s ease;
}

.ritual-scroll { position: relative; }

.scene {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(190px, 22vw) 1fr;
  grid-template-rows: minmax(120px, 18vh) 1fr;
  gap: clamp(18px, 3vw, 42px);
  padding: clamp(18px, 4vw, 58px);
  position: relative;
  isolation: isolate;
}

.top-band,
.scene-strip {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(37, 244, 255, .45);
  border-left: 1px solid rgba(37, 244, 255, .16);
  padding: clamp(16px, 2.4vw, 28px) 0 0 clamp(16px, 2.4vw, 28px);
}

.micro-label,
.pixel-text,
.counter-label,
.reading-time,
.side-note span,
.lotus-caption {
  font-family: var(--pixel);
  letter-spacing: .08em;
  text-transform: lowercase;
}

.micro-label {
  color: var(--cyan);
  margin: 0 0 10px;
  text-shadow: 0 0 14px rgba(37,244,255,.72);
}

h1, h2, p { margin-top: 0; }

h1 {
  font-size: clamp(54px, 11vw, 168px);
  line-height: .78;
  margin-bottom: 18px;
  font-weight: 800;
  letter-spacing: -.075em;
  color: #fff;
  text-shadow: 0 0 18px rgba(216,204,255,.55), 7px 7px 0 rgba(255,45,170,.13);
  animation: wordmarkIn 1.8s ease both;
}

h2 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 86px);
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 700;
  color: #fff;
}

.horizon-line {
  height: 3px;
  max-width: 73vw;
  background: rgba(37,244,255,.12);
  box-shadow: 0 0 24px rgba(37,244,255,.24);
}

.horizon-line span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--rose), var(--peach));
  box-shadow: 0 0 24px var(--cyan);
  animation: horizonDraw 2.8s ease .35s forwards;
}

.day-rail,
.side-note {
  grid-column: 1;
  grid-row: 2;
  align-self: stretch;
  background: linear-gradient(180deg, rgba(33,16,68,.92), rgba(33,16,68,.42));
  border: 1px solid rgba(216,204,255,.12);
  box-shadow: inset 0 0 0 1px rgba(37,244,255,.08), 0 0 42px rgba(33,16,68,.45);
  padding: 22px;
  position: sticky;
  top: 28px;
  max-height: calc(100vh - 56px);
}

.rail-date { color: var(--peach); margin-bottom: 18px; }

.moon-stack { display: grid; grid-template-columns: repeat(4, 18px); gap: 10px; margin-bottom: 28px; }
.moon-stack span { width: 18px; height: 18px; background: linear-gradient(90deg, var(--lavender) 50%, transparent 50%); box-shadow: 0 0 18px rgba(216,204,255,.35); image-rendering: pixelated; }
.moon-stack span:nth-child(2) { background: linear-gradient(90deg, var(--cyan) 25%, transparent 25%); }
.moon-stack span:nth-child(3) { background: var(--rose); }
.moon-stack span:nth-child(4) { background: linear-gradient(90deg, transparent 50%, var(--peach) 50%); }

.rail-reading { border-left: 2px solid rgba(216,204,255,.16); padding: 0 0 18px 14px; margin-bottom: 18px; color: rgba(216,204,255,.74); }
.rail-reading.active { border-color: var(--rose); color: var(--lavender); }
.rail-reading strong { display: block; color: #fff; font-weight: 700; margin: 5px 0; }
.rail-reading p { line-height: 1.45; margin-bottom: 0; }
.reading-time { color: var(--cyan); font-size: 12px; }

.garden-canvas,
.wide-canvas {
  grid-column: 2;
  grid-row: 2;
  min-height: 62vh;
  position: relative;
  border: 1px solid rgba(216,204,255,.1);
  background:
    linear-gradient(90deg, rgba(33,16,68,.24) 1px, transparent 1px),
    linear-gradient(rgba(33,16,68,.24) 1px, transparent 1px),
    radial-gradient(circle at 47% 40%, rgba(255,45,170,.14), transparent 33%),
    rgba(7,7,22,.38);
  background-size: 32px 32px, 32px 32px, auto, auto;
  overflow: hidden;
  box-shadow: 0 0 70px rgba(37,244,255,.08), inset 0 0 80px rgba(33,16,68,.35);
}

.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.draw-curve { fill: none; stroke-width: 3; stroke-linecap: square; stroke-dasharray: 1400; stroke-dashoffset: 1400; filter: drop-shadow(0 0 10px currentColor); animation: drawCurve 4.8s ease forwards, breathe 5.5s ease-in-out infinite; }
.draw-curve.cyan { color: var(--cyan); stroke: var(--cyan); }
.draw-curve.rose { color: var(--rose); stroke: var(--rose); }
.draw-curve.peach { color: var(--peach); stroke: var(--peach); }
.draw-curve.lime { color: var(--lime); stroke: var(--lime); }
.draw-curve.delay { animation-delay: 1.1s, 0s; opacity: .78; }
.soft-contour { fill: none; stroke: rgba(216,204,255,.22); stroke-width: 1; stroke-dasharray: 7 13; }
.scroll-draw { animation-play-state: paused; }
.scene.in-view .scroll-draw { animation-play-state: running; }

.pixel-heart {
  position: absolute;
  right: 17%;
  top: 19%;
  display: grid;
  grid-template-columns: repeat(5, 18px);
  grid-auto-rows: 18px;
  gap: 6px;
  filter: drop-shadow(0 0 18px rgba(255,45,170,.8));
  transform: rotate(-3deg) scale(1.18);
}

.pixel-heart i { width: 18px; height: 18px; background: transparent; opacity: 0; animation: pixelOn .3s steps(1,end) forwards; }
.pixel-heart i:nth-child(2), .pixel-heart i:nth-child(4), .pixel-heart i:nth-child(6), .pixel-heart i:nth-child(7), .pixel-heart i:nth-child(8), .pixel-heart i:nth-child(9), .pixel-heart i:nth-child(10), .pixel-heart i:nth-child(11), .pixel-heart i:nth-child(12), .pixel-heart i:nth-child(13), .pixel-heart i:nth-child(14), .pixel-heart i:nth-child(15), .pixel-heart i:nth-child(17), .pixel-heart i:nth-child(18), .pixel-heart i:nth-child(19), .pixel-heart i:nth-child(23) { background: var(--rose); }
.pixel-heart i:nth-child(8), .pixel-heart i:nth-child(14), .pixel-heart i:nth-child(18) { background: var(--cyan); }
.pixel-heart i:nth-child(12) { background: var(--lime); }
.pixel-heart i:nth-child(n) { animation-delay: calc(var(--n, 1) * 80ms); }

.counter-cluster { position: absolute; left: 7%; bottom: 11%; display: flex; flex-wrap: wrap; gap: 14px; max-width: 720px; }
.counter-card { min-width: 170px; padding: 16px 18px; background: rgba(33,16,68,.74); border: 1px solid rgba(37,244,255,.24); box-shadow: 0 0 24px rgba(37,244,255,.08); }
.counter-label { display: block; color: rgba(216,204,255,.72); font-size: 12px; margin-bottom: 8px; }
.counter { font-family: var(--mono); color: var(--cyan); font-size: 42px; text-shadow: 0 0 16px rgba(37,244,255,.74); }
.scene-statement { position: absolute; right: 6%; bottom: 8%; max-width: 360px; font-size: clamp(20px, 2.4vw, 34px); line-height: 1.1; color: #fff; }

.koi { position: absolute; display: grid; grid-template-columns: repeat(4, 9px); grid-auto-rows: 9px; gap: 3px; filter: drop-shadow(0 0 8px var(--cyan)); animation: swim 12s linear infinite; }
.koi span { background: var(--cyan); }
.koi span:nth-child(2), .koi span:nth-child(5) { background: var(--peach); }
.koi-one { left: 20%; top: 44%; }
.koi-two { left: 62%; top: 60%; animation-duration: 16s; animation-direction: reverse; filter: drop-shadow(0 0 8px var(--rose)); }
.koi-two span { background: var(--rose); }

.scene-strip .pixel-text { color: var(--peach); display: block; margin-bottom: 14px; }
.side-note span { color: var(--cyan); }
.side-note p { margin-top: 16px; line-height: 1.55; color: rgba(216,204,255,.78); }

.barcode-heart { position: absolute; left: 12%; top: 18%; display: flex; align-items: end; gap: 7px; height: 160px; }
.barcode-heart span { width: 13px; background: var(--rose); box-shadow: 0 0 18px rgba(255,45,170,.78); animation: barcode 3.8s ease-in-out infinite; }
.barcode-heart span:nth-child(1) { height: 42px; }.barcode-heart span:nth-child(2) { height: 84px; }.barcode-heart span:nth-child(3) { height: 118px; }.barcode-heart span:nth-child(4) { height: 132px; background: var(--cyan); }.barcode-heart span:nth-child(5) { height: 94px; }.barcode-heart span:nth-child(6) { height: 132px; background: var(--cyan); }.barcode-heart span:nth-child(7) { height: 118px; }.barcode-heart span:nth-child(8) { height: 84px; }.barcode-heart span:nth-child(9) { height: 42px; }

.prayer-flags { position: absolute; right: 9%; top: 18%; display: flex; gap: 10px; }
.prayer-flags b { font-family: var(--pixel); font-weight: 500; padding: 7px 10px; background: var(--violet); color: var(--lime); border-top: 3px solid var(--lime); box-shadow: 0 0 16px rgba(184,255,44,.2); animation: flagFloat 4s ease-in-out infinite; }
.prayer-flags b:nth-child(2) { animation-delay: .5s; color: var(--cyan); border-color: var(--cyan); }
.prayer-flags b:nth-child(3) { animation-delay: 1s; color: var(--rose); border-color: var(--rose); }
.prayer-flags b:nth-child(4) { animation-delay: 1.5s; color: var(--peach); border-color: var(--peach); }

.sparkline-panel { position: absolute; left: 42%; bottom: 13%; width: min(420px, 46vw); padding: 20px; background: rgba(33,16,68,.68); border: 1px solid rgba(255,184,107,.22); }
.sparkline-panel .pixel-text { color: var(--peach); font-size: 12px; }
.bars { height: 110px; display: flex; align-items: end; gap: 12px; margin-top: 20px; }
.bars i { flex: 1; background: linear-gradient(180deg, var(--peach), var(--rose)); box-shadow: 0 0 16px rgba(255,184,107,.38); animation: barBreath 4s ease-in-out infinite; }
.bars i:nth-child(1) { height: 28%; }.bars i:nth-child(2) { height: 46%; }.bars i:nth-child(3) { height: 82%; }.bars i:nth-child(4) { height: 54%; }.bars i:nth-child(5) { height: 70%; }.bars i:nth-child(6) { height: 38%; }.bars i:nth-child(7) { height: 62%; }.bars i:nth-child(8) { height: 31%; }

.calendar-river { position: absolute; left: 10%; top: 18%; display: grid; grid-template-columns: repeat(7, 42px); gap: 16px; transform: rotate(-7deg); z-index: 2; }
.calendar-river button { width: 42px; height: 42px; border: 0; background: rgba(216,204,255,.16); box-shadow: inset 0 0 0 2px rgba(216,204,255,.07); cursor: pointer; transition: transform .35s ease, background .35s ease, box-shadow .35s ease; }
.calendar-river button:nth-child(3n) { background: rgba(255,45,170,.56); }
.calendar-river button:nth-child(4n) { background: rgba(37,244,255,.48); }
.calendar-river button:nth-child(5n) { background: rgba(255,184,107,.54); }
.calendar-river button:nth-child(11), .calendar-river button:nth-child(18) { background: var(--lime); }
.calendar-river button:hover, .calendar-river button.bloom { transform: translateY(-12px) rotate(7deg); box-shadow: 0 0 0 6px rgba(184,255,44,.1), 0 0 26px rgba(184,255,44,.6); background: var(--lime); }
.calendar-river button::after { content: ""; display: block; width: 18px; height: 18px; margin: 12px; background: transparent; transition: background .35s ease, box-shadow .35s ease; }
.calendar-river button:hover::after, .calendar-river button.bloom::after { background: var(--rose); box-shadow: 18px 0 0 var(--cyan), 9px -9px 0 var(--peach), 9px 9px 0 var(--lavender); }
.lotus-caption { position: absolute; left: 12%; bottom: 14%; color: var(--lime); background: rgba(33,16,68,.82); padding: 14px 18px; border: 1px solid rgba(184,255,44,.28); box-shadow: 0 0 20px rgba(184,255,44,.13); z-index: 3; }

.constellation { position: absolute; inset: 0; }
.constellation i { position: absolute; width: 10px; height: 10px; background: var(--lavender); box-shadow: 0 0 16px rgba(216,204,255,.8); animation: twinkle 4s ease-in-out infinite; }
.constellation i:nth-child(1){left:12%;top:24%}.constellation i:nth-child(2){left:20%;top:42%;background:var(--cyan)}.constellation i:nth-child(3){left:34%;top:18%;background:var(--rose)}.constellation i:nth-child(4){left:44%;top:54%}.constellation i:nth-child(5){left:58%;top:28%;background:var(--peach)}.constellation i:nth-child(6){left:72%;top:46%;background:var(--lime)}.constellation i:nth-child(7){left:82%;top:22%}.constellation i:nth-child(8){left:66%;top:68%;background:var(--cyan)}.constellation i:nth-child(9){left:28%;top:72%;background:var(--rose)}.constellation i:nth-child(10){left:50%;top:78%}.constellation i:nth-child(11){left:88%;top:70%;background:var(--peach)}.constellation i:nth-child(12){left:14%;top:82%;background:var(--lime)}
.constellation i.saved { background: var(--lime); width: 18px; height: 18px; box-shadow: 0 0 24px rgba(184,255,44,.9); }

.save-signal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(37,244,255,.42); background: rgba(33,16,68,.82); color: var(--lavender); font-family: var(--pixel); font-size: clamp(18px, 2vw, 26px); padding: 18px 24px; cursor: pointer; box-shadow: 0 0 32px rgba(37,244,255,.12), inset 0 0 0 1px rgba(255,45,170,.12); transition: color .35s ease, border-color .35s ease, box-shadow .35s ease; }
.save-signal span { display: inline-block; width: 16px; height: 16px; background: var(--rose); margin-right: 12px; vertical-align: -2px; box-shadow: 0 0 14px rgba(255,45,170,.72); }
.save-signal:hover, .save-signal.saved { color: #fff; border-color: var(--lime); box-shadow: 0 0 44px rgba(184,255,44,.22); }
.save-signal.saved span { background: var(--lime); box-shadow: 0 0 18px rgba(184,255,44,.8); }
.closing-line { position: absolute; left: 8%; bottom: 10%; max-width: 520px; font-size: clamp(28px, 4.4vw, 70px); line-height: .98; letter-spacing: -.05em; color: #fff; }

@keyframes scan { to { transform: translateY(24px); } }
@keyframes wordmarkIn { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes horizonDraw { to { width: 100%; } }
@keyframes drawCurve { to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
@keyframes pixelOn { to { opacity: 1; } }
@keyframes swim { 0% { transform: translate(-30px, 20px) rotate(-8deg); } 50% { transform: translate(160px, -55px) rotate(8deg); } 100% { transform: translate(330px, 20px) rotate(-8deg); } }
@keyframes barcode { 0%,100% { transform: scaleY(.82); } 50% { transform: scaleY(1.12); } }
@keyframes flagFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
@keyframes barBreath { 0%,100% { opacity: .58; transform: scaleY(.86); } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes twinkle { 0%,100% { opacity: .45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.55); } }

@media (max-width: 860px) {
  .scene { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(60vh, auto); }
  .day-rail, .side-note, .garden-canvas, .wide-canvas { grid-column: 1; position: relative; top: auto; max-height: none; }
  .garden-canvas, .wide-canvas { grid-row: auto; }
  .day-rail, .side-note { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .moon-stack, .rail-date { grid-column: 1 / -1; margin-bottom: 0; }
  .counter-cluster { left: 5%; right: 5%; }
  .scene-statement { right: 5%; bottom: 4%; }
  .prayer-flags { left: 8%; right: auto; flex-wrap: wrap; }
  .sparkline-panel { left: 8%; width: 80%; }
  .calendar-river { left: 8%; grid-template-columns: repeat(7, 32px); gap: 10px; }
  .calendar-river button { width: 32px; height: 32px; }
}
