:root {
  --forest: #123D2A;
  --moss: #3F6F4E;
  --lichen: #DCE8C8;
  --walnut: #7A4F32;
  --brass: #C5A15A;
  --clay: #C96F4A;
  --cream: #F3EBD2;
  --ink: #17211A;
  --display: "Nunito Sans", "Nunito", system-ui, sans-serif;
  --rounded: "M PLUS Rounded 1c", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --gauge: "Varela Round", "Nunito", system-ui, sans-serif;
  --ease: cubic-bezier(.21, .72, .18, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--cream);
  font-family: var(--body);
  background:
    radial-gradient(circle at 17% 18%, rgba(63,111,78,.46), transparent 29rem),
    radial-gradient(circle at 86% 8%, rgba(197,161,90,.17), transparent 24rem),
    linear-gradient(135deg, var(--ink), var(--forest) 48%, #0b281c);
}

.ambient-field { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.grain { position: absolute; inset: -20%; opacity: .18; mix-blend-mode: screen; background-image: radial-gradient(circle, rgba(243,235,210,.33) 0 1px, transparent 1.5px); background-size: 23px 23px; transform: rotate(-7deg); }
.grain-b { opacity: .08; background-size: 37px 37px; transform: rotate(11deg); }
.lamp { position: absolute; width: 27rem; height: 27rem; border-radius: 50%; filter: blur(22px); background: radial-gradient(circle, rgba(220,232,200,.19), transparent 65%); animation: lampBreath 9s var(--ease) infinite alternate; }
.lamp-left { left: -8rem; top: 19vh; }
.lamp-right { right: -7rem; bottom: 6vh; animation-delay: -3s; }

.rooms { position: relative; z-index: 1; }
.room { min-height: 100vh; padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 6vw, 6rem); display: grid; place-items: center; position: relative; }

.side-keys { position: fixed; z-index: 8; right: clamp(.75rem, 2vw, 2rem); top: 50%; transform: translateY(-50%); display: grid; gap: .75rem; }
.wood-key { width: 6.5rem; padding: .8rem .75rem .7rem; border-radius: 999px 16px 16px 999px; color: var(--cream); text-decoration: none; font: 700 .75rem/1 var(--rounded); letter-spacing: .09em; background: linear-gradient(120deg, #8b5d3b, var(--walnut) 55%, #5f3826); box-shadow: inset 0 -3px 0 rgba(197,161,90,.55), 0 1rem 2rem rgba(0,0,0,.19); transition: transform .55s var(--ease), box-shadow .55s var(--ease), color .55s var(--ease); }
.wood-key:hover, .wood-key.active { transform: translateY(-4px) translateX(-5px); color: var(--lichen); box-shadow: inset 0 -4px 0 var(--brass), 0 1.2rem 2.2rem rgba(18,61,42,.55); }

.wall-unit { width: min(1100px, 88vw); min-height: 650px; position: relative; border-radius: 3.4rem; padding: clamp(1.4rem, 3vw, 2.7rem); background: linear-gradient(128deg, rgba(122,79,50,.78), rgba(79,45,28,.62)); box-shadow: inset 0 0 0 1px rgba(197,161,90,.2), 0 3rem 6rem rgba(0,0,0,.28); }
.wall-unit::before { content: ""; position: absolute; left: 4%; right: 7%; top: 48%; height: 3px; background: linear-gradient(90deg, transparent, var(--brass), transparent); opacity: .8; }

.main-console { width: min(620px, 62%); min-height: 355px; padding: clamp(1.6rem, 4vw, 3.2rem); border-radius: 2.2rem; background: radial-gradient(circle at 18% 12%, rgba(220,232,200,.18), transparent 16rem), linear-gradient(145deg, var(--moss), var(--forest)); box-shadow: inset 0 -6px 0 rgba(23,33,26,.55), inset 0 0 0 1px rgba(220,232,200,.16), 0 2rem 4rem rgba(0,0,0,.25); animation: consoleArrival 1.25s var(--ease) both; }
.console-label, .room-title span, .tag { font: 700 .72rem/1 var(--rounded); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
h1 { margin: 1.1rem 0 .9rem; font: 800 clamp(3rem, 8vw, 6.8rem)/.9 var(--display); letter-spacing: .045em; color: var(--cream); text-shadow: 0 0 2rem rgba(220,232,200,.22); animation: wordmarkFade 1.7s var(--ease) .25s both; }
.main-console p, .room-title p, .promise-card p { max-width: 33rem; color: rgba(243,235,210,.82); font-size: clamp(1rem, 1.45vw, 1.18rem); line-height: 1.75; }
.instrument-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2.2rem; }
.instrument-key { border: 0; cursor: pointer; padding: .76rem 1.15rem; border-radius: 999px; color: var(--cream); background: linear-gradient(145deg, var(--walnut), #5e3827); box-shadow: inset 0 -3px 0 var(--brass), 0 .8rem 1.6rem rgba(0,0,0,.18); font: 700 .76rem/1 var(--rounded); letter-spacing: .1em; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.instrument-key:hover { transform: translateY(-4px); box-shadow: inset 0 -4px 0 var(--brass), 0 1rem 2rem rgba(18,61,42,.45); }

.gauge-cluster { position: absolute; top: 5.2rem; right: 6.4rem; display: grid; gap: 1.1rem; transform: rotate(2deg); }
.gauge { width: 154px; padding: .8rem .7rem 1rem; border-radius: 2.1rem; text-align: center; color: var(--forest); background: linear-gradient(160deg, var(--cream), var(--lichen)); box-shadow: inset 0 -5px 0 rgba(197,161,90,.65), 0 1.5rem 2.8rem rgba(0,0,0,.23); animation: slideIn .95s var(--ease) both; }
.gauge:nth-child(2) { transform: translateX(2.8rem); animation-delay: .18s; }
.gauge:nth-child(3) { transform: translateX(-.2rem); animation-delay: .34s; }
.gauge-rim { width: 96px; height: 96px; margin: 0 auto .65rem; border-radius: 50%; position: relative; border: 5px solid var(--brass); background: radial-gradient(circle, var(--lichen) 0 36%, rgba(63,111,78,.24) 37% 58%, transparent 59%), var(--cream); overflow: hidden; }
.gauge b { display: block; font: 700 .9rem/1 var(--rounded); letter-spacing: .06em; }
.gauge small { display: block; margin-top: .35rem; color: rgba(23,33,26,.62); font: .72rem/1 var(--gauge); }
.needle { position: absolute; left: 46px; bottom: 45px; width: 4px; height: 38px; border-radius: 10px; background: var(--forest); transform-origin: 50% 100%; animation: needleBreath 5.6s ease-in-out infinite alternate; }
.needle-clay { background: var(--clay); animation-delay: -1.7s; }
.needle-brass { background: var(--brass); animation-delay: -3.1s; }
.ripple { position: absolute; inset: 24px; border: 1px solid rgba(63,111,78,.44); border-radius: 50%; animation: ripple 3.8s ease-in-out infinite; }
.ripple.two { inset: 15px; animation-delay: -1.2s; }
.moon { position: absolute; border-radius: 50%; background: var(--moss); }
.moon-a { width: 25px; height: 25px; left: 16px; top: 23px; }
.moon-b { width: 16px; height: 16px; right: 18px; bottom: 22px; background: var(--clay); }
.ghost-bubble { position: absolute; width: 34px; height: 39px; left: 31px; top: 28px; border-radius: 48% 48% 44% 44%; background: rgba(243,235,210,.9); box-shadow: inset -8px -10px 0 rgba(220,232,200,.65); }
.ghost-bubble::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -6px; height: 12px; background: radial-gradient(circle at 4px 5px, rgba(243,235,210,.9) 0 6px, transparent 7px), radial-gradient(circle at 17px 5px, rgba(243,235,210,.9) 0 6px, transparent 7px); }

.wooden-tabs { position: absolute; right: 1.4rem; top: 10rem; display: grid; gap: .75rem; }
.wooden-tabs span { width: 32px; height: 106px; border-radius: 999px; background: linear-gradient(180deg, #9a6943, var(--walnut)); box-shadow: inset -4px 0 0 rgba(197,161,90,.44); }
.ghost-peek { height: 68px !important; border-radius: 50% 50% 44% 44% !important; background: var(--cream) !important; animation: ghostPeek 6s ease-in-out infinite; }
.artifact-shelf { position: absolute; left: 7%; right: 13%; bottom: 4.2rem; height: 88px; border-radius: 999px 2rem 2rem 999px; background: linear-gradient(90deg, #91603d, var(--walnut)); box-shadow: inset 0 -5px 0 rgba(197,161,90,.55), 0 1.3rem 2.2rem rgba(0,0,0,.2); }
.artifact-shelf span { position: absolute; }
.ballot { top: -26px; left: 8%; padding: .65rem 1.3rem; border-radius: 1rem; background: var(--cream); color: var(--forest); font: 700 .68rem/1 var(--rounded); letter-spacing: .14em; text-transform: uppercase; transform: rotate(-7deg); animation: ballotDrift 9s ease-in-out infinite; }
.podium { width: 88px; height: 44px; left: 31%; bottom: 30px; border-radius: 88px 88px 0 0; background: var(--lichen); }
.mic { width: 8px; height: 58px; left: 47%; bottom: 24px; border-radius: 8px; background: var(--brass); transform: rotate(-10deg); }
.mic::after { content: ""; position: absolute; width: 26px; height: 18px; left: -9px; top: -10px; border-radius: 50%; background: var(--moss); }
.compass { width: 54px; height: 54px; right: 24%; bottom: 18px; border-radius: 50%; border: 3px solid var(--brass); }
.compass::after { content: ""; position: absolute; left: 23px; top: 7px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 36px solid var(--clay); transform: rotate(34deg); transform-origin: 50% 70%; }
.pebble { width: 28px; height: 20px; border-radius: 50%; background: var(--moss); bottom: 28px; }
.pebble-one { right: 12%; } .pebble-two { right: 7%; width: 18px; height: 14px; background: var(--lichen); }

.hover-lift { position: relative; transition: transform .65s var(--ease), box-shadow .65s var(--ease), filter .65s var(--ease); }
.hover-lift::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -3px; height: 3px; border-radius: 99px; background: var(--brass); opacity: 0; transition: opacity .65s var(--ease), transform .65s var(--ease); }
.hover-lift:hover { transform: translateY(-7px); filter: saturate(1.04); box-shadow: 0 2.4rem 4rem rgba(18,61,42,.48); }
.hover-lift:hover::after { opacity: 1; transform: translateY(5px); }

.room-title { justify-self: start; margin-bottom: 2rem; max-width: 630px; }
.room-title h2 { margin: .45rem 0 .75rem; font: 800 clamp(2.4rem, 6vw, 5.7rem)/.92 var(--display); letter-spacing: .035em; color: var(--cream); }
.promise-shelf { align-content: center; background: radial-gradient(circle at 80% 50%, rgba(197,161,90,.09), transparent 26rem); }
.policy-beam { width: min(1000px, 86vw); min-height: 365px; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.6rem); align-items: end; padding: 0 2rem 3rem; }
.policy-beam::before { content: ""; position: absolute; left: 0; right: 0; bottom: 1.4rem; height: 34px; border-radius: 999px; background: linear-gradient(90deg, var(--walnut), #93613e, var(--walnut)); box-shadow: inset 0 -5px 0 rgba(197,161,90,.55); }
.balance-mark { position: absolute; left: 50%; bottom: 3.3rem; width: 2px; height: 230px; background: linear-gradient(transparent, var(--brass), transparent); transform: rotate(-2deg); }
.promise-card { min-height: 262px; padding: 1.4rem; border-radius: 1.7rem; background: linear-gradient(160deg, rgba(220,232,200,.98), rgba(243,235,210,.95)); color: var(--forest); box-shadow: inset 0 -6px 0 rgba(197,161,90,.55), 0 1.3rem 2.8rem rgba(0,0,0,.18); }
.promise-card.tall { min-height: 315px; }
.promise-card h3 { margin: .85rem 0 .55rem; font: 700 1.35rem/1.1 var(--rounded); color: var(--forest); }
.promise-card p { color: rgba(23,33,26,.72); font-size: .98rem; }
.promise-card i { display: block; margin-top: 1.15rem; }
.triangle { width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-bottom: 42px solid var(--clay); border-radius: 9px; }
.circle-set { width: 112px; height: 44px; background: radial-gradient(circle at 18px 22px, var(--moss) 0 18px, transparent 19px), radial-gradient(circle at 58px 22px, var(--brass) 0 16px, transparent 17px), radial-gradient(circle at 94px 22px, var(--clay) 0 14px, transparent 15px); }
.capsule { width: 132px; height: 36px; border-radius: 999px; background: linear-gradient(90deg, var(--moss) 0 38%, var(--brass) 39% 42%, var(--lichen) 43%); }

.faction-garden { align-content: center; }
.compact { justify-self: center; text-align: center; }
.constellation-panel { width: min(820px, 82vw); border-radius: 3rem; padding: clamp(1rem, 3vw, 2.5rem); background: radial-gradient(circle at 50% 52%, rgba(220,232,200,.11), transparent 17rem), linear-gradient(150deg, rgba(63,111,78,.95), rgba(18,61,42,.95)); box-shadow: inset 0 -7px 0 rgba(197,161,90,.42), 0 2.5rem 4.4rem rgba(0,0,0,.24); }
.constellation { width: 100%; height: auto; overflow: visible; }
.brass-path, .seat-arc { fill: none; stroke: var(--brass); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 13; opacity: .72; animation: dash 16s linear infinite; }
.seat-arc { stroke-width: 11; stroke-dasharray: 28 16; opacity: .45; }
.seat-arc.small { stroke-width: 8; opacity: .35; }
.faction-dot { fill: var(--lichen); transform-origin: center; transition: transform .85s var(--ease); animation: orbit 7s ease-in-out infinite alternate; }
.faction-dot circle { filter: drop-shadow(0 16px 18px rgba(0,0,0,.18)); }
.faction-dot text { fill: var(--forest); text-anchor: middle; font: 22px var(--gauge); }
.faction-dot.clay { fill: var(--clay); } .faction-dot.pale { fill: var(--cream); }
.dot-b { animation-delay: -1s; } .dot-c { animation-delay: -2s; } .dot-d { animation-delay: -3s; } .dot-e { animation-delay: -4s; }
.constellation-panel:hover .dot-a { transform: translate(26px,-16px); }
.constellation-panel:hover .dot-b { transform: translate(11px,27px); }
.constellation-panel:hover .dot-c { transform: translate(-18px,23px); }
.constellation-panel:hover .dot-d { transform: translate(-32px,-28px); }
.constellation-panel:hover .dot-e { transform: translate(-44px,22px); }

.decision-pond { padding-bottom: 7rem; }
.pond-panel { width: min(1050px, 87vw); display: grid; grid-template-columns: .82fr 1.18fr; gap: 2rem; align-items: center; }
.pond-title { margin: 0; }
.pond-surface { min-height: 510px; position: relative; border-radius: 3rem 8rem 3rem 6rem; background: radial-gradient(circle at 42% 44%, rgba(220,232,200,.15), transparent 13rem), radial-gradient(circle at 60% 62%, rgba(197,161,90,.12), transparent 20rem), linear-gradient(145deg, #0f3022, var(--forest)); box-shadow: inset 0 0 0 1px rgba(220,232,200,.12), inset 0 -10px 0 rgba(23,33,26,.55), 0 2rem 4rem rgba(0,0,0,.24); overflow: hidden; }
.pond-surface::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; border: 1px solid rgba(197,161,90,.35); transform: rotate(-15deg); }
.floating-ballot { position: absolute; padding: .8rem 1.55rem; border-radius: 1rem; color: var(--forest); background: var(--cream); box-shadow: 0 1rem 1.8rem rgba(0,0,0,.18); font: 700 .72rem/1 var(--rounded); letter-spacing: .13em; text-transform: uppercase; animation: floatBallot 10s ease-in-out infinite alternate; }
.b1 { left: 13%; top: 18%; transform: rotate(-12deg); }
.b2 { right: 16%; top: 25%; animation-delay: -2s; transform: rotate(7deg); }
.b3 { left: 24%; bottom: 22%; animation-delay: -4s; transform: rotate(9deg); }
.b4 { right: 24%; bottom: 17%; animation-delay: -6s; transform: rotate(-5deg); }
.clay-slip { background: var(--clay); color: var(--cream); }
.seal { position: absolute; left: 50%; top: 52%; width: 158px; height: 158px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--lichen) 0 48%, rgba(220,232,200,.2) 49% 63%, transparent 64%); box-shadow: 0 0 0 9px rgba(197,161,90,.38), 0 1.3rem 2.6rem rgba(0,0,0,.22); }
.seal i { position: absolute; inset: 44px; border-radius: 999px; background: linear-gradient(90deg, var(--moss), var(--brass), var(--moss)); }

.room.in-view .room-title, .room.in-view .promise-card, .room.in-view .constellation-panel, .room.in-view .pond-panel { animation: riseRoom .9s var(--ease) both; }
.room.pulsed .gauge-rim, .room.pulsed .promise-card, .room.pulsed .constellation-panel, .room.pulsed .seal { animation: ceremonialPulse 1.2s var(--ease) both; }

@keyframes consoleArrival { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes wordmarkFade { from { opacity: 0; filter: blur(8px); transform: translateY(12px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(46px) translateY(18px); } to { opacity: 1; } }
@keyframes needleBreath { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }
@keyframes ripple { 0%,100% { transform: scale(.85); opacity: .25; } 50% { transform: scale(1.18); opacity: .72; } }
@keyframes lampBreath { from { opacity: .45; transform: scale(.92); } to { opacity: .9; transform: scale(1.05); } }
@keyframes ghostPeek { 0%,70%,100% { transform: translateY(0); opacity: .45; } 78%,88% { transform: translateY(-18px); opacity: .9; } }
@keyframes ballotDrift { from { transform: translateY(0) rotate(-7deg); } to { transform: translateY(12px) rotate(-2deg); } }
@keyframes dash { to { stroke-dashoffset: -260; } }
@keyframes orbit { from { transform: translateY(-5px); } to { transform: translateY(7px); } }
@keyframes floatBallot { from { margin-top: -12px; margin-left: -8px; } to { margin-top: 16px; margin-left: 18px; } }
@keyframes riseRoom { from { opacity: .2; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes ceremonialPulse { 0% { filter: brightness(1); } 48% { filter: brightness(1.2) saturate(1.08); } 100% { filter: brightness(1); } }

@media (max-width: 900px) {
  .side-keys { top: auto; right: 1rem; left: 1rem; bottom: 1rem; transform: none; display: flex; justify-content: center; }
  .wood-key { width: auto; border-radius: 999px; padding-inline: .9rem; }
  .wall-unit { width: 100%; min-height: 850px; }
  .main-console { width: 100%; }
  .gauge-cluster { position: relative; right: auto; top: auto; margin-top: 1.4rem; grid-template-columns: repeat(3, 1fr); transform: none; }
  .gauge { width: auto; }
  .wooden-tabs { display: none; }
  .artifact-shelf { left: 2rem; right: 2rem; }
  .policy-beam, .pond-panel { grid-template-columns: 1fr; width: 100%; }
  .policy-beam { padding-inline: 0; }
}

@media (max-width: 620px) {
  .room { padding-inline: 1rem; }
  .gauge-cluster { grid-template-columns: 1fr; }
  .policy-beam { display: block; }
  .promise-card { margin-bottom: 1rem; }
  .pond-surface { min-height: 430px; }
}
