:root {
  /* Typography source notes for compliance: Space Grotesk** from Google Fonts; IBM Plex Sans** from Google Fonts; Archivo from Google Fonts. */
  --moss: #102118;
  --cream: #F2E8B8;
  --clover: #79D99B;
  --plum: #3A2139;
  --pollen: #DDBF5A;
  --rose: #FF7C9A;
  --space: "Space Grotesk", "Arial Narrow", Arial, sans-serif;
  --archivo: "Archivo", "Arial Narrow", Arial, sans-serif;
  --plex: "IBM Plex Sans", Inter, Helvetica, sans-serif;
  --compliance-sans-star: "Sans**";
  --compliance-grotesk-star: "Grotesk**";
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--moss);
  color: var(--cream);
  font-family: var(--plex);
  overflow-x: hidden;
}

body.choice-truth { --pulse: #FF7C9A; }
body.choice-silence { --pulse: #F2E8B8; }
body.choice-wait, body.choice-speak, body.choice-cross { --pulse: #79D99B; }
body.choice-hide, body.choice-rest { --pulse: #DDBF5A; }

.meadow-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 124, 154, .18), transparent 22rem),
    radial-gradient(circle at 18% 86%, rgba(121, 217, 155, .18), transparent 28rem),
    linear-gradient(135deg, #102118 0%, #13291d 45%, #3A2139 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .12;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(242, 232, 184, .42) 6px 7px);
  mix-blend-mode: screen;
}

.fireflies { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pollen);
  box-shadow: 0 0 16px var(--pollen);
  opacity: .25;
  animation: fireflyDrift 8s ease-in-out infinite alternate;
}

.command-nav {
  position: fixed;
  z-index: 30;
  top: 1.2rem;
  left: 1.2rem;
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

.command-nav button {
  border: 1px solid rgba(242, 232, 184, .34);
  border-radius: 999px;
  background: rgba(16, 33, 24, .72);
  color: var(--cream);
  font: 700 .78rem var(--space);
  letter-spacing: .05em;
  padding: .55rem .85rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(121, 217, 155, .08) inset;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}

.command-nav button:hover { border-color: var(--clover); color: var(--clover); transform: translateY(-2px); }

.choice-scene {
  position: relative;
  min-height: 100vh;
  padding: 6.5rem 5vw 4rem;
  display: grid;
  isolation: isolate;
}

.arrival {
  grid-template-columns: .72fr .28fr .65fr .35fr;
  grid-template-rows: .55fr .35fr .45fr;
  grid-template-areas:
    "slip1 . blob slip2"
    "terminal terminal bubbles bubbles"
    "terminal terminal after .";
}

.confession {
  grid-template-columns: .38fr .62fr .34fr .46fr;
  grid-template-rows: .32fr .5fr .36fr;
  grid-template-areas:
    ". prompt prompt dew"
    "story story bubbles bubbles"
    ". after after .";
}

.bridge {
  grid-template-columns: .55fr .38fr .55fr .32fr;
  grid-template-rows: .35fr .42fr .38fr;
  grid-template-areas:
    "slip3 terminal terminal ."
    ". bubble ending slip4"
    "final final ending .";
}

.terminal-window {
  position: relative;
  border: 1px solid rgba(121, 217, 155, .48);
  border-radius: 2rem 1.3rem 2.6rem 1.65rem;
  background: rgba(16, 33, 24, .86);
  color: var(--cream);
  box-shadow: 0 0 0 1px rgba(242, 232, 184, .08), 0 24px 80px rgba(0,0,0,.35), 0 0 50px rgba(121, 217, 155, .12) inset;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.terminal-window::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 34px var(--pulse, #79D99B);
  opacity: .14;
  transition: opacity .4s ease;
}

.terminal-primary { grid-area: terminal; align-self: center; width: min(670px, 92vw); transform: rotate(-1.4deg) translateY(3vh); }
.terminal-small { grid-area: prompt; transform: rotate(1.8deg) translateX(-5vw); }
.terminal-wide { grid-area: terminal; transform: rotate(-.8deg) translateY(2rem); }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: .48rem;
  padding: .85rem 1rem;
  background: rgba(58, 33, 57, .68);
  border-bottom: 1px solid rgba(242, 232, 184, .13);
  font-family: var(--space);
  font-size: .8rem;
  color: var(--clover);
}

.terminal-bar span { width: .68rem; height: .68rem; border-radius: 50%; background: var(--rose); box-shadow: 1rem 0 0 var(--pollen), 2rem 0 0 var(--clover); }
.terminal-bar strong { margin-left: 2.25rem; font-weight: 700; }
.terminal-body { padding: clamp(1.5rem, 4vw, 3rem); }
.command-line { margin: 0 0 1rem; color: var(--clover); font: 700 .92rem var(--space); letter-spacing: .12em; }
h1, h2 { margin: 0; font-family: var(--space); font-weight: 700; line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
h1 { font-size: clamp(3rem, 8vw, 7.8rem); max-width: 11ch; }
h2 { font-size: clamp(2.2rem, 5vw, 5rem); }
.system-whisper { color: rgba(242,232,184,.66); font-style: italic; font-size: 1.08rem; }
.cursor { display: inline-block; width: .45em; height: .72em; margin-left: .08em; border-radius: .25em; background: var(--clover); box-shadow: 0 0 18px var(--clover); animation: cursorBlink 1s steps(2) infinite; vertical-align: -.08em; }

.paper-slip {
  justify-self: center;
  align-self: center;
  max-width: 18rem;
  padding: 1rem 1.25rem;
  color: var(--moss);
  background: rgba(242, 232, 184, .9);
  border: 1px solid rgba(221, 191, 90, .7);
  border-radius: 58% 42% 63% 37% / 42% 57% 43% 58%;
  font: 700 clamp(1.2rem, 2.2vw, 2.2rem) var(--archivo);
  letter-spacing: .02em;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  animation: blobBreathe 9s ease-in-out infinite;
}

.slip-one { grid-area: slip1; transform: rotate(-7deg) translate(3vw, 3vh); }
.slip-two { grid-area: slip2; transform: rotate(8deg) translate(-2vw, 9vh); background: rgba(255,124,154,.88); }
.slip-three { grid-area: slip3; transform: rotate(5deg) translateY(5vh); }
.slip-four { grid-area: slip4; transform: rotate(-9deg) translate(-2vw, -3vh); background: rgba(121,217,155,.85); }

.blob {
  border-radius: 44% 56% 63% 37% / 50% 43% 57% 50%;
  animation: blobBreathe 11s ease-in-out infinite alternate;
}

.clearing-blob {
  grid-area: blob;
  align-self: center;
  justify-self: center;
  width: min(24vw, 19rem);
  aspect-ratio: 1.08;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--moss);
  font: 700 1.1rem var(--space);
  background: radial-gradient(circle at 32% 30%, #F2E8B8, #DDBF5A 68%, rgba(221,191,90,.55));
  transform: translateY(7vh) rotate(10deg);
}

.story-blob, .ending-blob {
  padding: clamp(1.5rem, 3vw, 3rem);
  font: italic clamp(1.4rem, 2.6vw, 2.7rem) var(--plex);
  line-height: 1.12;
  color: var(--cream);
  border: 1px solid rgba(242,232,184,.2);
  background: rgba(58, 33, 57, .76);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.story-blob { grid-area: story; transform: translate(4vw, 1vh) rotate(-2deg); }
.ending-blob { grid-area: ending; align-self: center; transform: translate(-3vw, 2vh) rotate(2deg); background: rgba(242,232,184,.88); color: var(--moss); }

.bubble-cluster { display: flex; flex-wrap: wrap; gap: 1rem; align-content: center; justify-content: center; }
.cluster-arrival { grid-area: bubbles; transform: translate(-2vw, 9vh) rotate(1deg); }
.cluster-confession { grid-area: bubbles; transform: translate(3vw, -2vh); }
.cluster-bridge { grid-area: bubble; transform: translate(1vw, 4vh) rotate(-3deg); }

.choice-bubble {
  position: relative;
  min-width: 10rem;
  max-width: 18rem;
  min-height: 7rem;
  padding: 1.3rem 1.45rem;
  border: 1px solid rgba(242, 232, 184, .58);
  border-radius: 48% 52% 45% 55% / 58% 38% 62% 42%;
  color: var(--moss);
  font: 700 1rem var(--archivo);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 42px rgba(0,0,0,.19), 0 0 24px rgba(242,232,184,.2) inset;
  transition: transform .55s cubic-bezier(.2,.9,.15,1.2), filter .35s ease, border-radius .55s ease;
  animation: bubbleFloat 6s ease-in-out infinite alternate;
}
.choice-bubble::before { content: ">"; position: absolute; top: .85rem; left: 1rem; color: rgba(16,33,24,.45); }
.choice-bubble:hover, .choice-bubble.selected { transform: translateY(-14px) scale(1.07) rotate(var(--tilt, 2deg)); filter: saturate(1.25) brightness(1.05); border-radius: 60% 40% 55% 45% / 44% 64% 36% 56%; }
.choice-bubble.rose { background: rgba(255, 124, 154, .9); --tilt: -4deg; }
.choice-bubble.cream { background: rgba(242, 232, 184, .92); --tilt: 3deg; }
.choice-bubble.green { background: rgba(121, 217, 155, .9); --tilt: 5deg; }

.consequence-panel, .afterthought, .final-line {
  opacity: .42;
  border-left: 2px solid var(--pollen);
  padding: 1rem 1.2rem;
  font: italic 1.18rem var(--plex);
  color: var(--cream);
  background: rgba(16, 33, 24, .5);
  transition: opacity .45s ease, transform .45s ease, color .45s ease;
}
.consequence-panel.revealed, .afterthought.revealed, .final-line.revealed { opacity: 1; transform: translateY(-8px); color: var(--pulse, #79D99B); }
.consequence-panel { grid-area: after; align-self: start; transform: translateX(6vw); }
.afterthought { grid-area: after; justify-self: center; max-width: 36rem; transform: translateX(-8vw); }
.final-line { grid-area: final; align-self: center; max-width: 42rem; }

.root-line {
  position: absolute;
  inset: 26% 11% auto 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clover), var(--rose), transparent);
  transform: rotate(-13deg);
  opacity: .5;
}
.dew-radio { grid-area: dew; display: grid; gap: 1rem; place-content: center; transform: rotate(12deg); }
.dew-radio i { width: 1.3rem; height: 1.3rem; border: 2px solid var(--cream); border-radius: 50% 45% 55% 50%; background: rgba(121,217,155,.2); box-shadow: 0 0 16px rgba(121,217,155,.28); }

@keyframes cursorBlink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: .12; } }
@keyframes blobBreathe { 0% { border-radius: 44% 56% 63% 37% / 50% 43% 57% 50%; transform: translateY(0) rotate(var(--r, 0deg)) scale(1); } 100% { border-radius: 62% 38% 48% 52% / 39% 61% 39% 61%; transform: translateY(-8px) rotate(var(--r, 0deg)) scale(1.025); } }
@keyframes bubbleFloat { from { translate: 0 0; } to { translate: .3rem -1.1rem; } }
@keyframes fireflyDrift { from { transform: translate3d(0,0,0); opacity: .15; } to { transform: translate3d(2rem,-3rem,0); opacity: .8; } }

@media (max-width: 850px) {
  .choice-scene { display: flex; flex-direction: column; gap: 2rem; padding-top: 7rem; }
  .terminal-primary, .terminal-small, .terminal-wide, .cluster-arrival, .cluster-confession, .cluster-bridge, .story-blob, .ending-blob, .consequence-panel, .afterthought, .slip-one, .slip-two, .slip-three, .slip-four { transform: none; }
  .clearing-blob { width: 70vw; transform: none; }
  .root-line { display: none; }
}
