:root {
  /* Design parser tokens: Roboto Slab** Slabb from Google Fonts */
  --fired-terracotta: #B75F3B;
  --sunbaked-clay: #D9905F;
  --warm-parchment: #F3D8B8;
  --deep-river-umber: #3B2A22;
  --mossy-olive-seal: #6F7A45;
  --lens-flare-honey: #F6B85A;
  --dusty-rose-ripple: #C8796A;
  --night-ink-accent: #1F2520;
  --display: "Bree Serif", Georgia, serif;
  --slab: "Roboto Slab", Rockwell, Georgia, serif;
  --body: "Nunito Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--deep-river-umber);
  background:
    radial-gradient(circle at 18% 12%, rgba(246, 184, 90, .38), transparent 22rem),
    radial-gradient(circle at 88% 8%, rgba(200, 121, 106, .24), transparent 20rem),
    linear-gradient(135deg, var(--warm-parchment) 0%, #edd0aa 44%, #e5b889 100%);
  font-family: var(--body);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .36;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(59, 42, 34, .12) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(31, 37, 32, .08) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 95, 59, .05), rgba(111, 122, 69, .04));
  background-size: 19px 23px, 31px 29px, 100% 100%;
}

.lens-flare {
  position: fixed;
  left: 8vw;
  top: 16vh;
  width: 22rem;
  height: 9rem;
  z-index: 4;
  pointer-events: none;
  filter: blur(1px);
  opacity: .82;
  background:
    radial-gradient(circle, rgba(246, 184, 90, .9) 0 8%, rgba(246, 184, 90, .42) 9% 22%, transparent 46%),
    linear-gradient(100deg, transparent 0%, rgba(246, 184, 90, .4) 42%, rgba(243, 216, 184, .58) 50%, rgba(246, 184, 90, .28) 58%, transparent 100%);
  border-radius: 50%;
  animation: flareDrift 17s ease-in-out infinite alternate;
}

.bead-nav {
  position: fixed;
  right: 2vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.bead {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--sunbaked-clay);
  border: 2px solid var(--deep-river-umber);
  box-shadow: inset -.15rem -.18rem 0 rgba(59, 42, 34, .18), 0 .2rem .8rem rgba(59, 42, 34, .22);
  position: relative;
  transition: transform .35s ease, background .35s ease;
}

.bead:nth-child(even) { transform: translateX(-.7rem); }
.bead.is-active, .bead:hover { background: var(--mossy-olive-seal); transform: scale(1.28); }
.bead span { display: none; }

.river-page { position: relative; z-index: 5; }
.chamber { min-height: 100vh; position: relative; padding: 7vw; overflow: hidden; }

.hero-chamber {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 54%, rgba(217, 144, 95, .3), transparent 32rem),
    radial-gradient(ellipse at 42% 54%, rgba(111, 122, 69, .18), transparent 16rem);
}

.basin {
  position: relative;
  width: min(78vw, 54rem);
  aspect-ratio: 1;
  border-radius: 48% 52% 51% 49%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(243, 216, 184, .92) 0 27%, rgba(217, 144, 95, .28) 28% 46%, rgba(183, 95, 59, .17) 47% 62%, transparent 63%),
    radial-gradient(circle, rgba(59, 42, 34, .14), transparent 66%);
}

.ripple-ring {
  position: absolute;
  border: .18rem solid rgba(200, 121, 106, .66);
  border-radius: 47% 53% 49% 51%;
  inset: 18%;
  animation: rippleOpen 5.8s ease-in-out infinite;
}
.ring-two { inset: 10%; animation-delay: -1.6s; border-color: rgba(111, 122, 69, .48); }
.ring-three { inset: 2%; animation-delay: -3.1s; border-color: rgba(183, 95, 59, .38); }

.title-seal {
  position: relative;
  text-align: center;
  padding: 4rem 5rem;
  border-radius: 54% 46% 50% 50%;
  background: rgba(243, 216, 184, .68);
  box-shadow: inset 0 0 0 .35rem rgba(183, 95, 59, .24), inset 0 0 3rem rgba(217, 144, 95, .46);
  animation: sealRise 1.8s cubic-bezier(.2,.9,.1,1) both;
}

h1, h2 { font-family: var(--display); font-weight: 400; }
h1 { margin: 0; color: var(--fired-terracotta); font-size: clamp(4rem, 12vw, 11rem); letter-spacing: -.055em; text-shadow: .08em .08em 0 rgba(59, 42, 34, .12); }
h2 { margin: 0; color: var(--deep-river-umber); font-size: clamp(2.7rem, 6vw, 6.8rem); line-height: .94; }
h3 { font-family: var(--slab); color: var(--mossy-olive-seal); font-size: clamp(1.35rem, 2vw, 2.2rem); margin: 0 0 1rem; }
p { font-size: clamp(1rem, 1.34vw, 1.35rem); line-height: 1.64; }
.overline, .subline { margin: 0; font-family: var(--slab); font-weight: 600; color: var(--mossy-olive-seal); }
.subline { color: var(--deep-river-umber); }

.spirit {
  position: absolute;
  width: 4rem;
  height: 5.2rem;
  border-radius: 48% 48% 36% 36%;
  background: rgba(243, 216, 184, .62);
  border: 1px solid rgba(31, 37, 32, .2);
  box-shadow: 0 0 1.6rem rgba(246, 184, 90, .5);
  animation: courierFloat 8s ease-in-out infinite;
}
.spirit::before, .spirit::after { content: ""; position: absolute; top: 1.4rem; width: .42rem; height: .42rem; background: var(--night-ink-accent); border-radius: 50%; }
.spirit::before { left: 1.25rem; } .spirit::after { right: 1.25rem; }
.spirit span { position: absolute; top: -1.7rem; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 .8rem var(--body); color: var(--fired-terracotta); }
.spirit-one { left: 13%; top: 27%; }
.spirit-two { right: 16%; top: 35%; animation-delay: -2.2s; }
.spirit-three { left: 58%; bottom: 10%; animation-delay: -4.1s; }
.courier-path { position: absolute; width: 28%; height: 1px; border-top: 3px dotted rgba(111, 122, 69, .45); }
.path-left { left: 15%; top: 45%; transform: rotate(-19deg); }
.path-right { right: 13%; top: 48%; transform: rotate(16deg); }

.curved-whisper { position: absolute; width: min(86vw, 70rem); bottom: 4vh; left: 7vw; overflow: visible; }
.curved-whisper path, .accordion-wave path { fill: none; stroke: rgba(111, 122, 69, .36); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 9 14; }
.curved-whisper text, .accordion-wave text { font: 600 1.3rem var(--slab); fill: var(--mossy-olive-seal); letter-spacing: .02em; }

.banks-chamber {
  padding-top: 10vh;
  background:
    linear-gradient(100deg, rgba(183, 95, 59, .16), transparent 33%, rgba(111, 122, 69, .18)),
    radial-gradient(circle at 50% 35%, rgba(246, 184, 90, .2), transparent 25rem);
}
.chapter-stamp {
  width: 5.5rem; height: 5.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--mossy-olive-seal); color: var(--warm-parchment); font: 400 2.2rem var(--display);
  box-shadow: inset 0 0 0 .45rem rgba(243,216,184,.22), 0 .65rem 1.2rem rgba(59,42,34,.18);
  margin-bottom: 1.6rem;
}
.bank-flow { display: grid; grid-template-columns: 1fr minmax(7rem, 15vw) 1fr; gap: 3vw; align-items: center; min-height: 58vh; }
.bank { display: flex; flex-direction: column; gap: 1.5rem; }
.bank p {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font: 600 clamp(1.15rem, 2vw, 2.2rem) var(--slab);
  background: rgba(243, 216, 184, .62);
  border: 2px solid rgba(183, 95, 59, .26);
  border-radius: 3rem 1.4rem 3rem 1.4rem;
  transform: translateX(var(--drift, 0));
  transition: transform .9s ease, background .9s ease;
}
.right-bank p { border-radius: 1.4rem 3rem 1.4rem 3rem; }
.bank-flow.is-bending .bank p { transform: translateX(0) rotate(var(--bend, 0deg)); background: rgba(246, 184, 90, .22); }
.current-line { position: relative; height: 64vh; display: grid; place-items: center; }
.current-line svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.current-line path { fill: none; stroke: var(--dusty-rose-ripple); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 15 22; animation: riverPulse 7s linear infinite; }
.shared-phrase { position: relative; padding: 1.25rem; border-radius: 50%; background: var(--fired-terracotta); color: var(--warm-parchment); font: 700 1rem var(--slab); text-align: center; box-shadow: 0 0 0 1.2rem rgba(183,95,59,.12); }
.wave-divider { position: absolute; left: 0; right: 0; bottom: -1px; height: 9rem; }
.wave-divider path { fill: rgba(183, 95, 59, .22); }

.accord-chamber { background: linear-gradient(165deg, rgba(217,144,95,.35), rgba(243,216,184,.82) 45%, rgba(200,121,106,.22)); }
.parchment-stack { position: relative; min-height: 55vh; margin-top: 2rem; }
.strip {
  position: absolute;
  max-width: 44rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: rgba(243, 216, 184, .78);
  border: 2px solid rgba(59, 42, 34, .14);
  box-shadow: 0 1.2rem 2.4rem rgba(59, 42, 34, .14), inset 0 0 2rem rgba(217, 144, 95, .18);
}
.strip-one { left: 4vw; top: 0; border-radius: 3rem 7rem 4rem 2rem; transform: rotate(-3deg); }
.strip-two { right: 7vw; top: 8rem; border-radius: 7rem 2rem 4rem 5rem; transform: rotate(5deg); max-width: 32rem; }
.strip-three { left: 25vw; bottom: 0; border-radius: 4rem 3rem 8rem 2rem; transform: rotate(-1deg); max-width: 36rem; }
.accordion-wave { position: absolute; bottom: 3vh; left: 6vw; width: 88vw; overflow: visible; }

.seals-chamber { background: radial-gradient(circle at 50% 50%, rgba(111,122,69,.25), transparent 30rem), linear-gradient(30deg, rgba(243,216,184,.9), rgba(217,144,95,.34)); }
.seals-chamber h2 { max-width: 46rem; }
.seal-orbit { position: relative; min-height: 62vh; margin-top: 1rem; }
.treaty-seal {
  position: absolute;
  width: clamp(8rem, 15vw, 13rem); height: clamp(8rem, 15vw, 13rem);
  border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle, var(--sunbaked-clay), var(--fired-terracotta));
  color: var(--warm-parchment); font: 400 clamp(1.4rem, 2.6vw, 2.6rem) var(--display);
  box-shadow: inset 0 0 0 .42rem rgba(243,216,184,.28), inset .7rem .8rem 1.5rem rgba(246,184,90,.25), 0 1.2rem 2rem rgba(59,42,34,.22);
  transition: transform .45s ease, box-shadow .45s ease;
}
.treaty-seal::after { content: ""; position: absolute; inset: -1rem; border: 2px solid rgba(200,121,106,.6); border-radius: 50%; opacity: 0; transform: scale(.72); transition: transform .5s ease, opacity .5s ease; }
.treaty-seal:hover, .treaty-seal.is-warm { transform: scale(1.08) rotate(-4deg); box-shadow: inset 0 0 0 .42rem rgba(243,216,184,.28), 0 0 0 1.8rem rgba(246,184,90,.14), 0 1.4rem 2.4rem rgba(59,42,34,.25); }
.treaty-seal:hover::after, .treaty-seal.is-warm::after { opacity: 1; transform: scale(1.25); }
.seal-a { left: 8%; top: 10%; } .seal-b { right: 14%; top: 3%; } .seal-c { left: 34%; bottom: 4%; } .seal-d { right: 4%; bottom: 13%; }
.seal-note { position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%); width: min(28rem, 75vw); padding: 2rem; border-radius: 3rem; background: rgba(31,37,32,.9); color: var(--warm-parchment); font: 700 clamp(1.1rem, 1.6vw, 1.45rem) var(--slab); text-align: center; box-shadow: 0 .8rem 2rem rgba(59,42,34,.24); }

.settlement-chamber { display: grid; place-items: center; background: radial-gradient(circle at center, rgba(246,184,90,.32), transparent 31rem), linear-gradient(180deg, rgba(200,121,106,.18), rgba(59,42,34,.18)); }
.final-waves { position: absolute; inset: 9vh 9vw; display: grid; place-items: center; }
.final-waves span { position: absolute; width: 30vmin; height: 30vmin; border: 3px solid rgba(111,122,69,.35); border-radius: 48% 52% 50% 50%; animation: settleWave 8s ease-in-out infinite; }
.final-waves span:nth-child(2) { animation-delay: -2s; border-color: rgba(183,95,59,.32); }
.final-waves span:nth-child(3) { animation-delay: -4s; border-color: rgba(200,121,106,.32); }
.final-waves span:nth-child(4) { animation-delay: -6s; border-color: rgba(246,184,90,.44); }
.final-seal { position: relative; width: min(38rem, 86vw); min-height: 28rem; display: grid; align-content: center; text-align: center; padding: 4rem; border-radius: 50%; background: radial-gradient(circle, var(--sunbaked-clay), var(--fired-terracotta)); color: var(--warm-parchment); box-shadow: inset 0 0 0 .8rem rgba(243,216,184,.18), 0 1.8rem 4rem rgba(59,42,34,.28); }
.final-seal h2 { color: var(--warm-parchment); }
.final-seal p { margin-inline: auto; max-width: 25rem; }
.wink-ghost { position: absolute; right: 13%; top: 10%; width: 4.7rem; height: 5.8rem; border-radius: 48% 48% 37% 37%; background: rgba(243,216,184,.7); color: var(--deep-river-umber); display: grid; place-items: center; font: 800 .9rem var(--body); animation: wink 3.4s ease-in-out infinite; }

@keyframes flareDrift { from { transform: translate3d(0,0,0) rotate(-8deg); } to { transform: translate3d(62vw, 18vh, 0) rotate(10deg); } }
@keyframes rippleOpen { 0%,100% { transform: scale(.86); opacity: .28; } 45% { transform: scale(1.08); opacity: .72; } }
@keyframes sealRise { from { transform: translateY(2rem) scale(.88); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes courierFloat { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2.2rem) rotate(4deg); } }
@keyframes riverPulse { to { stroke-dashoffset: -180; } }
@keyframes settleWave { 0% { transform: scale(.5) rotate(0); opacity: .05; } 45% { opacity: .62; } 100% { transform: scale(2.8) rotate(34deg); opacity: 0; } }
@keyframes wink { 0%, 72%, 100% { transform: translateY(0) rotate(4deg); border-radius: 48% 48% 37% 37%; } 78% { transform: translateY(-.6rem) rotate(-3deg); border-radius: 48% 48% 45% 30%; } }

@media (max-width: 760px) {
  .chamber { padding: 5rem 1.2rem; }
  .bead-nav { display: none; }
  .title-seal { padding: 2.5rem 1.5rem; }
  .basin { width: 100vw; }
  .bank-flow { grid-template-columns: 1fr; gap: 1.5rem; }
  .current-line { height: 10rem; }
  .current-line svg { transform: rotate(90deg); }
  .parchment-stack { min-height: 78vh; }
  .strip { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 1rem 0; transform: none; }
  .seal-orbit { min-height: 82vh; }
  .seal-a { left: 0; top: 4%; } .seal-b { right: 0; top: 22%; } .seal-c { left: 3%; bottom: 19%; } .seal-d { right: 0; bottom: 2%; }
  .seal-note { top: 51%; }
}
