:root {
  color-scheme: dark;
  --roots-ink: #030303;
  --roots-mud: #18120f;
  --roots-bone: #eee8df;
  --roots-rust: #a44330;
  --roots-violet: #b45cff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.roots-world-page {
  margin: 0;
  overflow-x: hidden;
  color: var(--roots-bone);
  background:
    radial-gradient(circle at 18% 12%, rgba(164, 67, 48, 0.12), transparent 32rem),
    radial-gradient(circle at 82% 58%, rgba(180, 92, 255, 0.1), transparent 38rem),
    var(--roots-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.roots-glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 255, 255, 0.12) 5px 6px);
  mix-blend-mode: screen;
}

.roots-container {
  position: relative;
}

#roots {
  min-height: 100svh;
}

.roots-chapter {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding: clamp(5rem, 9vw, 9rem) clamp(1rem, 6vw, 6rem);
  border-bottom: 1px solid rgba(238, 232, 223, 0.1);
  isolation: isolate;
}

.roots-chapter::before {
  content: attr(data-chapter);
  position: absolute;
  right: 3vw;
  top: 4vh;
  z-index: -1;
  color: rgba(238, 232, 223, 0.035);
  font-size: clamp(10rem, 36vw, 34rem);
  font-weight: 950;
  line-height: 0.75;
}

.timber-fight {
  display: block;
  align-content: normal;
  min-height: 240vh;
  min-height: 240svh;
  padding: 0;
  overflow: clip;
  background: #030303;
}

.timber-fight__sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background-image: url("assets/images/starry_sky_and_heart_shaped_silhouette.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.timber-fight::before {
  content: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.timber-fight__start {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  transition: opacity 400ms ease, visibility 400ms ease;
}

.timber-fight__start span {
  width: 0;
  height: 0;
  margin-left: 0.55rem;
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  border-left: 34px solid rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 18px rgba(180, 92, 255, 0.9));
}

.timber-fight__start::before {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(232, 121, 249, 0.7);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: 0 0 42px rgba(168, 85, 247, 0.35);
}

.timber-fight__start span { position: relative; z-index: 1; }
.timber-fight.is-started .timber-fight__start { opacity: 0; visibility: hidden; pointer-events: none; }

.timber-fight__video,
.timber-fight__video-overlay,
.timber-fight__memory-stream {
  position: absolute;
  inset: 0;
}

.timber-fight__video {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #030303;
}

.timber-fight__video.is-unavailable {
  display: none;
}

.timber-fight__video-overlay {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 28%, rgba(0, 0, 0, 0.76)),
    radial-gradient(circle at 78% 45%, rgba(180, 92, 255, 0.13), transparent 34rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 45%, rgba(0, 0, 0, 0.18));
}

.timber-fight__memory-stream {
  z-index: 2;
  pointer-events: none;
  right: 54%;
  overflow: visible;
}

.timber-fight__intro {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 100%;
  padding: clamp(1.25rem, 5vw, 5rem);
  text-align: center;
  background: radial-gradient(circle at 50% 52%, rgba(9, 2, 18, 0.46), rgba(0, 0, 0, 0.82) 72%);
  transition: opacity 480ms ease, visibility 480ms ease;
}

.timber-fight.is-started .timber-fight__intro {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.timber-fight__intro .muddy-font {
  margin: 0.65rem 0 1rem;
  color: #f8f1ff;
  font-size: clamp(2.8rem, 6vw, 6rem);
  text-shadow: 0 0 34px rgba(180, 92, 255, 0.34);
}

.timber-fight__subhead {
  max-width: 620px;
  margin: 0;
  color: #e9cfff;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 800;
  line-height: 1.45;
}

.timber-fight__intro-copy {
  max-width: 38rem;
  margin: 1.35rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(216, 180, 254, 0.18);
  color: rgba(248, 244, 251, 0.78);
  font-size: clamp(0.78rem, 1vw, 0.96rem);
  line-height: 1.55;
}

.timber-fight__begin {
  min-height: 50px;
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(232, 121, 249, 0.7);
  border-radius: 6px;
  color: #fff;
  background: rgba(14, 3, 27, 0.82);
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(180, 92, 255, 0.3);
}

.timber-fight__begin:hover,
.timber-fight__begin:focus-visible {
  border-color: #f6ddff;
  outline: none;
  box-shadow: 0 0 38px rgba(180, 92, 255, 0.55);
}

.timber-fight__scroll-cue {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  color: rgba(248, 241, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timber-fight__scroll-cue i {
  display: block;
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--roots-violet), transparent);
  animation: timberScrollCue 1400ms ease-in-out infinite;
}

@keyframes timberScrollCue {
  0%, 100% { opacity: 0.35; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

.timber-fight__memory-photo {
  position: absolute;
  top: auto !important;
  right: auto;
  bottom: clamp(1.5rem, 7vh, 5rem);
  left: clamp(0.75rem, 3vw, 3.5rem) !important;
  margin: 0;
  width: min(35vw, 500px);
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.2rem;
  background: rgba(7, 2, 13, 0.42);
  box-shadow: 0 0 32px rgba(180, 90, 255, 0.28), 0 20px 70px rgba(0, 0, 0, 0.55);
  filter: blur(6px);
  mask-image: linear-gradient(135deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.timber-fight__memory-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: cover;
}

.timber-fight__memory-photo.is-missing {
  display: none;
}

.timber-fight__audio-toggle {
  position: absolute;
  bottom: clamp(2.5rem, 9vh, 6rem);
  left: clamp(1.25rem, 5vw, 5rem);
  z-index: 3;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(216, 180, 254, 0.34);
  border-radius: 6px;
  color: rgba(248, 241, 255, 0.9);
  background: rgba(8, 2, 16, 0.6);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.timber-fight.is-started .timber-fight__audio-toggle {
  opacity: 1;
  pointer-events: auto;
}

.timber-fight__audio-toggle:hover,
.timber-fight__audio-toggle:focus-visible {
  border-color: var(--roots-violet);
  box-shadow: 0 0 24px rgba(180, 92, 255, 0.24);
}

.timber-fight__audio-toggle.is-unavailable {
  opacity: 0.58;
  cursor: not-allowed;
}

.timber-fight__continue {
  position: absolute;
  right: clamp(1.25rem, 5vw, 5rem);
  bottom: clamp(4.4rem, 12vh, 8rem);
  z-index: 4;
  padding: 0.8rem 0;
  color: #f7eaff;
  border-bottom: 1px solid var(--roots-violet);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 360ms ease, transform 360ms ease, text-shadow 180ms ease;
}

.timber-fight__continue.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.timber-fight__continue:hover,
.timber-fight__continue:focus-visible {
  text-shadow: 0 0 18px rgba(180, 92, 255, 0.8);
}

.timber-fight__progress {
  position: absolute;
  right: clamp(1rem, 5vw, 6rem);
  bottom: clamp(2.5rem, 9vh, 6rem);
  z-index: 3;
  width: min(18rem, 36vw);
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.timber-fight__progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(232, 121, 249, 0.55), #f6ddff);
  transform: scaleX(0);
  transform-origin: left center;
}

.chapter-num {
  color: var(--roots-rust);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.muddy-font {
  max-width: 1100px;
  margin: 0.65rem 0 clamp(2rem, 5vw, 4rem);
  font-size: clamp(3rem, 9vw, 8.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(65, 38, 28, 0.64), 0 0 36px rgba(164, 67, 48, 0.16);
}

.chapter-layout {
  width: min(1240px, 100%);
}

.chapter-layout.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.chapter-layout.reversed .chapter-text {
  order: 2;
}

.chapter-text p,
.pulse-text,
.horizon-pitch {
  max-width: 820px;
  color: rgba(238, 232, 223, 0.78);
  font-size: clamp(1.05rem, 2.2vw, 1.6rem);
  line-height: 1.6;
}

.chapter-media {
  position: relative;
  min-height: 320px;
  background: linear-gradient(145deg, rgba(164, 67, 48, 0.16), rgba(180, 92, 255, 0.06));
  box-shadow: inset 0 0 70px #000, 0 28px 70px rgba(0, 0, 0, 0.58);
}

.chapter-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  filter: saturate(0.76) contrast(1.12);
}

.chapter-media img.is-missing {
  display: none;
}

.industrial-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(180, 92, 255, 0.08) 48% 49%, transparent 49%),
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(238, 232, 223, 0.035) 11px 12px);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.86);
  mix-blend-mode: screen;
}

.static-noise {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, 0.04) 7px 8px);
  pointer-events: none;
}

.mission-figure-wrapper {
  width: min(950px, 92vw);
  margin: 0 auto clamp(2rem, 5vw, 5rem);
}

.neon-glow-container {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(260px, 42vw, 560px);
  isolation: isolate;
}

.neon-glow-container::before {
  content: "";
  position: absolute;
  inset: 12% 5%;
  z-index: -1;
  background:
    radial-gradient(ellipse, rgba(180, 92, 255, 0.28), transparent 64%),
    radial-gradient(ellipse at 50% 80%, rgba(164, 67, 48, 0.18), transparent 58%);
  filter: blur(24px);
  transform: translateZ(0);
}

.mission-neon-text {
  width: min(100%, 1100px);
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.intense-neon-text {
  color: #f7eaff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.86),
    0 0 22px rgba(180, 92, 255, 0.9),
    0 0 54px rgba(180, 92, 255, 0.54),
    0 7px 0 rgba(65, 38, 28, 0.72);
  animation: rootsNeonPulse 3200ms ease-in-out infinite;
}

.mission-neon-art {
  display: block;
  width: 100%;
  filter: saturate(1.1) contrast(1.08) drop-shadow(0 0 42px rgba(180, 92, 255, 0.28));
}

.chapter-layout.centered {
  margin: 0 auto;
  text-align: center;
}

.chapter-layout.centered .pulse-text {
  margin-right: auto;
  margin-left: auto;
}

.target-merge {
  text-align: center;
}

.target-merge .muddy-font,
.target-merge .horizon-pitch {
  margin-right: auto;
  margin-left: auto;
}

.roots-confluence-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-top: 3rem;
}

.gate-link {
  position: relative;
  isolation: isolate;
  padding: 0.9rem 0;
  color: var(--roots-bone);
  border-bottom: 1px solid var(--roots-rust);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.gate-glow {
  position: absolute;
  inset: 20% -12%;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(ellipse, rgba(180, 92, 255, 0.42), transparent 68%);
  filter: blur(14px);
  transition: opacity 180ms ease;
}

.gate-link:hover .gate-glow,
.gate-link:focus-visible .gate-glow {
  opacity: 1;
}

.gate-link:focus-visible {
  outline: 1px solid rgba(238, 232, 223, 0.72);
  outline-offset: 7px;
}

.roots-finale {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 7vw, 7rem);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(3, 3, 3, 0.2), rgba(3, 3, 3, 0.72) 48%, rgba(3, 3, 3, 0.94)),
    url("assets/images/kot-art/roots-mythic-finale.jpg") center / cover no-repeat;
}

.roots-finale::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  z-index: -1;
  border: 1px solid rgba(216, 180, 254, 0.14);
  background: linear-gradient(180deg, rgba(3, 3, 3, 0.12), rgba(3, 3, 3, 0.58));
  backdrop-filter: blur(2px);
  box-shadow: 0 0 90px rgba(180, 92, 255, 0.08);
}

.roots-finale__inner {
  width: min(880px, 100%);
  text-align: center;
}

.roots-finale__eyebrow {
  color: var(--roots-violet);
  font-size: clamp(0.68rem, 1.3vw, 0.82rem);
  font-weight: 900;
  letter-spacing: 0.18em;
}

.roots-finale .muddy-font {
  max-width: none;
  margin: 1rem 0 1.6rem;
  color: #f8f1ff;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.88;
  text-shadow: 0 0 36px rgba(180, 92, 255, 0.22);
}

.roots-finale__story {
  width: min(700px, 100%);
  margin: 0 auto;
  color: rgba(248, 244, 251, 0.78);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.75;
}

.roots-finale__story p {
  margin: 0 0 1rem;
}

.roots-finale__store {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-top: 1.7rem;
  padding: 0.9rem 1.35rem;
  border: 1px solid rgba(232, 121, 249, 0.72);
  border-radius: 6px;
  color: #fff;
  background: rgba(168, 85, 247, 0.14);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.16);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.roots-finale__store:hover,
.roots-finale__store:focus-visible {
  border-color: #f6ddff;
  background: rgba(168, 85, 247, 0.28);
  box-shadow: 0 0 42px rgba(168, 85, 247, 0.32);
  outline: none;
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 700ms ease, transform 800ms ease;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes rootsNeonPulse {
  0%,
  100% {
    opacity: 0.86;
    transform: translateZ(0) scale(0.985);
  }

  50% {
    opacity: 1;
    transform: translateZ(0) scale(1);
  }
}

@media (max-width: 760px) {
  .timber-fight {
    min-height: 260svh;
  }

  .timber-fight__sticky {
    background-image: url("assets/images/starry_sky_and_heart_shaped_silhouette.png");
    background-position: 32% center;
  }

  .timber-fight__video-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.62) 72%, rgba(0, 0, 0, 0.88));
  }

  .timber-fight__intro {
    inset: 0;
    padding: 1.2rem;
  }

  .timber-fight__intro .muddy-font {
    margin: 0.4rem 0;
    font-size: clamp(2.4rem, 13vw, 4rem);
  }

  .timber-fight__subhead {
    max-width: 26rem;
    font-size: 0.95rem;
  }

  .timber-fight__intro-copy {
    max-width: 24rem;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
  }

  .timber-fight__intro-copy {
    font-size: clamp(0.68rem, 2.8vw, 0.82rem);
    line-height: 1.38;
  }

  .timber-fight__memory-photo {
    bottom: clamp(1rem, 5vh, 2.5rem);
    left: 0.65rem !important;
    width: min(46vw, 230px);
    max-width: 46vw;
    border-radius: 0.8rem;
  }

  .timber-fight__memory-photo img {
    max-height: 38vh;
  }

  .timber-fight__audio-toggle {
    bottom: 6vh;
    left: 1.1rem;
  }

  .timber-fight__progress {
    right: 1.1rem;
    bottom: 7.5vh;
    width: 34vw;
  }

  .timber-fight__continue {
    right: 1.1rem;
    bottom: 13vh;
  }

  .chapter-layout.split {
    grid-template-columns: 1fr;
  }

  .chapter-layout.reversed .chapter-text {
    order: initial;
  }

  .roots-finale::before {
    inset: 8% 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .intense-neon-text {
    animation: none;
  }

  .timber-fight__memory-photo {
    filter: none !important;
    transition: none;
  }

  .timber-fight__intro,
  .timber-fight__continue {
    transition: none;
  }

  .timber-fight__scroll-cue i {
    animation: none;
  }
}
