:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: rgba(13, 18, 24, 0.78);
  --panel-strong: rgba(18, 26, 34, 0.94);
  --ink: #f7fbf2;
  --muted: #a6b7ad;
  --line: rgba(184, 255, 208, 0.2);
  --green: #6dff96;
  --acid: #d8ff65;
  --violet: #a879ff;
  --cyan: #65d8ff;
  --ember: #ffb24f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-theme="arcane"] {
  --green: #9f8cff;
  --acid: #72e7ff;
  --violet: #ff8bd7;
  --cyan: #a879ff;
  --ember: #f8d66d;
}

body[data-theme="junkyard"] {
  --green: #ffb24f;
  --acid: #6dff96;
  --violet: #65d8ff;
  --cyan: #d8ff65;
  --ember: #ff6d6d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(109, 255, 150, 0.1), transparent 30%),
    linear-gradient(245deg, rgba(168, 121, 255, 0.16), transparent 34%),
    #06070a;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 8px
  );
  opacity: 0.25;
}

.ring {
  position: absolute;
  border: 1px solid rgba(109, 255, 150, 0.24);
  border-radius: 50%;
  animation: drift 12s ease-in-out infinite alternate;
}

.ring-one {
  width: 58vw;
  height: 58vw;
  right: -18vw;
  top: -10vw;
}

.ring-two {
  width: 34vw;
  height: 34vw;
  left: -8vw;
  bottom: -12vw;
  border-color: rgba(101, 216, 255, 0.22);
  animation-duration: 15s;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
  gap: clamp(28px, 6vw, 78px);
  align-items: center;
  min-height: 92vh;
  padding: 64px 0 38px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(4rem, 11vw, 10rem);
  line-height: 0.82;
  letter-spacing: 0;
}

.lede {
  max-width: 700px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  line-height: 1.6;
}

.actions,
.generator-actions,
.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.theme-switcher {
  margin-top: 16px;
}

.button,
.theme-button {
  min-width: 126px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: rgba(11, 16, 22, 0.8);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.button:hover,
.mode:hover,
.theme-button:hover,
.sound-button:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 255, 150, 0.7);
}

.button.primary,
.theme-button.is-active {
  color: #031008;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--acid));
}

.avatar-panel {
  position: relative;
}

.avatar-panel::before {
  position: absolute;
  inset: -18px;
  z-index: -1;
  content: "";
  border: 1px solid rgba(168, 121, 255, 0.38);
  border-radius: 18px;
  transform: rotate(-2deg);
}

.avatar-shell {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(168, 121, 255, 0.22), rgba(109, 255, 150, 0.09)),
    rgba(8, 12, 17, 0.9);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.48);
}

.avatar-shell img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}

.telemetry {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.telemetry span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(7, 11, 15, 0.76);
}

.generator-band,
.meme-band,
.toy-band {
  padding: 86px 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(101, 216, 255, 0.07), transparent 42%),
    rgba(255, 255, 255, 0.018);
}

.toy-band,
.quest-band {
  background:
    linear-gradient(110deg, rgba(168, 121, 255, 0.12), transparent 44%),
    rgba(255, 255, 255, 0.012);
}

.meme-band {
  background:
    linear-gradient(100deg, rgba(109, 255, 150, 0.08), transparent 44%),
    linear-gradient(250deg, rgba(168, 121, 255, 0.09), transparent 44%),
    rgba(255, 255, 255, 0.012);
}

.quest-band {
  padding: 86px 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 178, 79, 0.09), transparent 42%),
    rgba(255, 255, 255, 0.016);
}

.generator-layout,
.meme-layout,
.toy-layout,
.quest-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}

.generator-layout h2,
.meme-layout h2,
.toy-layout h2,
.quest-layout h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.section-copy {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.generator-card,
.meme-preview,
.rage-console,
.quest-board,
.soundboard,
.bits article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.generator-card {
  padding: clamp(18px, 4vw, 28px);
}

.meme-preview {
  padding: clamp(12px, 3vw, 20px);
}

.meme-preview canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #070b0f;
}

.quest-board,
.soundboard {
  padding: clamp(18px, 4vw, 30px);
}

.rage-console {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 30px);
}

.rage-console::before {
  position: absolute;
  inset: -30%;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle, rgba(109, 255, 150, calc(0.04 + var(--rage-alpha, 0.14))) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 178, 79, calc(0.03 + var(--rage-alpha, 0.12))) 0%, transparent 34%);
  filter: blur(10px);
  opacity: 0.9;
  transform: rotate(10deg);
}

.rage-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--acid);
  font-weight: 900;
  text-transform: uppercase;
}

.rage-label strong {
  color: var(--ink);
  font-size: 1.35rem;
}

#rageRange {
  width: 100%;
  margin: 22px 0 10px;
  accent-color: var(--green);
}

.rage-diagnosis {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.oracle {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.oracle label {
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.oracle-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.oracle-input input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(5, 8, 11, 0.82);
  outline: none;
}

.oracle-input input:focus {
  border-color: rgba(109, 255, 150, 0.72);
}

.oracle-answer {
  min-height: 148px;
  padding: 18px;
  border: 1px solid rgba(168, 121, 255, 0.28);
  border-radius: 12px;
  background: rgba(5, 8, 11, 0.6);
}

.oracle-answer span {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.oracle-answer p {
  margin: 14px 0 0;
  font-size: clamp(1.25rem, 2.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.08;
}

.quest-card {
  display: grid;
  gap: 14px;
  min-height: 230px;
  padding: clamp(20px, 4vw, 32px);
  margin: 24px 0 18px;
  border: 1px solid rgba(255, 178, 79, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 178, 79, 0.12), transparent),
    var(--panel-strong);
}

.quest-card span,
.quest-card strong {
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quest-card p {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 3rem);
  font-weight: 900;
  line-height: 1.04;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sound-button {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  background: rgba(5, 8, 11, 0.76);
  transition:
    transform 150ms ease,
    border-color 150ms ease;
}

.sound-output {
  min-height: 108px;
  margin: 16px 0 0;
  padding: 18px;
  border: 1px solid rgba(101, 216, 255, 0.25);
  border-radius: 12px;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.1;
  background: rgba(5, 8, 11, 0.6);
}

.sound-output.is-yelling {
  color: var(--ink);
  animation: glitch 420ms steps(2, end);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.mode {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  background: transparent;
}

.mode.is-active {
  color: #031008;
  background: var(--green);
}

.quote-output {
  display: grid;
  align-items: center;
  min-height: 230px;
  margin-top: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(101, 216, 255, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(101, 216, 255, 0.12), transparent),
    var(--panel-strong);
}

.quote-output p {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 3.15rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.generator-actions {
  margin-top: 16px;
}

.bits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 76px 0 92px;
}

.bits article {
  min-height: 230px;
  padding: 24px;
}

.bits span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--acid);
  font-weight: 900;
}

.bits h2 {
  margin: 34px 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.bits p {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(-18px, 18px, 0) scale(1.04);
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px) skewX(-3deg);
  }

  50% {
    transform: translateX(4px) skewX(3deg);
  }

  75% {
    transform: translateX(-2px);
  }
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 24px, 640px);
  }

  .hero-grid,
  .generator-layout,
  .meme-layout,
  .toy-layout,
  .quest-layout,
  .bits {
    grid-template-columns: 1fr;
  }

  .hero,
  .hero-grid {
    min-height: auto;
  }

  .hero-grid {
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(3.35rem, 18vw, 6.3rem);
  }

  .avatar-panel {
    order: -1;
  }

  .generator-band,
  .meme-band,
  .toy-band,
  .quest-band {
    padding: 58px 0;
  }

  .segmented,
  .oracle-input,
  .sound-grid {
    grid-template-columns: 1fr;
  }

  .bits {
    padding: 52px 0 68px;
  }
}
