:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-2: #0b1018;
  --panel: rgba(15, 20, 28, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(21, 245, 215, 0.18);
  --line-strong: rgba(21, 245, 215, 0.48);
  --text: #f0fff9;
  --muted: #91a69f;
  --cyan: #15f5d7;
  --green: #58ff89;
  --purple: #ad6bff;
  --pink: #ff2aa3;
  --amber: #ffce6b;
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(21, 245, 215, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(173, 107, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #05070b 0%, #09111a 46%, #070812 100%);
  background-size: 36px 36px, 36px 36px, auto;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top left, rgba(21, 245, 215, 0.14), transparent 36rem),
    radial-gradient(ellipse at bottom right, rgba(255, 42, 163, 0.08), transparent 32rem);
  opacity: 0.9;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.84);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1440px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand,
.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--text);
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  box-shadow: 0 0 18px rgba(21, 245, 215, 0.18);
}

.nav-links {
  justify-content: center;
  gap: 14px;
}

.nav-links a,
.ghost-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(21, 245, 215, 0.34);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: rgba(5, 11, 17, 0.7);
}

.nav-links a:hover,
.nav-links a.is-active,
.ghost-button:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(21, 245, 215, 0.24);
}

.nav-actions {
  justify-content: flex-end;
  gap: 12px;
}

.nav-actions form {
  margin: 0;
}

.ghost-button {
  cursor: pointer;
}

.rank-pill,
.lab-status,
.lab-code,
.solved-pill {
  border: 1px solid rgba(88, 255, 137, 0.32);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--green);
  background: rgba(88, 255, 137, 0.08);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-band {
  position: relative;
  overflow: hidden;
  padding: 64px 0 26px;
}

.hero-grid,
.content-shell {
  position: relative;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 42px;
  align-items: center;
}

.binary-line {
  width: 100%;
  margin-bottom: 34px;
  overflow: hidden;
  color: rgba(21, 245, 215, 0.2);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.86rem;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2.3rem, 6vw, 5.35rem);
  line-height: 0.95;
}

.hero-copy p:not(.eyebrow),
.lesson-summary {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.mini-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  color: #04110d;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 32px rgba(21, 245, 215, 0.2);
}

.secondary-button {
  border: 1px solid rgba(173, 107, 255, 0.42);
  color: #e8d7ff;
  background: rgba(173, 107, 255, 0.08);
}

.secondary-button.compact {
  min-height: 42px;
}

.ops-panel,
.lab-card,
.empty-state,
.video-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
}

.ops-panel {
  padding: 22px;
}

.panel-topline,
.card-code-row,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-topline {
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.85rem;
}

.panel-topline strong {
  color: var(--green);
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.ops-grid div {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.ops-grid span {
  color: var(--muted);
  font-size: 0.8rem;
}

.ops-grid strong {
  color: var(--cyan);
  font-size: 1.45rem;
}

.terminal-readout {
  min-height: 116px;
  margin: 0;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  color: var(--green);
  background: rgba(0, 0, 0, 0.36);
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.6;
}

.content-shell {
  padding: 34px 0 76px;
}

.page-band {
  padding-top: 34px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
}

.text-link {
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 900;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.lab-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.lab-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 24px 80px rgba(21, 245, 215, 0.1);
}

.lab-code {
  color: var(--cyan);
  background: rgba(21, 245, 215, 0.08);
}

.lab-status {
  border-color: rgba(255, 42, 163, 0.34);
  color: #ff8ed0;
  background: rgba(255, 42, 163, 0.08);
}

.lab-track {
  margin: 22px 0 10px;
  color: var(--amber);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lab-card h3 {
  color: var(--cyan);
  font-size: 1.55rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.lab-card p:not(.lab-track) {
  color: #d7e7e1;
  line-height: 1.65;
}

.signal-meter {
  height: 8px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.signal-meter span {
  display: block;
  width: var(--meter);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--purple));
}

.mini-button {
  min-height: 42px;
  flex: 1 1 130px;
  border: 0;
  color: #04110d;
  background: var(--green);
  cursor: pointer;
}

.mini-button.alt {
  color: #061314;
  background: var(--cyan);
}

.notice {
  border: 1px solid rgba(255, 206, 107, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffe3aa;
  background: rgba(255, 206, 107, 0.08);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 32px;
}

.empty-state p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
}

.next-widget {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid rgba(173, 107, 255, 0.34);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(21, 245, 215, 0.08), rgba(173, 107, 255, 0.12)),
    rgba(10, 14, 22, 0.9);
  box-shadow: 0 24px 70px var(--shadow);
}

.next-widget h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.next-widget p:not(.eyebrow) {
  max-width: 760px;
  color: #d7e7e1;
  line-height: 1.65;
}

.lesson-shell {
  max-width: 1080px;
}

.video-frame {
  margin-top: 24px;
  padding: 12px;
}

.video-frame video {
  display: block;
  width: 100%;
  max-height: 68vh;
  border-radius: 8px;
  background: #000;
}

.flag-form {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.flag-form input {
  min-height: 42px;
  border: 1px solid rgba(21, 245, 215, 0.24);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  outline: none;
}

.flag-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(21, 245, 215, 0.14);
}

.flag-form .mini-button {
  width: 100%;
}

.solved-pill {
  width: fit-content;
  margin-top: auto;
}

@media (max-width: 980px) {
  .nav-shell,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    padding: 14px 0;
  }

  .nav-links,
  .nav-actions,
  .brand {
    justify-content: center;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero-band {
    padding-top: 34px;
  }

  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-shell,
  .hero-grid,
  .content-shell {
    width: min(100% - 24px, 1200px);
  }

  .brand {
    justify-content: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero-copy h1 {
    font-size: 2.45rem;
  }

  .lab-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .next-widget {
    align-items: flex-start;
    flex-direction: column;
  }
}
