:root {
  --mist-white: #F8FBFF;
  --powder-lavender: #DCD7FF;
  --shell-pink: #FFDDEB;
  --seafoam-glass: #C9F3EA;
  --pale-butter: #FFF2B8;
  --cloud-blue: #CFE8FF;
  --deep-slate: #283044;
  --muted-mauve: #8B7894;
  --glass-white: rgba(255,255,255,0.38);
  --glass-lavender: rgba(220,215,255,0.42);
  --glass-seafoam: rgba(201,243,234,0.32);
  --hairline: rgba(255,255,255,0.65);
}

/* Compliance note: Source Serif 4** for body copy and longer narrative lines. Its readable serif texture keeps the page elegant without becoming old-fashioned. */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--deep-slate);
  background:
    radial-gradient(circle at 13% 18%, rgba(255,221,235,0.72), transparent 28rem),
    radial-gradient(circle at 84% 8%, rgba(207,232,255,0.8), transparent 30rem),
    radial-gradient(circle at 73% 78%, rgba(201,243,234,0.62), transparent 28rem),
    linear-gradient(145deg, var(--mist-white), #eef8ff 45%, #fbf6ff);
  font-family: 'Source Serif 4', Georgia, serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 11% 23%, rgba(40,48,68,0.12) 0 1px, transparent 1.4px),
    radial-gradient(circle at 61% 81%, rgba(139,120,148,0.11) 0 1px, transparent 1.2px);
  background-size: 16px 18px, 23px 21px;
  mix-blend-mode: multiply;
}

.atmosphere,
.wash {
  position: fixed;
  pointer-events: none;
}

.atmosphere {
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.wash {
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.62;
  animation: washDrift 18s ease-in-out infinite alternate;
}

.wash-one {
  width: 46vw;
  height: 46vw;
  left: -12vw;
  top: 12vh;
  background: var(--cloud-blue);
}

.wash-two {
  width: 34vw;
  height: 34vw;
  right: 4vw;
  top: 22vh;
  background: var(--powder-lavender);
  animation-delay: -6s;
}

.wash-three {
  width: 42vw;
  height: 42vw;
  right: 16vw;
  bottom: -18vw;
  background: var(--seafoam-glass);
  animation-delay: -11s;
}

.undo-current {
  position: relative;
  z-index: 1;
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 5vh clamp(1rem, 3vw, 3rem) 12vh;
}

.section-block {
  display: grid;
  grid-template-columns: minmax(5.25rem, 8vw) minmax(0, 1fr) minmax(13rem, 28vw);
  gap: clamp(1rem, 2.6vw, 3rem);
  position: relative;
  min-height: 78vh;
}

.opening {
  min-height: 100vh;
  align-items: start;
  padding-top: 1rem;
}

.memory-rail {
  position: sticky;
  top: 8vh;
  align-self: start;
  min-height: 74vh;
  display: flex;
  justify-content: center;
  color: var(--muted-mauve);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.rail-line {
  width: 1px;
  height: 100%;
  background: linear-gradient(rgba(255,255,255,0), rgba(139,120,148,0.32), rgba(201,243,234,0.62), rgba(255,255,255,0));
  box-shadow: 0 0 18px rgba(201,243,234,0.7);
}

.rail-end {
  height: 46%;
}

.rail-dot {
  position: absolute;
  top: 0.7rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #FFFFFF 0 14%, var(--pale-butter) 15% 25%, var(--seafoam-glass) 58%, rgba(201,243,234,0.2) 100%);
  border: 1px solid var(--hairline);
  box-shadow: 0 0 0 0 rgba(201,243,234,0.44), 0 0 24px rgba(201,243,234,0.82);
  transition: box-shadow 800ms ease, transform 800ms ease;
}

.rail-label {
  position: absolute;
  top: 2.25rem;
  writing-mode: vertical-rl;
}

.glass-panel {
  background:
    linear-gradient(130deg, rgba(255,255,255,0.54), rgba(255,255,255,0.2)),
    var(--glass-lavender);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 24px rgba(255,255,255,0.46), 0 24px 70px rgba(139,120,148,0.12);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: radial-gradient(circle, rgba(40,48,68,0.17) 0 0.8px, transparent 1.2px);
  background-size: 13px 13px;
  pointer-events: none;
}

.title-band {
  min-height: 14rem;
  border-radius: 2.4rem 5.5rem 3rem 2rem;
  padding: clamp(1.35rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--muted-mauve);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  line-height: 0.94;
  margin: 0;
}

h1 {
  font-size: clamp(4.4rem, 12vw, 12rem);
  letter-spacing: -0.065em;
  color: rgba(40,48,68,0.88);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

h1 span {
  color: var(--muted-mauve);
  font-style: italic;
}

h2 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 5.7vw, 6.1rem);
  letter-spacing: -0.045em;
}

p {
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  line-height: 1.65;
}

.history-strip {
  display: grid;
  gap: 0.5rem;
  min-width: 10rem;
  color: var(--muted-mauve);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-strip span,
.command-ribbon,
.mini-window {
  background: rgba(255,255,255,0.26);
  border: 1px solid rgba(255,255,255,0.54);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
}

.opening-copy {
  width: min(46rem, 82%);
  margin: 3rem 0 0 0.4rem;
  color: var(--muted-mauve);
  font-size: clamp(1.35rem, 2.2vw, 2.15rem);
  line-height: 1.42;
}

.bubble-field,
.decorative-field,
.final-bubbles {
  position: relative;
  min-height: 75vh;
}

.undo-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  width: 7.4rem;
  height: 7.4rem;
  border-radius: 50%;
  color: rgba(40,48,68,0.56);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background:
    radial-gradient(circle at 33% 24%, rgba(255,255,255,0.95) 0 8%, rgba(255,242,184,0.62) 9% 17%, transparent 18%),
    radial-gradient(circle at 68% 74%, rgba(201,243,234,0.52), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,0.28), rgba(220,215,255,0.25));
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: inset -10px -16px 32px rgba(139,120,148,0.08), inset 8px 9px 26px rgba(255,255,255,0.42), 0 18px 60px rgba(139,120,148,0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: bubbleRise 9s ease-in-out infinite alternate;
  transition: transform 900ms ease, box-shadow 900ms ease, background 900ms ease;
}

.undo-bubble::after {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.24);
}

.undo-bubble:hover,
.glass-panel:hover .undo-bubble {
  transform: scale(1.05);
  box-shadow: inset -8px -12px 32px rgba(139,120,148,0.08), 0 0 0 16px rgba(201,243,234,0.12), 0 28px 80px rgba(139,120,148,0.16);
}

.bubble-large { width: 9.8rem; height: 9.8rem; }
.bubble-medium { width: 7rem; height: 7rem; }
.bubble-small { width: 4.8rem; height: 4.8rem; font-size: 0.66rem; }

.b1 { left: -6rem; bottom: 12vh; animation-delay: -1s; }
.b2 { left: 4rem; bottom: 34vh; animation-delay: -4s; font-size: 2rem; color: var(--muted-mauve); }
.b3 { left: 11rem; bottom: 20vh; animation-delay: -6s; }
.b4 { right: 18%; top: 15%; animation-delay: -2s; }
.b5 { right: 4%; top: 26%; animation-delay: -5s; }
.b6 { right: 42%; top: 7%; animation-delay: -1s; }
.b7 { right: 26%; top: 42%; animation-delay: -3s; font-size: 2rem; }
.b8 { right: 6%; top: 6%; animation-delay: -7s; }
.b9 { right: 48%; top: 28%; animation-delay: -2s; }
.b10 { left: 2%; top: 8%; animation-delay: -1s; }
.b11 { left: 28%; top: 36%; animation-delay: -3s; }
.b12 { right: 28%; top: 16%; animation-delay: -5s; }
.b13 { right: 8%; top: 44%; animation-delay: -2s; }
.b14 { left: 45%; bottom: 6%; animation-delay: -6s; }

.trace-section {
  align-items: start;
  padding-top: 6vh;
}

.trace-section::before {
  content: "";
  grid-column: 2 / 3;
  position: absolute;
  top: 7.6vh;
  left: clamp(5.25rem, 8vw, 8rem);
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(201,243,234,0.86), rgba(255,255,255,0));
  box-shadow: 0 0 22px rgba(201,243,234,0.7);
  transition: width 1400ms ease 250ms;
}

.trace-section.is-visible::before {
  width: min(64vw, 52rem);
}

.trace-panel {
  grid-column: 2 / 3;
  padding: clamp(1.4rem, 3vw, 3.2rem);
  color: var(--deep-slate);
}

.trace-panel p:not(.eyebrow) {
  max-width: 39rem;
  color: rgba(40,48,68,0.72);
}

.trace-long { width: min(100%, 58rem); border-radius: 2.4rem 6rem 2.2rem 3.6rem; }
.trace-medium { width: min(88%, 47rem); border-radius: 4.8rem 2.1rem 4rem 2.5rem; }
.trace-short { width: min(76%, 38rem); border-radius: 2.2rem 5rem 4rem 2rem; }
.trace-tiny { width: min(68%, 34rem); border-radius: 5rem 2.4rem 2.8rem 4rem; }

.ghost-copy {
  position: absolute;
  right: 2.2rem;
  bottom: 1.4rem;
  color: rgba(139,120,148,0.26);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-style: italic;
  filter: blur(0.4px);
}

.mini-window {
  width: min(19rem, 90%);
  border-radius: 1.3rem 2rem 1.5rem 1.2rem;
  color: var(--muted-mauve);
  font-family: 'Nunito Sans', sans-serif;
}

.mini-window span {
  display: inline-block;
  width: 0.58rem;
  height: 0.58rem;
  margin-right: 0.22rem;
  border-radius: 50%;
  background: var(--shell-pink);
}

.mini-window span:nth-child(2) { background: var(--pale-butter); }
.mini-window span:nth-child(3) { background: var(--seafoam-glass); }
.mini-window p { margin: 0.75rem 0 0; font-size: 0.85rem; line-height: 1.3; }

.loop-arrow {
  position: absolute;
  right: 5%;
  top: 48%;
  width: 13rem;
  height: 13rem;
  border: 2px solid rgba(139,120,148,0.18);
  border-left-color: rgba(201,243,234,0.76);
  border-radius: 50%;
  animation: slowTurn 14s linear infinite;
}

.loop-arrow::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 1.3rem;
  width: 0.7rem;
  height: 0.7rem;
  border-top: 2px solid rgba(201,243,234,0.9);
  border-left: 2px solid rgba(201,243,234,0.9);
  transform: rotate(-26deg);
}

.command-ribbon {
  position: absolute;
  right: -3rem;
  top: 17%;
  width: 22rem;
  color: rgba(139,120,148,0.46);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.17em;
  transform: rotate(12deg);
}

.release-field {
  min-height: 95vh;
  align-items: start;
}

.release-copy {
  grid-column: 2 / 3;
  padding-top: 8vh;
}

.release-copy h2 {
  max-width: 13ch;
}

.release-copy p:not(.eyebrow) {
  max-width: 34rem;
  color: var(--muted-mauve);
}

.final-bubbles {
  grid-column: 3 / 4;
}

.reveal .rail-dot,
.reveal .trace-panel,
.reveal .release-copy,
.reveal .decorative-field,
.reveal .final-bubbles {
  opacity: 0;
  filter: blur(16px);
  transform: translateY(18px);
  transition: opacity 1000ms ease, filter 1200ms ease, transform 1200ms ease;
}

.reveal.is-visible .rail-dot,
.reveal.is-visible .trace-panel,
.reveal.is-visible .release-copy,
.reveal.is-visible .decorative-field,
.reveal.is-visible .final-bubbles {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.reveal.is-visible .rail-dot {
  box-shadow: 0 0 0 12px rgba(201,243,234,0.18), 0 0 30px rgba(201,243,234,0.78);
}

.reveal.is-visible .trace-panel { transition-delay: 520ms; }
.reveal.is-visible .decorative-field { transition-delay: 840ms; }

@keyframes bubbleRise {
  0% { transform: translate3d(0, 18px, 0) rotate(-2deg); }
  50% { transform: translate3d(9px, -18px, 0) rotate(2deg); }
  100% { transform: translate3d(-7px, -42px, 0) rotate(-1deg); }
}

@keyframes washDrift {
  from { transform: translate3d(-2vw, 1vh, 0) scale(1); }
  to { transform: translate3d(3vw, -3vh, 0) scale(1.08); }
}

@keyframes slowTurn {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .undo-current {
    padding-inline: 1rem;
  }

  .section-block {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 1rem;
  }

  .bubble-field,
  .decorative-field,
  .final-bubbles {
    grid-column: 2 / 3;
    min-height: 15rem;
  }

  .title-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .trace-long,
  .trace-medium,
  .trace-short,
  .trace-tiny,
  .opening-copy {
    width: 100%;
  }

  .final-bubbles {
    grid-column: 2 / 3;
  }
}

@media (max-width: 620px) {
  .section-block {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .memory-rail {
    font-size: 0.55rem;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5rem);
  }

  h2 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .undo-bubble {
    transform: scale(0.82);
  }

  .history-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
