:root {
  --blackwater: #081412;
  --deep-tide: #123C4A;
  --leaf: #2F6B47;
  --algae: #A7F06D;
  --mud: #5A3A24;
  --shell: #E9D9B7;
  --rust: #B85C38;
  --orchid: #C85C9E;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--shell);
  font-family: "Alegreya Sans", Inter, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(167, 240, 109, .08), transparent 22rem),
    radial-gradient(circle at 88% 86%, rgba(200, 92, 158, .13), transparent 26rem),
    linear-gradient(145deg, var(--blackwater), var(--deep-tide) 46%, #06100f 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle, rgba(90, 58, 36, .42) 1px, transparent 1px),
    radial-gradient(circle, rgba(167, 240, 109, .18) 1px, transparent 1px),
    linear-gradient(100deg, transparent 48%, rgba(233, 217, 183, .035) 50%, transparent 52%);
  background-size: 31px 37px, 83px 91px, 160px 100%;
  mix-blend-mode: screen;
}

.creek-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#questSvg {
  width: 100%;
  height: 100%;
  min-height: 6400px;
  position: absolute;
  top: 0;
  left: 0;
}

#waterPath {
  fill: none;
  stroke: url(#none);
  stroke-width: 230;
  stroke-linecap: round;
  filter: url(#glow);
}

.creek-map::before {
  content: "";
  position: absolute;
  inset: -10% -22%;
  min-height: 6600px;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(18, 60, 74, .88), transparent 33%),
    radial-gradient(ellipse at 78% 18%, rgba(8, 20, 18, .2), transparent 34%),
    radial-gradient(ellipse at 38% 36%, rgba(18, 60, 74, .92), transparent 24%),
    radial-gradient(ellipse at 75% 51%, rgba(18, 60, 74, .88), transparent 28%),
    radial-gradient(ellipse at 31% 67%, rgba(18, 60, 74, .95), transparent 27%),
    radial-gradient(ellipse at 70% 84%, rgba(18, 60, 74, .9), transparent 26%);
  clip-path: polygon(10% 0, 85% 7%, 62% 18%, 18% 28%, 74% 41%, 92% 51%, 24% 63%, 4% 72%, 79% 86%, 48% 100%, 12% 100%, 0 0);
  opacity: .92;
}

.bank { fill: rgba(90, 58, 36, .18); }

.guide-firefly {
  width: 18px;
  height: 18px;
  position: fixed;
  left: 12vw;
  top: 7vh;
  border-radius: 50%;
  z-index: 6;
  background: var(--algae);
  box-shadow: 0 0 12px var(--algae), 0 0 28px var(--algae), 0 0 58px rgba(167, 240, 109, .65);
  transform: translate(-50%, -50%);
  animation: fireflyFlicker 1.6s infinite alternate;
}

.mist {
  position: fixed;
  z-index: 2;
  width: 70vw;
  height: 20vh;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(233, 217, 183, .1), transparent 67%);
  filter: blur(18px);
  animation: drift 18s linear infinite alternate;
}

.mist-one { top: 16%; left: -20%; }
.mist-two { top: 62%; right: -18%; animation-duration: 24s; }

.charm-rail {
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.charm-rail a {
  color: var(--shell);
  text-decoration: none;
  font-family: "Nanum Pen Script", cursive;
  font-size: 1.22rem;
  background: rgba(90, 58, 36, .72);
  border: 1px solid rgba(233, 217, 183, .24);
  border-radius: 44% 56% 49% 51%;
  padding: .22rem .62rem;
  transform: rotate(var(--tilt, -3deg));
}

.charm-rail a:nth-child(even) { --tilt: 4deg; color: var(--algae); }

.rootwater-quest { position: relative; z-index: 3; }

.bend {
  min-height: 100vh;
  position: relative;
  display: grid;
  align-items: center;
  padding: 8vh 8vw;
  overflow: hidden;
}

.bend::before, .bend::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .75;
}

.bend::before {
  inset: 0;
  background:
    repeating-linear-gradient(113deg, transparent 0 42px, rgba(90, 58, 36, .18) 44px 48px, transparent 52px 88px),
    radial-gradient(circle at var(--ring-x, 50%) var(--ring-y, 50%), rgba(167, 240, 109, .17), transparent 10rem);
}

.bend::after {
  width: 36vw;
  height: 115vh;
  top: -8vh;
  left: -10vw;
  border-radius: 50%;
  border-right: 24px solid rgba(90, 58, 36, .7);
  border-left: 9px solid rgba(47, 107, 71, .72);
  transform: rotate(18deg);
  animation: rootSway 6s ease-in-out infinite alternate;
}

.bend-right { justify-items: end; }
.bend-left { justify-items: start; }

.hero-bend { min-height: 112vh; justify-items: start; align-content: center; }

.paddle-title {
  max-width: 760px;
  padding: 2.6rem 3.2rem;
  background: linear-gradient(105deg, rgba(90, 58, 36, .95), rgba(184, 92, 56, .58));
  color: var(--shell);
  clip-path: polygon(5% 0, 92% 5%, 100% 52%, 91% 94%, 8% 100%, 0 47%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(233, 217, 183, .16);
  transform: rotate(-4deg);
}

.scribble, .label, .reed-charm {
  font-family: "Nanum Pen Script", cursive;
  color: var(--algae);
}

.scribble { font-size: 1.45rem; margin: 0 0 .2rem; }

h1, h2 {
  font-family: "Grenze Gotisch", "Bricolage Grotesque", serif;
  margin: 0;
  line-height: .86;
  letter-spacing: .03em;
}

h1 { font-size: clamp(5.6rem, 15vw, 14rem); text-shadow: 0 4px 0 rgba(8, 20, 18, .58); }
h2 { font-size: clamp(3.8rem, 7vw, 8.4rem); color: var(--shell); }

.title-dot {
  display: inline-block;
  width: .14em;
  height: .14em;
  margin: 0 .04em .1em;
  border-radius: 50%;
  background: var(--algae);
  box-shadow: 0 0 18px var(--algae), 0 0 44px var(--algae);
}

.silt-line {
  margin-top: 2.2rem;
  max-width: 560px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  color: rgba(233, 217, 183, .88);
  border-bottom: 2px dashed rgba(167, 240, 109, .45);
}

.field-note, .bark-plaque, .mirror-note, .clearing-note, .final-plaque {
  position: relative;
  width: min(520px, 82vw);
  padding: 2rem 2.1rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(167, 240, 109, .12), transparent 30%),
    linear-gradient(145deg, rgba(233, 217, 183, .93), rgba(218, 190, 139, .86));
  color: var(--blackwater);
  clip-path: polygon(4% 2%, 96% 0, 100% 88%, 84% 100%, 3% 94%, 0 18%);
  box-shadow: 0 28px 100px rgba(0, 0, 0, .42), 0 0 0 8px rgba(90, 58, 36, .2);
}

.bark-plaque, .mirror-note {
  background: linear-gradient(140deg, rgba(90, 58, 36, .94), rgba(47, 107, 71, .78));
  color: var(--shell);
}

.label {
  color: var(--rust);
  font-size: 1.35rem;
  margin: 0 0 .35rem;
}

.bark-plaque .label, .mirror-note .label { color: var(--algae); }

p {
  font-size: clamp(1.13rem, 1.6vw, 1.45rem);
  line-height: 1.42;
}

.tilted-left { transform: rotate(-3deg); }
.tilted-right { transform: rotate(4deg); }
.high-note { margin-top: -16vh; }

.root-curtain, .knee-roots {
  position: absolute;
  inset: -10vh auto auto 7vw;
  width: 32vw;
  height: 120vh;
  background: repeating-linear-gradient(90deg, transparent 0 25px, rgba(90, 58, 36, .9) 29px 40px, transparent 47px 70px);
  clip-path: polygon(18% 0, 30% 68%, 24% 100%, 52% 100%, 45% 55%, 60% 0, 86% 0, 75% 100%, 0 100%, 0 0);
  opacity: .72;
  animation: rootSway 7s ease-in-out infinite alternate;
}

.knee-roots {
  inset: auto 8vw 0 auto;
  width: 52vw;
  height: 34vh;
  background: repeating-radial-gradient(ellipse at bottom, rgba(90, 58, 36, .9) 0 8px, transparent 10px 28px);
  clip-path: polygon(0 100%, 5% 34%, 10% 100%, 18% 20%, 24% 100%, 31% 36%, 39% 100%, 48% 18%, 54% 100%, 63% 31%, 70% 100%, 80% 23%, 88% 100%, 100% 34%, 100% 100%);
}

.reed-charm {
  position: absolute;
  top: 22vh;
  right: 18vw;
  padding: .55rem 1rem;
  background: rgba(8, 20, 18, .72);
  border: 1px dashed var(--algae);
  font-size: 1.5rem;
  transform-origin: 50% -60px;
  animation: charmSpin 4.7s ease-in-out infinite alternate;
}

.charm-two { left: 12vw; right: auto; top: 70vh; color: var(--orchid); border-color: var(--orchid); }

.shell, .bottle-cap {
  cursor: pointer;
  color: var(--blackwater);
  border: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
}

.clue-shell {
  margin-top: 2rem;
  padding: .9rem 1.35rem;
  background: radial-gradient(circle at 35% 35%, #fff5d9, var(--shell) 54%, #bda56e);
  border-radius: 60% 40% 55% 45%;
}

.clue-shell:hover, .bottle-cap:hover { transform: rotate(9deg) scale(1.08); filter: brightness(1.2); }

.clue-panel {
  position: absolute;
  left: 10vw;
  bottom: 9vh;
  max-width: 340px;
  padding: 1rem 1.2rem;
  color: var(--algae);
  background: rgba(8, 20, 18, .84);
  border: 1px solid rgba(167, 240, 109, .45);
  font-family: "Nanum Pen Script", cursive;
  font-size: 1.6rem;
  opacity: 0;
  transform: translateY(18px) rotate(-2deg);
  transition: opacity .35s ease, transform .35s ease;
}

.clue-panel.visible { opacity: 1; transform: translateY(0) rotate(-2deg); }
.shrine-panel { right: 11vw; left: auto; }

.cap-shrine {
  position: absolute;
  left: 10vw;
  top: 24vh;
  display: grid;
  grid-template-columns: repeat(2, 92px);
  gap: 1rem;
  transform: rotate(-8deg);
}

.bottle-cap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f9aa76, var(--rust) 48%, #612819 74%);
  box-shadow: inset 0 0 0 8px rgba(8, 20, 18, .24), 0 16px 32px rgba(0,0,0,.36);
  color: var(--shell);
  font-size: 2rem;
}

.cap-two { transform: translateY(38px); }
.cap-three { transform: translateX(52px); }

.orbit-field {
  position: absolute;
  inset: 14vh 12vw auto auto;
  width: 290px;
  height: 290px;
  border: 1px dashed rgba(167, 240, 109, .24);
  border-radius: 50%;
  animation: spin 12s linear infinite;
}

.orbit-field span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--algae);
  box-shadow: 0 0 18px var(--algae);
}

.orbit-field span:nth-child(1) { left: 50%; top: 0; }
.orbit-field span:nth-child(2) { left: 88%; top: 30%; }
.orbit-field span:nth-child(3) { left: 72%; top: 82%; }
.orbit-field span:nth-child(4) { left: 18%; top: 76%; }
.orbit-field span:nth-child(5) { left: 4%; top: 26%; }

.blackwater-basin {
  position: absolute;
  left: 9vw;
  bottom: 13vh;
  width: min(560px, 80vw);
  height: 210px;
  border-radius: 48%;
  background: radial-gradient(ellipse at center, rgba(18, 60, 74, .95), rgba(8, 20, 18, .95) 65%);
  box-shadow: inset 0 0 60px rgba(167, 240, 109, .08), 0 0 0 12px rgba(90, 58, 36, .22);
  overflow: hidden;
}

.blackwater-basin::before {
  content: "";
  position: absolute;
  inset: 16% 8%;
  border: 2px solid rgba(233, 217, 183, .11);
  border-radius: 50%;
  animation: waterPulse 3s ease-out infinite;
}

.reflection {
  font-family: "Grenze Gotisch", serif;
  font-size: clamp(3rem, 8vw, 7rem);
  color: rgba(233, 217, 183, .2);
  transform: rotate(180deg) skewX(-8deg);
  text-align: center;
  margin-top: 2.7rem;
}

.moon-bend {
  min-height: 125vh;
  background: radial-gradient(circle at 70% 42%, rgba(200, 92, 158, .28), transparent 24rem), radial-gradient(circle at 30% 65%, rgba(167, 240, 109, .2), transparent 18rem);
}

.clearing-note { justify-self: start; margin-top: -18vh; }
.final-plaque { justify-self: end; background: linear-gradient(135deg, rgba(47, 107, 71, .94), rgba(200, 92, 158, .75)); color: var(--shell); }

.moonfruit {
  position: absolute;
  border-radius: 46% 54% 55% 45%;
  background: radial-gradient(circle at 35% 28%, #fff8dc, var(--shell) 38%, var(--algae) 70%, var(--orchid));
  box-shadow: 0 0 28px rgba(167, 240, 109, .55), 0 0 80px rgba(200, 92, 158, .24);
  animation: floatFruit 5s ease-in-out infinite alternate;
}

.moonfruit-one { width: 120px; height: 150px; top: 16vh; right: 23vw; }
.moonfruit-two { width: 76px; height: 94px; left: 16vw; bottom: 18vh; animation-delay: -2s; }

.ripple-layer { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(167, 240, 109, .55);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleExpand 1.4s ease-out forwards;
}

@keyframes fireflyFlicker { 0% { opacity: .65; scale: .82; } 100% { opacity: 1; scale: 1.12; } }
@keyframes drift { to { transform: translateX(44vw) translateY(6vh); } }
@keyframes rootSway { to { transform: rotate(22deg) translateX(1.4vw); } }
@keyframes charmSpin { to { transform: rotate(7deg) translateY(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes waterPulse { to { transform: scale(1.7); opacity: 0; } }
@keyframes floatFruit { to { transform: translateY(-22px) rotate(5deg); } }
@keyframes rippleExpand { to { opacity: 0; transform: translate(-50%, -50%) scale(16); } }

@media (max-width: 760px) {
  .charm-rail { right: .4rem; gap: .35rem; }
  .charm-rail a { font-size: 1rem; padding: .15rem .42rem; }
  .bend { padding: 10vh 5vw; }
  .paddle-title { padding: 1.8rem 1.5rem; }
  .cap-shrine, .orbit-field, .blackwater-basin { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin-top: 2rem; }
  .bend-right, .bend-left { justify-items: center; }
  .reed-charm { display: none; }
}
