:root {
  /* compliance tokens: that glitches between `quest active` IBM Plex Mono** checksum fragments Inter** short explanatory lines Space Grotesk** `sustaining.quest` wordmark */
  --charcoal-kiln: #11100E;
  --burnt-ember: #C65A24;
  --scorched-orange-dark: #8F3519;
  --bone-ash: #E7D7C4;
  --smoked-glass: #A8A29A;
  --oxidized-teal: #2F7A72;
  --warning-black-red: #2A1410;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 20%, rgba(198, 90, 36, .24), transparent 42%),
    radial-gradient(circle at 18% 72%, rgba(47, 122, 114, .13), transparent 34%),
    linear-gradient(180deg, #11100E 0%, #2A1410 52%, #11100E 100%);
  color: var(--bone-ash);
  font-family: var(--body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(231, 215, 196, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 215, 196, .025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  opacity: .38;
  z-index: 0;
}

.ambient {
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  filter: blur(54px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}

.ambient-one {
  top: 8vh;
  right: -12vw;
  background: rgba(198, 90, 36, .36);
}

.ambient-two {
  bottom: -10vw;
  left: -12vw;
  background: rgba(47, 122, 114, .22);
}

.quest-stack {
  position: relative;
  z-index: 1;
}

.sequence-marker {
  position: fixed;
  left: clamp(16px, 3vw, 44px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(168, 162, 154, .45);
}

.sequence-marker span {
  cursor: pointer;
  transition: color .24s ease, transform .24s ease;
}

.sequence-marker span::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: rgba(168, 162, 154, .32);
  transition: width .24s ease, background .24s ease;
}

.sequence-marker span.active {
  color: var(--burnt-ember);
  transform: translateX(4px);
}

.sequence-marker span.active::before {
  width: 28px;
  background: var(--burnt-ember);
}

.chamber {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(74px, 15vw) minmax(230px, 32vw) minmax(300px, 1fr);
  align-items: center;
  padding: 10vh clamp(26px, 5vw, 82px) 10vh 0;
  isolation: isolate;
}

.intro {
  padding: 0 clamp(22px, 7vw, 96px);
  grid-template-columns: 1fr;
}

.intro-grid {
  width: min(980px, 88vw);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: start;
  position: relative;
}

.mono-label,
.card-kicker,
.counter,
.readout,
.checksum {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .13em;
}

.mono-label {
  margin: 0 0 18px;
  color: rgba(168, 162, 154, .62);
  font-size: 11px;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(54px, 11vw, 154px);
  line-height: .86;
  letter-spacing: -.075em;
  color: var(--bone-ash);
}

.wordmark span {
  color: var(--burnt-ember);
  text-shadow: 0 0 24px rgba(198, 90, 36, .48);
}

.dot-drop {
  position: absolute;
  left: min(44vw, 510px);
  top: calc(50% + 56px);
  width: 1px;
  height: 42vh;
  background: linear-gradient(var(--burnt-ember), rgba(198, 90, 36, 0));
}

.dot-drop span {
  position: absolute;
  top: 38%;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--oxidized-teal);
  box-shadow: 0 0 22px rgba(47, 122, 114, .8);
  animation: nodeDrift 3.8s ease-in-out infinite;
}

.readout {
  margin-top: 34px;
  color: var(--burnt-ember);
  font-size: 12px;
  min-height: 1.2em;
}

.state {
  border-top: 1px solid rgba(143, 53, 25, .32);
}

.state::before {
  content: "";
  position: absolute;
  inset: 7vh 7vw;
  border: 1px solid rgba(168, 162, 154, .06);
  background: linear-gradient(115deg, rgba(168, 162, 154, .025), transparent 55%);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 94% 100%, 0 100%);
  z-index: -1;
}

.compressed {
  min-height: 76vh;
}

.state-copy {
  grid-column: 2;
  align-self: start;
  top: 16vh;
  padding-top: 7vh;
}

.sticky-verb {
  position: sticky;
}

.counter {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--burnt-ember);
  font-size: 12px;
}

.verb {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(72px, 12vw, 178px);
  line-height: .78;
  letter-spacing: -.08em;
  color: var(--bone-ash);
}

.state-copy p {
  max-width: 330px;
  margin: 28px 0 0;
  color: rgba(231, 215, 196, .72);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
}

.spine {
  position: absolute;
  left: calc(15vw + 2px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(198, 90, 36, .72) 16%, rgba(168, 162, 154, .26) 70%, transparent);
}

.spine i,
.spine b {
  position: absolute;
  left: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--burnt-ember);
  box-shadow: 0 0 18px rgba(198, 90, 36, .65);
}

.spine i { top: 18%; }
.spine b { bottom: 21%; background: var(--oxidized-teal); box-shadow: 0 0 18px rgba(47, 122, 114, .55); }
.spine.broken { background: linear-gradient(transparent 0 18%, rgba(198, 90, 36, .7) 18% 39%, transparent 39% 47%, rgba(168, 162, 154, .26) 47% 82%, transparent); }
.final-line { background: linear-gradient(transparent, rgba(198, 90, 36, .8), rgba(198, 90, 36, .16)); }

.artifact-cluster {
  grid-column: 3;
  display: grid;
  gap: 18px;
  width: min(560px, 100%);
  transform: translateY(16px);
  opacity: .42;
  transition: opacity .7s ease, transform .7s ease, filter .7s ease;
  filter: blur(7px);
}

.state.in-view .artifact-cluster {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.align-right { justify-self: end; }
.align-left { justify-self: start; }
.staggered .pane-small { margin-left: 86px; }

.glass-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 38px);
  color: var(--bone-ash);
  background:
    linear-gradient(135deg, rgba(168, 162, 154, .16), rgba(42, 20, 16, .42)),
    radial-gradient(circle at 82% 12%, rgba(198, 90, 36, .16), transparent 40%);
  border: 1px solid rgba(198, 90, 36, .42);
  box-shadow: inset 0 1px 0 rgba(231, 215, 196, .11), 0 28px 80px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(231, 215, 196, .055);
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 20px;
  width: 86px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(231, 215, 196, .5) 0 6px, transparent 6px 12px);
}

.pane-large { min-height: 260px; }
.pane-small { min-height: 150px; max-width: 360px; }

.card-kicker {
  display: block;
  margin-bottom: 34px;
  font-size: 11px;
  color: rgba(168, 162, 154, .75);
}

.glass-card h3 {
  max-width: 390px;
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -.045em;
}

.glass-card p {
  margin: 0;
  color: rgba(231, 215, 196, .68);
  line-height: 1.55;
}

.pulse-line,
.loop-diagram {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 32px;
  height: 22px;
  border-bottom: 1px solid rgba(168, 162, 154, .26);
}

.pulse-line span {
  position: absolute;
  left: 0;
  top: 12px;
  width: 28%;
  height: 2px;
  background: var(--burnt-ember);
  animation: pulseTravel 2.6s linear infinite;
}

.checksum {
  position: absolute;
  bottom: 26px;
  left: 34px;
  color: var(--oxidized-teal);
  font-size: 11px;
}

.teal-node { border-color: rgba(47, 122, 114, .65); }
.damaged { transform: skewY(-.6deg); }
.strip-card { background: linear-gradient(90deg, rgba(42, 20, 16, .78), rgba(168, 162, 154, .1)); }
.quiet p { color: var(--burnt-ember); font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; }

.shutter {
  position: absolute;
  inset: auto 0 0;
  height: 38px;
  background: repeating-linear-gradient(90deg, rgba(143, 53, 25, .48) 0 22px, transparent 22px 38px);
  opacity: .55;
}

.loop-diagram span {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--burnt-ember);
  border-radius: 50%;
  top: 10px;
}

.loop-diagram span:nth-child(1) { left: 8%; }
.loop-diagram span:nth-child(2) { left: 47%; border-color: var(--oxidized-teal); }
.loop-diagram span:nth-child(3) { right: 8%; }

.return-loop {
  position: absolute;
  right: 28px;
  bottom: 26px;
  color: var(--burnt-ember);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(198, 90, 36, .5);
}

.apparatus {
  position: absolute;
  pointer-events: none;
  opacity: .58;
}

.ring-one,
.ring-two,
.gasket {
  right: clamp(18px, 5vw, 80px);
  top: 14vh;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(168, 162, 154, .2);
  border-radius: 50%;
}

.ring-one span,
.ring-two span,
.gasket span {
  position: absolute;
  border: 1px solid rgba(198, 90, 36, .4);
  border-radius: 50%;
  inset: 18px;
}

.ring-one span:nth-child(2),
.ring-two span:nth-child(2) { inset: 52px; border-color: rgba(47, 122, 114, .45); }
.ring-one span:nth-child(3),
.ring-two span:nth-child(3) { inset: auto; left: 28px; top: -5px; width: 10px; height: 10px; background: var(--burnt-ember); }
.ring-two { top: auto; bottom: 12vh; }

.clamp {
  right: 9vw;
  bottom: 12vh;
  width: 160px;
  height: 82px;
  border-top: 1px solid rgba(198, 90, 36, .5);
  border-bottom: 1px solid rgba(198, 90, 36, .2);
}

.clamp span {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(168, 162, 154, .32);
}

.clamp span:nth-child(1) { left: 0; top: -9px; }
.clamp span:nth-child(2) { right: 0; top: -9px; }
.clamp span:nth-child(3) { left: 33%; bottom: -9px; }
.clamp span:nth-child(4) { right: 22%; bottom: -9px; }

.gasket {
  left: 6vw;
  top: auto;
  bottom: 15vh;
  border-style: dashed;
}

.screws {
  right: 13vw;
  top: 17vh;
  width: 120px;
  height: 180px;
}

.screws span {
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(231, 215, 196, .32);
  background: radial-gradient(circle, rgba(198, 90, 36, .38), transparent 62%);
}

.screws span:nth-child(1) { left: 0; top: 0; }
.screws span:nth-child(2) { right: 22px; top: 80px; }
.screws span:nth-child(3) { left: 44px; bottom: 0; }

.glitch-title,
.corrupt {
  position: relative;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch-title::before {
  color: var(--burnt-ember);
  clip-path: inset(12% 0 72% 0);
  transform: translateX(3px);
}

.glitch-title::after {
  color: var(--oxidized-teal);
  clip-path: inset(68% 0 14% 0);
  transform: translateX(-3px);
}

.glitching::before,
.glitching::after,
.state.in-view .verb::before,
.state.in-view .verb::after {
  animation: sliceBlink .42s steps(2, end) 1;
}

.jolt {
  transform: translate(3px, -1px) skewX(-1deg);
}

@keyframes sliceBlink {
  0%, 100% { opacity: 0; }
  18%, 38%, 62% { opacity: .72; }
  24%, 55% { opacity: .18; }
}

@keyframes nodeDrift {
  0%, 100% { transform: translateY(-8px); }
  50% { transform: translateY(32px); }
}

@keyframes pulseTravel {
  0% { transform: translateX(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(260%); opacity: 0; }
}

@media (max-width: 900px) {
  .sequence-marker { display: none; }
  .chamber {
    grid-template-columns: 30px 1fr;
    gap: 20px;
    padding: 8vh 22px;
  }
  .state-copy,
  .artifact-cluster {
    grid-column: 2;
  }
  .state-copy {
    position: relative;
    top: auto;
    padding-top: 0;
  }
  .artifact-cluster {
    margin-top: 34px;
  }
  .spine { left: 28px; }
  .apparatus { opacity: .28; }
  .wordmark { font-size: clamp(46px, 14vw, 80px); }
  .dot-drop { left: 58%; }
}

@media (max-width: 560px) {
  .intro { padding: 0 20px; }
  .pane-small { max-width: none; }
  .staggered .pane-small { margin-left: 0; }
  .glass-card { clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
}
