:root {
  color-scheme: dark;
  --bg: #10110d;
  --panel: #171b16;
  --panel-strong: #202719;
  --text: #f7f1df;
  --muted: #b7b69d;
  --line: #35402f;
  --accent: #39d184;
  --acid: #d7e86f;
  --gold: #f0b24b;
  --rust: #b85636;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(57, 209, 132, 0.14), transparent 34%),
    linear-gradient(20deg, rgba(184, 86, 54, 0.2), transparent 38%),
    radial-gradient(circle at 78% 8%, rgba(240, 178, 75, 0.22), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before,
body::after {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(ellipse at 12% 20%, rgba(235, 242, 198, 0.14), transparent 28%),
    radial-gradient(ellipse at 34% 70%, rgba(57, 209, 132, 0.10), transparent 24%),
    radial-gradient(ellipse at 80% 26%, rgba(240, 178, 75, 0.10), transparent 30%),
    radial-gradient(ellipse at 58% 8%, rgba(255, 255, 255, 0.08), transparent 18%);
  filter: blur(34px);
  opacity: 0.8;
  animation: smoke-drift 24s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(90deg, transparent, rgba(215, 232, 111, 0.06), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.34;
  animation: lab-static 5s steps(8) infinite;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 30px;
  align-items: center;
  padding: 52px 0 34px;
}

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

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 1;
}

h1 span {
  display: inline-grid;
  min-width: 1.02em;
  min-height: 1.02em;
  place-items: center;
  border: 2px solid rgba(57, 209, 132, 0.72);
  background: linear-gradient(145deg, rgba(57, 209, 132, 0.2), rgba(215, 232, 111, 0.08));
  color: var(--acid);
  font-size: 0.86em;
  line-height: 1;
  vertical-align: 0.04em;
}

.lede {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.15rem;
}

.lab-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  transform: rotate(-2deg);
}

.tile {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(215, 232, 111, 0.45);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(57, 209, 132, 0.28), rgba(15, 26, 14, 0.92));
  box-shadow: inset 0 0 28px rgba(57, 209, 132, 0.18), 0 22px 50px rgba(0, 0, 0, 0.24);
  color: #eef7b2;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 950;
  animation: tile-flicker 4.8s ease-in-out infinite;
}

.tile-ba,
.tile-f {
  border-color: rgba(240, 178, 75, 0.52);
  background: linear-gradient(145deg, rgba(240, 178, 75, 0.24), rgba(35, 23, 14, 0.92));
  color: #ffe0a3;
}

.section {
  margin-top: 34px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.65rem;
}

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

.story-grid,
.crew-grid {
  display: grid;
  gap: 14px;
}

.story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-grid p {
  margin: 0;
  border-left: 4px solid var(--accent);
  background: rgba(23, 27, 22, 0.74);
  color: var(--muted);
  line-height: 1.7;
  padding: 14px 18px;
}

.crew-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.challenge-card,
.crew-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 22, 0.94);
}

.crew-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  min-height: 230px;
  padding: 16px;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(57, 209, 132, 0.58);
  border-radius: 8px;
  background: #182719;
  color: var(--acid);
  font-weight: 950;
}

.crew-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.crew-card p {
  color: var(--muted);
  line-height: 1.55;
}

.crew-card strong,
.alias,
.handler,
.hint strong {
  color: var(--gold);
}

.alias {
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.challenge-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  padding: 22px;
  transform: translateY(0);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: card-rise 620ms ease both;
  animation-delay: calc(var(--card-index, 0) * 70ms);
}

.challenge-card:nth-child(1) { --card-index: 1; }
.challenge-card:nth-child(2) { --card-index: 2; }
.challenge-card:nth-child(3) { --card-index: 3; }
.challenge-card:nth-child(4) { --card-index: 4; }
.challenge-card:nth-child(5) { --card-index: 5; }
.challenge-card:nth-child(6) { --card-index: 6; }
.challenge-card:nth-child(7) { --card-index: 7; }
.challenge-card:nth-child(8) { --card-index: 8; }
.challenge-card:nth-child(9) { --card-index: 9; }
.challenge-card:nth-child(10) { --card-index: 10; }
.challenge-card:nth-child(11) { --card-index: 11; }

.challenge-card:hover {
  border-color: rgba(57, 209, 132, 0.62);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32), 0 0 34px rgba(57, 209, 132, 0.12);
  transform: translateY(-4px);
}

.card-top,
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-top span,
.meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-top strong {
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.challenge-card h3 {
  margin: 28px 0 12px;
  font-size: 2rem;
}

.challenge-card p {
  color: var(--muted);
  line-height: 1.6;
}

.challenge-card .handler {
  margin-bottom: 14px;
  color: var(--gold);
  font-weight: 800;
}

.hint {
  border-left: 3px solid rgba(240, 178, 75, 0.7);
  background: rgba(240, 178, 75, 0.07);
  padding: 10px 12px;
}

.meta {
  margin-top: auto;
  overflow-wrap: anywhere;
}

.launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  border-radius: 6px;
  background: var(--accent);
  color: #07120c;
  font-weight: 900;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.launch:hover {
  box-shadow: 0 0 26px rgba(57, 209, 132, 0.28);
  transform: translateY(-1px);
}

.launch-disabled,
.launch-disabled:hover {
  border: 1px solid var(--line);
  background: rgba(183, 182, 157, 0.12);
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

@keyframes smoke-drift {
  0% {
    transform: translate3d(-3%, 2%, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate3d(4%, -3%, 0) rotate(7deg) scale(1.08);
  }
}

@keyframes lab-static {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.26;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.38;
  }
}

@keyframes tile-flicker {
  0%, 100% {
    filter: brightness(1);
  }
  48% {
    filter: brightness(1.22);
  }
  52% {
    filter: brightness(0.86);
  }
  56% {
    filter: brightness(1.12);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 30px 0;
  }

  .challenge-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .story-grid,
  .crew-grid {
    grid-template-columns: 1fr;
  }

  .lab-card {
    max-width: 230px;
  }

  .card-top,
  .meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Breaking Bad visual pass */
body {
  overflow-x: hidden;
  font-family: Arial, "Helvetica Neue", Helvetica, ui-sans-serif, system-ui, sans-serif;
}

h1,
h2,
h3,
button,
.launch,
.topbar a,
.eyebrow,
.section-label {
  font-family: Arial, "Helvetica Neue", Helvetica, ui-sans-serif, system-ui, sans-serif;
}

h1 {
  color: #fff6df;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 0 28px rgba(215, 232, 111, 0.12);
}

h1 span {
  border: 2px solid rgba(57, 209, 132, 0.88);
  background: rgba(57, 209, 132, 0.16);
  color: #dff66d;
  box-shadow: inset 0 0 20px rgba(57, 209, 132, 0.18), 0 0 22px rgba(57, 209, 132, 0.08);
}

.hero {
  position: relative;
  isolation: isolate;
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  content: "";
}

.hero::before {
  width: min(760px, 90vw);
  height: 280px;
  left: -80px;
  top: -70px;
  background:
    radial-gradient(ellipse at 20% 58%, rgba(246, 242, 216, 0.34), transparent 38%),
    radial-gradient(ellipse at 46% 35%, rgba(215, 232, 111, 0.20), transparent 34%),
    radial-gradient(ellipse at 76% 62%, rgba(57, 209, 132, 0.18), transparent 42%);
  filter: blur(26px);
  opacity: 0.92;
  animation: hero-smoke-roll 11s ease-in-out infinite alternate;
}

.hero::after {
  width: min(520px, 70vw);
  height: 180px;
  right: 4%;
  bottom: -34px;
  background:
    radial-gradient(ellipse at 22% 50%, rgba(255, 255, 255, 0.18), transparent 42%),
    radial-gradient(ellipse at 68% 42%, rgba(240, 178, 75, 0.15), transparent 46%);
  filter: blur(22px);
  opacity: 0.72;
  animation: hero-smoke-roll 14s ease-in-out infinite alternate-reverse;
}

body::before {
  inset: -15%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 8% 18%, rgba(246, 242, 216, 0.22), transparent 30%),
    radial-gradient(ellipse at 28% 76%, rgba(57, 209, 132, 0.18), transparent 28%),
    radial-gradient(ellipse at 78% 14%, rgba(240, 178, 75, 0.18), transparent 30%),
    radial-gradient(ellipse at 92% 70%, rgba(246, 242, 216, 0.14), transparent 24%);
  filter: blur(22px);
  opacity: 0.86;
  animation: smoke-drift-strong 18s ease-in-out infinite alternate;
}

body::after {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(105deg, transparent 20%, rgba(215, 232, 111, 0.08), transparent 54%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: lab-static-strong 6s steps(10) infinite;
}

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

@keyframes hero-smoke-roll {
  0% { transform: translate3d(-18px, 8px, 0) rotate(-2deg) scale(0.98); }
  50% { transform: translate3d(20px, -12px, 0) rotate(2deg) scale(1.05); }
  100% { transform: translate3d(48px, 4px, 0) rotate(5deg) scale(1.12); }
}

@keyframes smoke-drift-strong {
  0% { transform: translate3d(-4%, 2%, 0) rotate(0deg) scale(1); }
  100% { transform: translate3d(5%, -4%, 0) rotate(8deg) scale(1.1); }
}

@keyframes lab-static-strong {
  0%, 100% { transform: translateY(0); opacity: 0.30; }
  50% { transform: translateY(14px); opacity: 0.50; }
}
