:root {
  --deep-wine: #3A0715;
  --black-cherry: #16060B;
  --cream: #F7E8CF;
  --pearl: #FFF7E8;
  --rose: #B86B7A;
  --cyan: #8FE9FF;
  --lilac: #C9A7FF;
  --gold: #F4C86A;
  --plum: #5C2433;
  --body: "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter", system-ui, sans-serif;
  --tech: "IBM Plex Sans", "Noto Sans", system-ui, sans-serif;
  --design-font-markers: "Sans* Inter* Sans** Inter**";
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--plum);
  background:
    radial-gradient(circle at 7% 8%, rgba(58, 7, 21, .24), transparent 28vw),
    radial-gradient(circle at 93% 18%, rgba(143, 233, 255, .28), transparent 24vw),
    radial-gradient(circle at 75% 85%, rgba(201, 167, 255, .24), transparent 30vw),
    linear-gradient(145deg, var(--pearl), var(--cream) 46%, #f2d8c7 100%);
  overflow-x: hidden;
}

.dream-desk {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.mist-field,
.grain,
.scan-halo,
.ink-pool {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.mist-field { z-index: -3; overflow: hidden; }

.grain {
  opacity: .3;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(92, 36, 51, .12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(255, 247, 232, .72) 0 1px, transparent 1.4px);
  background-size: 34px 34px, 19px 19px;
}

.ink-pool {
  filter: blur(44px);
  opacity: .58;
  mix-blend-mode: multiply;
}

.pool-one { background: radial-gradient(circle at 0% 3%, rgba(58, 7, 21, .86), transparent 26%); }
.pool-two { background: radial-gradient(circle at 102% 18%, rgba(184, 107, 122, .55), transparent 22%); }
.pool-three { background: radial-gradient(circle at 16% 98%, rgba(22, 6, 11, .52), transparent 24%); }

.scan-halo {
  width: 54vw;
  height: 54vw;
  left: -18vw;
  top: 8vh;
  inset: auto;
  border-radius: 50%;
  border: 1px solid rgba(143, 233, 255, .42);
  box-shadow: 0 0 80px rgba(201, 167, 255, .28), inset 0 0 80px rgba(143, 233, 255, .16);
  animation: scanDrift 18s ease-in-out infinite alternate;
}

.atmosphere {
  min-height: 100vh;
  position: relative;
  padding: clamp(28px, 5vw, 72px);
}

.surface-desk { padding-top: clamp(46px, 7vw, 94px); }
.cascade-layer { background: linear-gradient(180deg, transparent, rgba(58, 7, 21, .07) 36%, rgba(255, 247, 232, .16)); }
.quiet-engine { min-height: 110vh; background: radial-gradient(circle at 50% 48%, rgba(255, 247, 232, .5), transparent 42%), linear-gradient(180deg, rgba(58,7,21,.08), rgba(255,247,232,.5)); }

.wordmark-cluster {
  width: min(780px, 82vw);
  margin-left: clamp(4px, 6vw, 88px);
  padding-top: 5vh;
  animation: fogReveal 1.6s ease both;
}

.system-label,
.coordinate {
  font-family: var(--tech);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(92, 36, 51, .7);
}

.domain-word {
  margin: 10px 0 8px;
  font-family: var(--display);
  font-size: clamp(64px, 13vw, 178px);
  line-height: .82;
  letter-spacing: -.08em;
  color: var(--deep-wine);
  position: relative;
  text-shadow: -2px 0 var(--cyan), 2px 0 var(--lilac), 0 18px 50px rgba(58, 7, 21, .18);
}

.domain-word::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 247, 232, .7);
  transform: translate(5px, -4px);
  opacity: .72;
  mix-blend-mode: screen;
  animation: shimmer 4.8s ease-in-out infinite;
}

.opening-line {
  max-width: 560px;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.55;
  color: rgba(92, 36, 51, .8);
}

.route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.route-line,
.card-diagram path,
.mandala-svg path,
.mandala-svg circle {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--dash, 1600);
  stroke-dashoffset: var(--dash, 1600);
  animation: drawPath 4.8s cubic-bezier(.65,0,.2,1) forwards;
}

.route-line.primary { stroke: rgba(92, 36, 51, .48); stroke-width: 1.5; --dash: 1700; }
.route-line.ghost { stroke: rgba(143, 233, 255, .7); stroke-width: 1; --dash: 1500; animation-delay: .7s; }
.route-line.branch { stroke: rgba(244, 200, 106, .65); stroke-width: 1; --dash: 900; animation-delay: 1.2s; }
.route-cascade .route-line { animation-duration: 7s; animation-iteration-count: infinite; animation-direction: alternate; }
.rewiring.delay { animation-delay: 1.5s; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(14px, 2.1vw, 28px);
  position: relative;
  z-index: 1;
}

.surface-grid { margin-top: clamp(40px, 8vw, 118px); align-items: start; }
.cascade-grid { margin-top: 70px; }

.dream-card,
.engine-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 232, .72);
  box-shadow: 0 24px 70px rgba(58, 7, 21, .13), inset 0 0 0 1px rgba(143, 233, 255, .18);
  backdrop-filter: blur(14px);
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), box-shadow .8s ease, border-color .8s ease;
}

.dream-card::before,
.engine-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 10%, rgba(143,233,255,.24), rgba(201,167,255,.22), transparent 72%);
  transform: translateX(-120%);
  transition: transform 1s ease;
  mix-blend-mode: screen;
}

.dream-card:hover,
.engine-card:hover {
  transform: translateY(-12px) rotate(var(--hover-rotate, 0deg)) scale(1.025);
  box-shadow: 0 36px 95px rgba(58, 7, 21, .2), 0 0 42px rgba(143,233,255,.24);
  border-color: rgba(143, 233, 255, .7);
}

.dream-card:hover::before,
.engine-card:hover::before { transform: translateX(120%); }

.vellum { background: linear-gradient(145deg, rgba(255,247,232,.78), rgba(247,232,207,.55)); color: var(--plum); }
.glass { background: linear-gradient(145deg, rgba(255,247,232,.36), rgba(201,167,255,.14) 48%, rgba(143,233,255,.12)); color: var(--plum); }
.wine { background: linear-gradient(145deg, rgba(58,7,21,.92), rgba(92,36,51,.75)); color: var(--cream); border-color: rgba(244,200,106,.4); }

.dream-card h2,
.dream-card h3,
.section-marker h2,
.engine-card h3 {
  font-family: var(--display);
  letter-spacing: -.055em;
  margin: 8px 0 10px;
  color: currentColor;
}

.dream-card h2 { font-size: clamp(32px, 4.5vw, 58px); line-height: .96; }
.dream-card h3 { font-size: clamp(22px, 2.7vw, 34px); line-height: 1; }
.dream-card p { margin: 0; line-height: 1.55; }

.wide { grid-column: 2 / span 5; min-height: 310px; padding: 32px; border-radius: 34px; }
.descent-strip { grid-column: 8 / span 2; min-height: 360px; padding: 24px 18px; border-radius: 999px; display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.token { grid-column: 11 / span 1; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; align-self: center; background: radial-gradient(circle, rgba(255,247,232,.75), rgba(143,233,255,.22)); font-family: var(--tech); color: var(--deep-wine); }
.tall { grid-column: 4 / span 3; min-height: 380px; padding: 28px; border-radius: 28px; margin-top: -30px; }
.small { grid-column: 9 / span 3; min-height: 155px; padding: 24px; border-radius: 24px; margin-top: 42px; }
.tilt-left { --hover-rotate: -1deg; transform: rotate(-2.2deg); }
.rotate-right { --hover-rotate: 1deg; transform: rotate(2.8deg); }

.section-marker { max-width: 620px; margin-left: clamp(0px, 8vw, 130px); padding-top: 48px; }
.section-marker h2 { font-size: clamp(52px, 9vw, 128px); line-height: .84; color: var(--deep-wine); text-shadow: 2px 0 rgba(143,233,255,.6), -2px 0 rgba(201,167,255,.55); }
.section-marker p:not(.system-label) { font-size: 18px; line-height: 1.6; }

.span-two { grid-column: 2 / span 4; min-height: 280px; padding: 28px; border-radius: 30px; }
.long { grid-column: 7 / span 2; min-height: 520px; }
.crystalline { grid-column: 10 / span 2; min-height: 260px; padding: 26px; border-radius: 26px; margin-top: 76px; }
.hover-chamber { grid-column: 3 / span 3; min-height: 235px; padding: 26px; border-radius: 26px; margin-top: -52px; }
.lilac-token { grid-column: 7 / span 2; background: radial-gradient(circle, rgba(201,167,255,.45), rgba(255,247,232,.55)); }
.dotted-card { grid-column: 9 / span 3; min-height: 210px; padding: 26px; border-radius: 32px; }

.card-diagram { width: 100%; margin-top: 24px; overflow: visible; }
.card-diagram path { stroke: var(--plum); stroke-width: 2; --dash: 520; animation-delay: .5s; }
.card-diagram circle { fill: var(--cyan); filter: drop-shadow(0 0 7px rgba(143,233,255,.8)); }

.mini-bloom { position: absolute; right: 26px; bottom: 22px; width: 145px; height: 145px; border-radius: 50%; border: 1px solid rgba(92,36,51,.18); }
.mini-bloom span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); left: 50%; top: 50%; box-shadow: 0 0 18px var(--cyan); transform-origin: 0 0; animation: bloomPulse 3s ease-in-out infinite; }
.mini-bloom span:nth-child(1){ transform: rotate(0deg) translateX(52px); }
.mini-bloom span:nth-child(2){ transform: rotate(72deg) translateX(52px); animation-delay:.2s; }
.mini-bloom span:nth-child(3){ transform: rotate(144deg) translateX(52px); animation-delay:.4s; }
.mini-bloom span:nth-child(4){ transform: rotate(216deg) translateX(52px); animation-delay:.6s; }
.mini-bloom span:nth-child(5){ transform: rotate(288deg) translateX(52px); animation-delay:.8s; }

.ring { position: absolute; inset: 16%; border-radius: 50%; border: 1px solid rgba(92,36,51,.45); box-shadow: 0 0 20px rgba(143,233,255,.4); }
.double::after { content: ""; position: absolute; inset: 18%; border: 1px solid rgba(201,167,255,.65); border-radius: 50%; }
.hinge-icon { display: inline-block; width: 34px; height: 18px; border: 1px solid rgba(92,36,51,.36); border-radius: 12px 12px 3px 3px; margin-bottom: 18px; box-shadow: 16px 7px 0 -6px rgba(143,233,255,.55); }

.crystal-lines i,
.dot-spiral i { position: absolute; display: block; }
.crystal-lines { position: absolute; inset: auto 22px 20px 22px; height: 96px; }
.crystal-lines i { height: 1px; background: linear-gradient(90deg, var(--gold), var(--cyan)); transform-origin: left; animation: crystalFlicker 3s ease-in-out infinite; }
.crystal-lines i:nth-child(1){ width: 86%; top: 18px; transform: rotate(13deg); }
.crystal-lines i:nth-child(2){ width: 68%; top: 52px; left: 18px; transform: rotate(-22deg); }
.crystal-lines i:nth-child(3){ width: 54%; top: 80px; left: 52px; transform: rotate(34deg); }
.crystal-lines i:nth-child(4){ width: 72%; top: 38px; left: 28px; transform: rotate(66deg); }

.dot-spiral { position: relative; height: 135px; margin-top: 18px; }
.dot-spiral i { width: 8px; height: 8px; border-radius: 50%; background: var(--deep-wine); box-shadow: 0 0 15px rgba(143,233,255,.7); animation: bloomPulse 2.8s ease-in-out infinite; }
.dot-spiral i:nth-child(1){ left:50%; top:50%; }
.dot-spiral i:nth-child(2){ left:58%; top:42%; animation-delay:.1s; }
.dot-spiral i:nth-child(3){ left:63%; top:57%; animation-delay:.2s; }
.dot-spiral i:nth-child(4){ left:47%; top:68%; animation-delay:.3s; }
.dot-spiral i:nth-child(5){ left:32%; top:49%; animation-delay:.4s; }
.dot-spiral i:nth-child(6){ left:44%; top:24%; animation-delay:.5s; }
.dot-spiral i:nth-child(7){ left:73%; top:28%; animation-delay:.6s; }

.mandala-field {
  position: relative;
  width: min(86vw, 820px);
  height: min(86vw, 820px);
  margin: 30px auto 0;
}

.mandala-svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(143,233,255,.35)); }
.mandala-svg path, .mandala-svg circle { stroke: rgba(92,36,51,.45); stroke-width: 1.2; --dash: 2300; animation-duration: 8s; }
.center-card { width: 270px; min-height: 210px; padding: 26px; border-radius: 30px; background: rgba(255,247,232,.66); color: var(--plum); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.center-card:hover { transform: translate(-50%, -56%) scale(1.03); }
.orbit-card { position: absolute; width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255,247,232,.5), rgba(143,233,255,.18)); font-family: var(--tech); letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.o1 { left: 50%; top: 6%; transform: translateX(-50%); }
.o2 { right: 7%; top: 49%; }
.o3 { left: 50%; bottom: 6%; transform: translateX(-50%); }
.o4 { left: 7%; top: 49%; }

.reveal-copy { opacity: .2; filter: blur(5px); transition: opacity .7s ease, filter .7s ease; }
.glass:hover .reveal-copy { opacity: 1; filter: blur(0); }
.is-descending .dream-card { transform: translateY(var(--drift, 0px)) rotate(var(--rotation, 0deg)); }

@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes fogReveal { from { opacity: 0; transform: translateY(24px); filter: blur(16px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes shimmer { 0%,100% { opacity: .48; transform: translate(4px,-3px); } 50% { opacity: .95; transform: translate(-3px,3px); } }
@keyframes scanDrift { to { transform: translate(82vw, 22vh) scale(.72); } }
@keyframes bloomPulse { 0%,100% { opacity: .45; scale: .82; } 50% { opacity: 1; scale: 1.35; } }
@keyframes crystalFlicker { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 820px) {
  .atmosphere { padding: 24px; }
  .wordmark-cluster { margin-left: 0; width: 100%; }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wide, .tall, .small, .span-two, .hover-chamber, .dotted-card, .crystalline { grid-column: 1 / -1; margin-top: 0; }
  .descent-strip, .long { grid-column: 1 / span 2; min-height: 260px; border-radius: 30px; }
  .token, .lilac-token { grid-column: 3 / span 2; }
  .section-marker { margin-left: 0; }
  .mandala-field { width: 94vw; height: 94vw; min-height: 620px; }
  .orbit-card { width: 92px; height: 92px; }
}
