:root {
  --black: #030403;
  --ink: #0a0d09;
  --white: #f2f4dc;
  --dim: #a8ae98;
  --green: #99ff8b;
  --green-hot: #55ff55;
  --purple: #9a6abb;
  --yellow: #fff3ad;
  --header-h: 74px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", monospace, sans-serif;
  color: var(--white);
  background: var(--black);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--black);
  letter-spacing: 0;
}

body.red-mode {
  --green: #6d7d63;
  --green-hot: #a45a5f;
}

body.flash {
  animation: screenShake 190ms steps(2) 1;
}

a {
  color: inherit;
  text-decoration: none;
}

#moth-field,
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#moth-field {
  z-index: 18;
}

.crt {
  z-index: 70;
  opacity: .31;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 52% 10%, rgba(147,255,139,.12), transparent 26%),
    linear-gradient(90deg, rgba(128,255,143,.035), rgba(140,74,180,.055), rgba(255,239,160,.035));
}

.crt::after {
  content: "";
  position: absolute;
  inset: -50%;
  opacity: .18;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.26) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(111,255,111,.16) 0 1px, transparent 1.8px);
  background-size: 7px 7px, 13px 13px;
  animation: staticMove 1.8s steps(4) infinite;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img,
footer img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid rgba(242,244,220,.35);
}

.brand strong,
footer strong {
  display: block;
  font-size: 20px;
  line-height: .9;
}

.brand small,
footer small,
.label,
.status,
.micro,
.signal-meter,
.counter,
.last-line {
  font-family: "Courier New", Courier, monospace;
}

.brand small,
footer small {
  color: var(--green);
}

.site-header nav,
.header-actions,
.cta-row,
footer nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header nav {
  justify-content: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  color: rgba(242,244,220,.78);
}

.site-header nav a {
  white-space: nowrap;
}

.site-header nav a:hover {
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
}

.header-actions {
  justify-content: flex-end;
}

.btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 11px 16px;
  border: 1px solid rgba(242,244,220,.74);
  border-radius: 0;
  background: rgba(0,0,0,.68);
  color: var(--white);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover,
.btn:focus-visible {
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(153,255,139,.42), inset 0 0 12px rgba(153,255,139,.12);
  transform: scale(1.035) translateY(-1px);
  animation: jitter 280ms steps(2) infinite;
  outline: none;
}

.btn-green {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 18px rgba(153,255,139,.22);
}

.hanging-bulb {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 55;
  width: 130px;
  height: 190px;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 0 28px rgba(255,243,173,.62));
}

.cord {
  position: absolute;
  top: 0;
  left: calc(50% - 1px);
  width: 2px;
  height: 79px;
  background: linear-gradient(#252229, #777066);
}

.bulb-glow {
  position: absolute;
  top: 64px;
  left: 50%;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,248,190,.82) 0 11%, rgba(153,255,139,.18) 28%, rgba(154,106,187,.14) 48%, transparent 70%);
  animation: bulbPulse 5.6s infinite;
}

.bulb {
  position: absolute;
  top: 68px;
  left: 50%;
  width: 52px;
  height: 74px;
  transform: translateX(-50%);
}

.cap {
  display: block;
  width: 34px;
  height: 20px;
  margin: 0 auto -1px;
  background: repeating-linear-gradient(0deg, #343036 0 3px, #5a5358 3px 6px);
  border: 2px solid #111;
}

.glass {
  display: block;
  width: 48px;
  height: 54px;
  margin: 0 auto;
  border: 2px solid #493d24;
  border-radius: 45% 45% 52% 52%;
  background: radial-gradient(circle at 50% 38%, #fffbd6 0 18%, #fff0a6 28%, #d5b866 58%, rgba(255,255,255,.08) 59%);
  box-shadow: inset 0 0 12px #fff7be, 0 0 24px #fff0a6;
  animation: glassFlicker 4.8s steps(5) infinite;
}

.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 70px) clamp(20px, 7vw, 112px) 90px;
  isolation: isolate;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.section + .section {
  border-top: 3px solid rgba(153, 255, 139, .78);
  box-shadow: inset 0 15px 30px rgba(85, 255, 85, .13), 0 -1px 18px rgba(153, 255, 139, .38);
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 20%, rgba(153,255,139,.12), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,.05), rgba(0,0,0,.54));
}

.section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, transparent 0 44%, rgba(0,0,0,.76) 100%);
}

.bg-light {
  background-image: url("assets/light.png");
  background-position: center center;
}

.bg-instinct {
  background-image: url("assets/instinct.png");
  background-position: center center;
}

.bg-candle {
  background-image: url("assets/greencandle.png");
  background-position: center center;
}

.bg-cult {
  background-image: url("assets/cult.png");
  background-position: center top;
}

.bg-swarm {
  background-image: url("assets/swarm.png");
  background-position: center center;
}

.bg-banner {
  background-image: url("assets/BANNERS.png");
  background-position: center center;
}

.content {
  width: min(620px, 100%);
  position: relative;
  z-index: 2;
  text-shadow: 0 0 16px rgba(0,0,0,.95);
}

.hero-copy {
  margin-left: max(0px, 5vw);
}

.narrow {
  width: min(500px, 100%);
}

.right {
  margin-left: auto;
  width: min(570px, 100%);
}

.center {
  margin-inline: auto;
  text-align: center;
}

.label,
.micro,
.status {
  margin: 0 0 17px;
  color: var(--green);
  font-size: 12px;
  text-transform: lowercase;
  text-shadow: 0 0 14px rgba(153,255,139,.62);
}

.label {
  text-transform: uppercase;
  color: var(--white);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(82px, 17vw, 220px);
  line-height: .78;
  color: var(--white);
  text-shadow: 0 0 28px rgba(255,243,173,.45), 3px 0 rgba(153,255,139,.26), -3px 0 rgba(154,106,187,.22);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(42px, 7.5vw, 116px);
  line-height: .84;
}

h3 {
  margin-bottom: 18px;
  color: var(--green);
  font-size: clamp(36px, 6.5vw, 96px);
  line-height: .86;
  text-shadow: 0 0 28px rgba(153,255,139,.54);
}

p {
  color: rgba(242,244,220,.86);
  font: 16px/1.55 "Courier New", Courier, monospace;
}

.whisper {
  color: var(--white);
  font-weight: 700;
}

.cta-row {
  flex-wrap: wrap;
  justify-content: center;
  margin: 26px 0 15px;
}

.ritual-lines {
  display: grid;
  gap: 18px;
  margin: 30px 0;
}

.ritual-lines p,
.rules li {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
}

.ritual-lines b {
  display: block;
  color: var(--white);
  font-size: 13px;
}

.ritual-lines span {
  color: var(--green);
}

.toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(242,244,220,.52);
  background: rgba(0,0,0,.68);
}

.mode-btn {
  min-width: 78px;
  min-height: 38px;
  border: 0;
  border-right: 1px solid rgba(242,244,220,.32);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font: 700 12px/1 "Courier New", Courier, monospace;
  cursor: pointer;
}

.mode-btn:last-child {
  border-right: 0;
}

.mode-btn.active {
  color: var(--black);
  background: var(--green);
  box-shadow: 0 0 18px rgba(153,255,139,.55);
}

.candle-trigger {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: crosshair;
}

.signal-meter {
  width: min(430px, 100%);
  display: grid;
  gap: 9px;
  margin: 30px 0 0;
  padding-left: 13px;
  border-left: 1px solid rgba(153,255,139,.56);
  color: rgba(242,244,220,.82);
  font-size: 12px;
}

.signal-meter i {
  display: block;
  width: 100%;
  height: 18px;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, transparent 12px 15px);
  box-shadow: 0 0 18px rgba(153,255,139,.54);
}

.signal-meter strong {
  color: var(--green);
  font: 700 clamp(32px, 5vw, 64px)/.9 Impact, "Arial Narrow Bold", sans-serif;
}

.rules {
  display: grid;
  gap: 10px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.rules li {
  color: var(--white);
}

.rules span {
  display: inline-block;
  width: 42px;
  color: var(--green);
}

.cult-message {
  min-height: 24px;
  color: var(--green);
  font-weight: 700;
}

.counter {
  display: grid;
  gap: 10px;
  margin: 34px auto 12px;
  color: rgba(242,244,220,.78);
}

.counter strong {
  color: var(--green);
  font: 700 clamp(58px, 12vw, 150px)/.82 Impact, "Arial Narrow Bold", sans-serif;
  text-shadow: 0 0 32px rgba(153,255,139,.66);
}

footer {
  min-height: 260px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 56px clamp(20px, 6vw, 86px);
  background: #000;
  border-top: 1px solid rgba(153,255,139,.18);
}

footer p {
  margin: 0;
}

footer nav a {
  font: 700 12px/1 "Courier New", Courier, monospace;
  color: var(--dim);
}

footer nav a:hover {
  color: var(--green);
}

.last-line {
  grid-column: 1 / -1;
  color: rgba(242,244,220,.46);
}

@keyframes staticMove {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-.5%, -.5%); }
  100% { transform: translate(0, 0); }
}

@keyframes bulbPulse {
  0%, 78%, 100% { opacity: .92; transform: translateX(-50%) scale(1); }
  80% { opacity: .64; transform: translateX(-50%) scale(.95); }
  83% { opacity: 1; transform: translateX(-50%) scale(1.15); background: radial-gradient(circle, rgba(255,248,190,.9) 0 11%, rgba(85,255,85,.45) 29%, rgba(154,106,187,.2) 52%, transparent 72%); }
}

@keyframes glassFlicker {
  0%, 12%, 18%, 100% { filter: brightness(1); }
  13% { filter: brightness(.76); }
  17% { filter: brightness(1.25); }
}

@keyframes jitter {
  0%, 100% { translate: 0 0; }
  33% { translate: 1px -1px; }
  66% { translate: -1px 1px; }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@keyframes driftText {
  from { transform: translateX(-20%); }
  to { transform: translateX(20%); }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(3px, -2px); }
  50% { transform: translate(-2px, 2px); }
  75% { transform: translate(2px, 2px); }
}

@media (max-width: 920px) {
  .site-header {
    height: auto;
    min-height: var(--header-h);
    grid-template-columns: 1fr auto;
  }

  .site-header nav {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding-inline: 10px;
    font-size: 11px;
  }

  .section {
    min-height: 86vh;
    padding: 150px 22px 74px;
  }

  .right,
  .hero-copy {
    margin-left: 0;
  }

  .bg-instinct {
    background-position: 58% center;
  }

  .bg-candle {
    background-position: 43% center;
  }

  .bg-cult {
    background-position: 50% top;
  }
}

@media (max-width: 560px) {
  :root {
    --header-h: 68px;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 9px 12px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 18px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn,
  .cta-row .btn {
    flex: 1 1 140px;
    min-width: 0;
  }

  .hanging-bulb {
    transform: translateX(-50%) scale(.76);
    transform-origin: top center;
  }

  .section {
    min-height: 90vh;
    padding-top: 142px;
  }

  h1 {
    font-size: clamp(74px, 24vw, 116px);
  }

  h2 {
    font-size: clamp(42px, 15vw, 74px);
  }

  h3 {
    font-size: clamp(36px, 13vw, 62px);
  }

  p {
    font-size: 14px;
  }

  footer {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  footer p,
  footer nav,
  .last-line {
    grid-column: 1 / -1;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  #moth-field {
    display: none;
  }
}
