:root {
  /* Source Sans 3** for sidebar labels */
  --fountain-teal: #4CA6A8;
  --ledger-cream: #F3E3C4;
  --courthouse-brick: #A85E45;
  --pastoral-moss: #506B3A;
  --ink-plum: #2A1D2E;
  --sunlit-apricot: #F2B36D;
  --rain-slate: #637887;
  --sidebar: 244px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink-plum);
  background: var(--ledger-cream);
  font-family: "Source Sans 3", Inter, system-ui, sans-serif;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  z-index: 20;
  background-image: radial-gradient(circle at 12% 16%, rgba(42,29,46,.22) 0 1px, transparent 1px), radial-gradient(circle at 74% 66%, rgba(168,94,69,.18) 0 1px, transparent 1px);
  background-size: 16px 16px, 23px 23px;
  mix-blend-mode: multiply;
}

.directory {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  padding: 30px 22px;
  z-index: 10;
  overflow: hidden;
  color: var(--ledger-cream);
  background: radial-gradient(circle at 20% 15%, rgba(242,179,109,.18), transparent 38%), linear-gradient(160deg, #2A1D2E, #506B3A);
  box-shadow: 20px 0 44px rgba(42, 29, 46, .28);
}

.directory-grain {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(243,227,196,.28);
  background: repeating-linear-gradient(92deg, rgba(243,227,196,.04) 0 2px, transparent 2px 9px);
  clip-path: polygon(0 0, 100% 0, 93% 100%, 0 96%);
}

.wordmark {
  position: relative;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 34px;
  line-height: .92;
  letter-spacing: -.03em;
  color: var(--ledger-cream);
  text-shadow: 2px 2px 0 rgba(168,94,69,.4);
}

.plaque-line {
  position: relative;
  height: 1px;
  margin: 26px 0;
  background: linear-gradient(90deg, transparent, var(--sunlit-apricot), transparent);
}

.chapter-nav { position: relative; display: grid; gap: 13px; }

.chapter-link {
  position: relative;
  border: 1px solid rgba(243,227,196,.24);
  background: rgba(42,29,46,.22);
  color: var(--ledger-cream);
  padding: 12px 12px 12px 38px;
  font: 700 12px/1 "Source Sans 3", Inter, sans-serif;
  text-align: left;
  letter-spacing: .11em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 94% 0, 100% 50%, 92% 100%, 0 100%, 8% 50%);
  cursor: pointer;
  transition: transform .45s ease, background .45s ease, color .45s ease;
}

.chapter-link span {
  position: absolute;
  left: 12px;
  color: var(--sunlit-apricot);
}

.chapter-link.active, .chapter-link:hover {
  background: rgba(76,166,168,.28);
  color: #FFFFFF;
  transform: translateX(6px);
}

.water-track { position: absolute; right: 14px; top: 164px; bottom: 90px; width: 2px; background: rgba(243,227,196,.22); }
.water-bead { position: absolute; left: -7px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--fountain-teal); box-shadow: 0 0 20px var(--fountain-teal); transition: top .8s cubic-bezier(.2,.9,.1,1); }
.docket-symbols { position: absolute; left: 25px; right: 25px; bottom: 24px; display: flex; justify-content: space-between; color: rgba(243,227,196,.64); font-family: "EB Garamond", Georgia, serif; font-size: 24px; }

.rooms {
  margin-left: var(--sidebar);
  width: calc(100vw - var(--sidebar));
  height: 100vh;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rooms::-webkit-scrollbar { display: none; }

.room {
  position: relative;
  flex: 0 0 calc(100vw - var(--sidebar));
  min-height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
  isolation: isolate;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .42;
  background: linear-gradient(102deg, transparent 0 42%, rgba(42,29,46,.12) 42.4% 44%, transparent 44.4% 100%);
}

.tri-shadow { position: absolute; left: 0; top: 0; width: 48%; height: 100%; background: linear-gradient(105deg, rgba(42,29,46,.28), transparent 64%); clip-path: polygon(0 0, 72% 0, 36% 100%, 0 100%); z-index: 0; }
.room-content { position: relative; z-index: 1; min-height: 100%; padding: 7vh 7vw; }

.fountain-room { background: linear-gradient(135deg, #F3E3C4 0%, #F2B36D 38%, #4CA6A8 100%); }
.clerk-room { background: radial-gradient(circle at 70% 20%, rgba(76,166,168,.4), transparent 28%), linear-gradient(135deg, #F3E3C4, #F2B36D); }
.angle-room { color: var(--ledger-cream); background: radial-gradient(circle at 20% 15%, rgba(242,179,109,.45), transparent 38%), linear-gradient(160deg, #2A1D2E, #506B3A); }
.ledger-room { background: radial-gradient(circle at 80% 10%, rgba(76,166,168,.45), transparent 30%), linear-gradient(120deg, #F3E3C4, #506B3A); }
.porch-room { background: linear-gradient(145deg, #637887 0%, #2A1D2E 42%, #F2B36D 130%); color: var(--ledger-cream); }

.fountain-layout { display: grid; grid-template-columns: minmax(380px, 1fr) 260px; gap: 4vw; align-items: center; }
.basin { position: relative; min-height: 72vh; display: grid; place-items: center; text-align: center; filter: url(#watery); }
.ripple-svg { position: absolute; width: min(76vw, 920px); height: min(76vh, 720px); overflow: visible; }
.basin-edge { fill: rgba(76,166,168,.20); stroke: #2A1D2E; stroke-width: 3; }
.ripple { fill: none; stroke: #4CA6A8; stroke-width: 2; opacity: .65; transform-origin: center; animation: ripplePulse 4.8s ease-in-out infinite; }
.r2 { animation-delay: .7s; stroke: #F3E3C4; }.r3 { animation-delay: 1.4s; stroke: #A85E45; }
.gable-reflection { fill: rgba(42,29,46,.22); transform-origin: center; transform: scaleY(-1) translateY(-590px); }
.drop { position: absolute; width: 18px; height: 18px; top: 17%; left: 50%; border-radius: 50% 50% 50% 0; background: #4CA6A8; transform: rotate(-45deg) translateY(-110px); opacity: 0; box-shadow: 0 0 22px rgba(76,166,168,.9); }
body.has-ripple .drop { animation: droplet 1.2s ease forwards; }
.basin h1 { position: relative; max-width: 760px; margin: 0; font-family: "EB Garamond", Georgia, serif; font-size: clamp(70px, 9vw, 145px); line-height: .78; letter-spacing: -.055em; color: var(--ink-plum); }
.reflected-title { position: absolute; bottom: 14%; margin: 0; transform: scaleY(-1); opacity: .26; font-family: "EB Garamond", Georgia, serif; font-size: clamp(42px, 7vw, 104px); color: var(--ink-plum); filter: blur(.6px); }
.docket-tab { align-self: end; padding: 22px; background: rgba(243,227,196,.76); border-left: 8px solid var(--courthouse-brick); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 25px; transform: rotate(-3deg); box-shadow: 0 16px 40px rgba(42,29,46,.18); }

.split-layout, .chamber-layout, .ledger-layout, .porch-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center; }
.copy-block { padding: clamp(28px, 4vw, 60px); position: relative; box-shadow: 0 26px 70px rgba(42,29,46,.22); }
.angled-paper { background: rgba(243,227,196,.9); clip-path: polygon(0 0, 92% 0, 100% 12%, 96% 100%, 4% 96%); }
.copy-block h2, .final-verdict h2 { margin: 0 0 24px; font-family: "EB Garamond", Georgia, serif; font-size: clamp(48px, 6vw, 94px); line-height: .86; letter-spacing: -.045em; }
.copy-block p:not(.marginalia), .final-verdict p:not(.marginalia) { font-size: clamp(18px, 1.6vw, 24px); line-height: 1.42; max-width: 620px; }
.marginalia { margin: 0 0 18px; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 24px; color: var(--courthouse-brick); }
.angle-room .marginalia, .porch-room .marginalia { color: var(--sunlit-apricot); }
.stamp-button { border: 2px solid var(--courthouse-brick); color: var(--courthouse-brick); background: transparent; padding: 12px 18px; font: 800 13px/1 "Source Sans 3", sans-serif; text-transform: uppercase; letter-spacing: .16em; transform: rotate(-2deg); cursor: pointer; transition: .35s ease; }
.stamp-button:hover, .stamp-button.stamped { background: var(--courthouse-brick); color: var(--ledger-cream); box-shadow: 5px 5px 0 rgba(42,29,46,.22); }
.stamp-button.final { border-color: var(--sunlit-apricot); color: var(--sunlit-apricot); }
.stamp-button.final:hover, .stamp-button.final.stamped { background: var(--sunlit-apricot); color: var(--ink-plum); }

.window-object { position: relative; min-height: 520px; background: linear-gradient(150deg, rgba(99,120,135,.5), rgba(76,166,168,.32)); border: 18px solid var(--rain-slate); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 94%); box-shadow: 0 30px 80px rgba(42,29,46,.28); }
.brass-label { position: absolute; top: 24px; left: 30px; padding: 8px 18px; background: var(--sunlit-apricot); color: var(--ink-plum); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; }
.glass-pane { position: absolute; inset: 88px 44px 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.glass-pane span { background: linear-gradient(140deg, rgba(243,227,196,.58), rgba(76,166,168,.18)); border: 1px solid rgba(243,227,196,.6); }
.ink-bloom { position: absolute; right: 50px; bottom: 54px; width: 120px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(42,29,46,.5), transparent 68%); animation: bloom 5s ease-in-out infinite; }

.bubble { position: absolute; width: 110px; height: 110px; border: 2px solid rgba(76,166,168,.8); border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.72), rgba(76,166,168,.18) 45%, rgba(42,29,46,.08)); display: grid; place-items: center; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 24px; color: var(--ink-plum); animation: floatBubble 8s ease-in-out infinite; }
.b1 { right: 7vw; top: 12vh; }.b2 { left: 9vw; bottom: 10vh; animation-delay: 1.7s; }.b3 { right: 12vw; top: 18vh; animation-delay: .8s; }.b4 { left: 34vw; bottom: 9vh; animation-delay: 2.2s; }

.angle-stack { position: relative; min-height: 540px; }
.writ { position: absolute; width: 360px; height: 230px; padding: 26px; background: var(--ledger-cream); color: var(--ink-plum); font-family: "EB Garamond", Georgia, serif; font-size: 42px; box-shadow: 0 24px 50px rgba(0,0,0,.3); clip-path: polygon(0 0, 86% 0, 100% 28%, 92% 100%, 0 94%); }
.writ-a { left: 5%; top: 10%; transform: rotate(-11deg); }.writ-b { left: 23%; top: 32%; transform: rotate(7deg); background: #F2B36D; }.writ-c { left: 1%; top: 54%; transform: rotate(-4deg); background: #4CA6A8; }
.dark-panel { background: rgba(42,29,46,.45); border: 1px solid rgba(243,227,196,.26); clip-path: polygon(0 9%, 100% 0, 93% 92%, 8% 100%); }

.ledger-book { position: relative; min-height: 600px; background: rgba(243,227,196,.93); border: 1px solid rgba(42,29,46,.25); box-shadow: 0 30px 80px rgba(42,29,46,.26); transform: rotate(-2deg); clip-path: polygon(0 0, 96% 4%, 100% 96%, 5% 100%); }
.ledger-lines { position: absolute; inset: 56px; background: repeating-linear-gradient(0deg, transparent 0 33px, rgba(99,120,135,.45) 34px 35px), repeating-linear-gradient(90deg, rgba(168,94,69,.25) 0 2px, transparent 2px 116px); mask-image: radial-gradient(circle at 45% 48%, transparent 0 16%, black 22%); }
.ivy { position: absolute; width: 220px; height: 220px; border-left: 8px solid var(--pastoral-moss); border-bottom: 8px solid var(--pastoral-moss); border-radius: 0 0 0 100%; }
.ivy::before, .ivy::after { content: ""; position: absolute; width: 34px; height: 22px; background: var(--pastoral-moss); border-radius: 80% 0 80% 0; }
.ivy::before { left: 54px; top: 60px; transform: rotate(25deg); }.ivy::after { left: 130px; top: 145px; transform: rotate(-18deg); }
.vine-one { left: 30px; top: 26px; }.vine-two { right: 30px; bottom: 26px; transform: rotate(180deg); }
.wax-seal { position: absolute; right: 78px; bottom: 80px; width: 100px; height: 100px; border-radius: 50%; background: var(--courthouse-brick); color: var(--ledger-cream); display: grid; place-items: center; font-family: "EB Garamond", Georgia, serif; font-size: 54px; clip-path: polygon(50% 0, 62% 22%, 87% 13%, 78% 39%, 100% 50%, 77% 61%, 87% 87%, 61% 78%, 50% 100%, 39% 78%, 13% 87%, 23% 61%, 0 50%, 23% 39%, 13% 13%, 39% 22%); }
.garden-note { background: rgba(243,227,196,.84); clip-path: polygon(5% 0, 100% 7%, 95% 100%, 0 91%); }

.porch-layout { grid-template-columns: 1fr; align-content: center; }
.porch-roof { width: min(78vw, 1000px); height: auto; margin: 0 auto -30px; display: block; fill: rgba(42,29,46,.38); stroke: var(--sunlit-apricot); stroke-width: 4; }
.swallow { fill: none; stroke: var(--ledger-cream); stroke-width: 5; animation: wing 3.7s ease-in-out infinite; }
.s2 { animation-delay: 1s; }
.final-verdict { max-width: 860px; margin: 0 auto; padding: 48px; text-align: center; background: rgba(42,29,46,.35); border: 1px solid rgba(243,227,196,.26); clip-path: polygon(8% 0, 100% 5%, 92% 100%, 0 94%); }

.cursor-ripple { position: fixed; width: 20px; height: 20px; border: 2px solid var(--fountain-teal); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%) scale(0); opacity: 0; z-index: 30; }
.cursor-ripple.show { animation: cursorRing .75s ease-out; }

@keyframes ripplePulse { 0%,100% { transform: scale(1); opacity: .28; } 50% { transform: scale(1.16); opacity: .78; } }
@keyframes droplet { 0% { opacity: 0; transform: rotate(-45deg) translateY(-110px); } 55% { opacity: 1; transform: rotate(-45deg) translateY(0); } 100% { opacity: 0; transform: rotate(-45deg) translateY(12px) scale(.45); } }
@keyframes bloom { 0%,100% { transform: scale(.8); opacity: .22; } 50% { transform: scale(1.3); opacity: .55; } }
@keyframes floatBubble { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-26px) translateX(12px); } }
@keyframes wing { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes cursorRing { 0% { opacity: .85; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(5); } }

@media (max-width: 880px) {
  :root { --sidebar: 150px; }
  .directory { padding: 20px 12px; }
  .wordmark { font-size: 24px; }
  .chapter-link { padding-left: 30px; font-size: 10px; }
  .fountain-layout, .split-layout, .chamber-layout, .ledger-layout { grid-template-columns: 1fr; }
  .room-content { padding: 5vh 5vw; }
  .docket-tab { display: none; }
  .window-object, .ledger-book, .angle-stack { min-height: 360px; }
  .writ { width: 260px; height: 160px; }
}
