:root {
  /* Compliance language: Mono* Mono** sparingly numbers Slab* Slab** primary titles. weights 3* 3** longer explanatory clarity needed */
  --bog-ink: #080A06;
  --bone-parchment: #F2E8CF;
  --moss-oxide: #4D6B32;
  --copper-spore: #B85C2A;
  --quartz-milk: #D8E7D2;
  --bruised-amethyst: #4A2D57;
  --wet-clay: #5A3A24;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bog-ink);
  color: var(--bone-parchment);
  font-family: "Source Sans 3", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 16%, rgba(77, 107, 50, 0.28), transparent 30%),
    radial-gradient(circle at 82% 70%, rgba(74, 45, 87, 0.25), transparent 34%),
    linear-gradient(90deg, rgba(8, 10, 6, 0.98) 0 18%, transparent 42%),
    linear-gradient(0deg, rgba(8, 10, 6, 0.96) 0 9%, transparent 36%);
  pointer-events: none;
  z-index: 1;
}

.ledger {
  position: relative;
  z-index: 2;
}

.chamber {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 6rem);
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}

.wash {
  position: absolute;
  border-radius: 47% 53% 62% 38% / 41% 37% 63% 59%;
  filter: blur(24px);
  opacity: 0.28;
  transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0) scale(var(--wash-scale, 1));
  transition: opacity 900ms ease, transform 1200ms ease;
}

.wash-one {
  width: 42vw;
  height: 38vh;
  left: -8vw;
  top: 8vh;
  background: rgba(77, 107, 50, 0.72);
}

.wash-two {
  width: 36vw;
  height: 44vh;
  right: -9vw;
  bottom: 2vh;
  background: rgba(216, 231, 210, 0.35);
}

.wash-three {
  width: 30vw;
  height: 30vw;
  left: 38vw;
  top: 40vh;
  background: rgba(184, 92, 42, 0.22);
}

.grain {
  position: absolute;
  inset: -10%;
  opacity: 0.18;
  background-image:
    radial-gradient(circle, rgba(242, 232, 207, 0.5) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(90, 58, 36, 0.7) 1px, transparent 2px);
  background-size: 37px 41px, 53px 47px;
}

.root {
  position: absolute;
  background: var(--wet-clay);
  opacity: 0.52;
  transform-origin: top;
  filter: blur(0.5px);
}

.root::before,
.root::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 999px;
}

.root-a {
  width: 5px;
  height: 58vh;
  left: 7vw;
  top: -3vh;
  transform: rotate(-14deg);
}

.root-a::before {
  width: 3px;
  height: 28vh;
  left: 4px;
  top: 22vh;
  transform: rotate(34deg);
}

.root-a::after {
  width: 2px;
  height: 21vh;
  right: 4px;
  top: 35vh;
  transform: rotate(-42deg);
}

.root-b {
  width: 4px;
  height: 46vh;
  right: 12vw;
  top: -5vh;
  transform: rotate(18deg);
}

.root-b::before {
  width: 2px;
  height: 25vh;
  right: 2px;
  top: 16vh;
  transform: rotate(-34deg);
}

.root-b::after {
  width: 2px;
  height: 18vh;
  left: 3px;
  top: 26vh;
  transform: rotate(48deg);
}

.focus-lens {
  position: fixed;
  width: clamp(120px, 17vw, 230px);
  height: clamp(170px, 26vw, 340px);
  left: var(--lens-x, 68vw);
  top: var(--lens-y, 28vh);
  transform: translate(-50%, -50%) rotate(17deg);
  clip-path: polygon(44% 0, 100% 29%, 75% 100%, 13% 84%, 0 22%);
  background: linear-gradient(135deg, rgba(216, 231, 210, 0.35), rgba(242, 232, 207, 0.06) 45%, rgba(184, 92, 42, 0.28));
  border: 1px solid rgba(216, 231, 210, 0.55);
  box-shadow: 0 0 30px rgba(216, 231, 210, 0.18), inset 0 0 34px rgba(8, 10, 6, 0.55);
  opacity: 0.72;
}

h1,
h2,
h3 {
  font-family: "Roboto Slab", serif;
  margin: 0;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

p {
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1.45;
}

.micro-code,
.tag,
.seal,
.field-notes span {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.blur-item {
  filter: blur(10px);
  opacity: 0.45;
  transform: translateY(34px) rotate(var(--tilt, 0deg));
  transition: filter 1000ms ease, opacity 1000ms ease, transform 1000ms ease;
}

.chamber.in-view .blur-item {
  filter: blur(0);
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt, 0deg));
}

.rain-gate {
  padding-left: clamp(1.5rem, 4vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(90deg, var(--bog-ink) 0 27%, rgba(8, 10, 6, 0.52) 46%, transparent),
    radial-gradient(circle at 76% 24%, rgba(216, 231, 210, 0.2), transparent 20%);
}

.gate-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22vw;
  height: 100%;
  background: linear-gradient(var(--bog-ink), var(--wet-clay), var(--bog-ink));
  z-index: -1;
}

.rain-gate h1 {
  font-size: clamp(5rem, 19vw, 18rem);
  max-width: 82vw;
  color: var(--bone-parchment);
  text-shadow: 0 13px 0 rgba(90, 58, 36, 0.38), 0 0 36px rgba(216, 231, 210, 0.12);
  transform: translateX(-1vw);
}

.rain-gate .micro-code {
  color: var(--copper-spore);
  margin-left: 4vw;
}

.opening-note {
  width: min(29rem, 54vw);
  margin: 2rem 0 0 42vw;
  color: var(--quartz-milk);
  --tilt: -2deg;
}

.fog-sheet {
  position: absolute;
  background: rgba(216, 231, 210, 0.18);
  filter: blur(18px);
  border-radius: 43% 57% 38% 62% / 51% 35% 65% 49%;
}

.fog-left {
  width: 36vw;
  height: 34vh;
  left: 13vw;
  top: 28vh;
  animation: fogClear 8s ease-in-out infinite alternate;
}

.fog-right {
  width: 43vw;
  height: 36vh;
  right: 2vw;
  top: 20vh;
  animation: fogClear 10s ease-in-out infinite alternate-reverse;
}

@keyframes fogClear {
  from { opacity: 0.72; transform: translateX(-2vw) scale(1); }
  to { opacity: 0.34; transform: translateX(3vw) scale(1.08); }
}

.crystal {
  position: absolute;
  clip-path: polygon(48% 0, 100% 26%, 82% 100%, 18% 87%, 0 23%);
  background: linear-gradient(150deg, var(--quartz-milk), rgba(216, 231, 210, 0.12) 45%, var(--bruised-amethyst));
}

.shard-opening {
  right: 5vw;
  top: 5vh;
  width: 18vw;
  height: 36vh;
  box-shadow: 0 0 28px rgba(184, 92, 42, 0.45);
}

.root-curtain {
  position: absolute;
  left: 0;
  bottom: -8vh;
  width: 100%;
  height: 24vh;
  background: repeating-linear-gradient(104deg, transparent 0 34px, rgba(90, 58, 36, 0.86) 35px 39px, transparent 40px 72px);
  filter: blur(0.7px);
}

.soil-ledger {
  background: linear-gradient(115deg, var(--bog-ink) 0 48%, var(--moss-oxide) 49% 50%, rgba(77, 107, 50, 0.2) 51%, transparent), var(--bog-ink);
}

.dark-pocket {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48vw;
  height: 70vh;
  background: radial-gradient(circle at 30% 62%, rgba(90, 58, 36, 0.72), var(--bog-ink) 64%);
}

.notebook {
  position: relative;
  width: min(42rem, 74vw);
  margin: 8vh 0 0 28vw;
  padding: clamp(2rem, 5vw, 4.6rem);
  color: var(--bog-ink);
  background: var(--bone-parchment);
  clip-path: polygon(2% 4%, 94% 0, 100% 91%, 12% 100%, 0 78%);
  box-shadow: -24px 28px 0 rgba(90, 58, 36, 0.62), 0 0 70px rgba(216, 231, 210, 0.1);
  --tilt: 2.5deg;
}

.notebook h2,
.seam-title,
.cabinet-title,
.closing-patch h2 {
  font-size: clamp(3.4rem, 8vw, 8rem);
}

.notebook p {
  max-width: 32rem;
}

.ledger-mark {
  font-family: "Zilla Slab", serif;
  color: var(--wet-clay);
  border-left: 5px solid var(--copper-spore);
  padding-left: 1rem;
}

.tag {
  position: absolute;
  display: inline-block;
  padding: 0.5rem 0.7rem;
  background: var(--copper-spore);
  color: var(--bone-parchment);
}

.tag-top {
  top: -1rem;
  left: 11%;
}

.tag-edge {
  right: -2.2rem;
  top: 43%;
  transform: rotate(90deg);
}

.field-notes {
  position: absolute;
  left: 7vw;
  top: 51vh;
  width: 18rem;
  padding: 1.2rem;
  border: 1px solid rgba(216, 231, 210, 0.34);
  color: var(--quartz-milk);
  --tilt: -6deg;
}

.field-notes b {
  font-family: "Zilla Slab", serif;
  display: block;
  color: var(--bone-parchment);
  font-size: 1.7rem;
}

.crystal-seam {
  background: radial-gradient(circle at 15% 90%, rgba(77, 107, 50, 0.4), transparent 34%), var(--bog-ink);
}

.seam-ridge {
  position: absolute;
  inset: -10vh -4vw;
  background: linear-gradient(117deg, transparent 0 36%, var(--quartz-milk) 36.4% 38%, var(--bruised-amethyst) 38.3% 45%, var(--wet-clay) 45.4% 47%, transparent 47.5%);
  opacity: 0.86;
}

.seam-title {
  position: absolute;
  left: 9vw;
  top: 14vh;
  width: min-content;
  color: var(--bone-parchment);
  --tilt: -4deg;
}

.seam-copy {
  position: absolute;
  right: 9vw;
  bottom: 17vh;
  width: min(30rem, 42vw);
  color: var(--quartz-milk);
}

.facet {
  position: absolute;
  padding: 1.2rem;
  font-family: "Zilla Slab", serif;
  font-size: clamp(1.3rem, 2.2vw, 2.4rem);
  color: var(--bog-ink);
  background: rgba(216, 231, 210, 0.86);
  clip-path: polygon(10% 0, 100% 14%, 88% 82%, 24% 100%, 0 43%);
}

.facet-a {
  left: 38vw;
  top: 20vh;
  width: 18rem;
}

.facet-b {
  left: 47vw;
  top: 45vh;
  width: 21rem;
  background: rgba(242, 232, 207, 0.92);
}

.facet-c {
  left: 28vw;
  bottom: 13vh;
  width: 16rem;
  background: rgba(184, 92, 42, 0.9);
  color: var(--bone-parchment);
}

.moss-cabinet {
  background:
    radial-gradient(ellipse at 76% 26%, rgba(216, 231, 210, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bog-ink), #10180c 46%, var(--bog-ink));
}

.cabinet-title {
  position: absolute;
  right: 8vw;
  top: 9vh;
  color: var(--bone-parchment);
}

.shelf {
  position: absolute;
  height: 1.2rem;
  background: linear-gradient(90deg, var(--wet-clay), var(--moss-oxide));
  box-shadow: 0 18px 25px rgba(0, 0, 0, 0.42);
}

.shelf-high {
  left: 6vw;
  top: 34vh;
  width: 58vw;
  transform: rotate(-3deg);
}

.shelf-low {
  right: -4vw;
  bottom: 24vh;
  width: 70vw;
  transform: rotate(2deg);
}

.inventory {
  position: absolute;
  width: min(22rem, 35vw);
  padding: 1.5rem;
  background: rgba(242, 232, 207, 0.93);
  color: var(--bog-ink);
  border: 2px solid var(--wet-clay);
  box-shadow: 12px 18px 0 rgba(77, 107, 50, 0.48);
}

.inventory h3 {
  font-family: "Zilla Slab", serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.card-one {
  left: 9vw;
  top: 22vh;
  --tilt: -5deg;
}

.card-two {
  left: 38vw;
  top: 43vh;
  --tilt: 4deg;
}

.card-three {
  right: 9vw;
  bottom: 14vh;
  --tilt: -2deg;
}

.icon {
  display: block;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 0.7rem;
  background: var(--moss-oxide);
}

.mushroom {
  clip-path: polygon(50% 0, 90% 33%, 73% 52%, 59% 49%, 61% 100%, 39% 100%, 41% 49%, 24% 53%, 9% 33%);
}

.leaf {
  clip-path: ellipse(32% 48% at 50% 50%);
  transform: rotate(28deg);
}

.lantern {
  clip-path: polygon(36% 0, 64% 0, 73% 18%, 90% 34%, 80% 100%, 20% 100%, 10% 34%, 27% 18%);
  background: var(--copper-spore);
}

.stone {
  position: absolute;
  background: rgba(216, 231, 210, 0.44);
  filter: blur(2px);
  clip-path: polygon(24% 0, 84% 12%, 100% 64%, 59% 100%, 6% 75%, 0 28%);
}

.stone-a {
  width: 14vw;
  height: 12vw;
  left: 23vw;
  bottom: 10vh;
}

.stone-b {
  width: 9vw;
  height: 11vw;
  right: 28vw;
  top: 16vh;
}

.twine-loop {
  position: absolute;
  left: 70vw;
  top: 33vh;
  width: 9rem;
  height: 6rem;
  border: 3px solid var(--wet-clay);
  border-radius: 50%;
  transform: rotate(-23deg);
}

.lantern-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: radial-gradient(circle at 70% 48%, rgba(242, 232, 207, 0.32), rgba(184, 92, 42, 0.11) 18%, transparent 38%), var(--bog-ink);
}

.lantern-halo {
  position: absolute;
  right: 10vw;
  top: 20vh;
  width: 42vw;
  height: 55vh;
  background: radial-gradient(circle, rgba(242, 232, 207, 0.42), rgba(184, 92, 42, 0.16) 34%, transparent 66%);
  filter: blur(18px);
}

.closing-patch {
  position: relative;
  width: min(38rem, 58vw);
  margin-right: 8vw;
  padding: clamp(2rem, 4.6vw, 4rem);
  background: var(--bone-parchment);
  color: var(--bog-ink);
  clip-path: polygon(4% 0, 100% 7%, 92% 100%, 0 86%);
  box-shadow: -18px 22px 0 rgba(184, 92, 42, 0.38);
  --tilt: 1.5deg;
}

.closing-patch .micro-code,
.seal {
  color: var(--wet-clay);
}

.seal {
  display: block;
  margin-top: 1rem;
}

.mineral-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(131deg, transparent 0 7rem, rgba(216, 231, 210, 0.18) 7.05rem 7.12rem, transparent 7.2rem 11rem);
  opacity: 0.5;
}

body[data-active="soil-ledger"] .wash-one,
body[data-active="moss-cabinet"] .wash-one {
  opacity: 0.45;
  --wash-scale: 1.18;
}

body[data-active="crystal-seam"] .focus-lens {
  opacity: 0.92;
  box-shadow: 0 0 46px rgba(184, 92, 42, 0.48), inset 0 0 30px rgba(216, 231, 210, 0.32);
}

@media (max-width: 760px) {
  .chamber {
    padding: 2rem;
  }

  .opening-note,
  .notebook,
  .seam-copy,
  .closing-patch {
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }

  .field-notes,
  .facet,
  .inventory,
  .cabinet-title,
  .seam-title {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
    margin: 1.5rem 0;
  }

  .crystal-seam,
  .moss-cabinet {
    display: block;
    padding-top: 18vh;
  }

  .shelf,
  .stone,
  .twine-loop {
    display: none;
  }
}
