:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --ink: #172333;
  --muted: #667085;
  --line: #e5e1da;
  --maroon: #8a1538;
  --maroon-2: #6f102d;
  --navy: #10273f;
  --gold: #c69a45;
  --teal: #1a7a78;
  --blue: var(--maroon);
  --blue-2: var(--maroon-2);
  --sky: var(--teal);
  --green: var(--teal);
  --amber: var(--gold);
  --red: #b42318;
  --soft-blue: #fff1f5;
  --soft-green: #e8f4f3;
  --soft-amber: #fff8e8;
  --soft: #faf8f5;
  --shadow: 0 16px 36px rgba(16, 24, 40, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0, var(--bg) 360px);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 13px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(223, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 275px;
}

.brand-logo {
  width: 96px;
  height: auto;
  display: block;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.nav a {
  padding: 9px 12px;
  border-radius: 999px;
  color: #35465a;
  font-size: 14px;
  font-weight: 800;
}

.nav a.active,
.nav a:hover {
  color: var(--blue);
  background: var(--soft-blue);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #fff;
}

#app {
  min-height: calc(100vh - 134px);
}

#app:focus {
  outline: 0;
}

.page {
  width: min(1180px, calc(100% - 38px));
  margin: 0 auto;
  padding: 42px 0 62px;
}

.home-page {
  width: min(1480px, calc(100% - 70px));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: stretch;
  margin-bottom: 28px;
}

.home-landing {
  min-height: calc(100vh - 180px);
  display: grid;
  align-content: start;
  gap: 26px;
}

.home-intro {
  max-width: 850px;
}

.home-intro h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.home-intro .lead {
  max-width: 690px;
  font-size: clamp(18px, 2vw, 22px);
}

.portal-panel {
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 55px rgba(16, 24, 40, 0.05);
}

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

.portal-choice {
  min-height: clamp(150px, 17vw, 205px);
  display: grid;
  align-content: center;
  justify-items: start;
  align-items: center;
  gap: 20px;
  padding: clamp(20px, 2vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  color: #1d2939;
  background: #f8fafc;
  font-size: clamp(28px, 2vw, 30px);
  font-weight: 900;
  line-height: 1.05;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.portal-choice:hover {
  transform: translateY(-3px);
  color: var(--maroon);
  background: #fff;
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.08);
}

.portal-choice:nth-child(1) {
  background: #fff7ed;
}

.portal-choice:nth-child(2) {
  background: #ecfdf3;
}

.portal-choice:nth-child(3) {
  background: #fff1f5;
}

.portal-choice:nth-child(4) {
  background: #eff6ff;
}

.portal-choice:nth-child(5) {
  background: #f5f3ff;
}

.portal-choice:nth-child(6) {
  background: #f8fafc;
}

.choice-icon {
  width: 58px;
  height: 58px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--maroon);
  background: rgba(255, 255, 255, 0.78);
}

.choice-icon svg {
  width: 28px;
  height: 28px;
}

.portal-choice .choice-icon {
  color: var(--maroon);
}

.portal-choice strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: inherit;
  font-weight: 900;
  line-height: 1.12;
}

.hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-visual {
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(138, 21, 56, 0.08), rgba(26, 122, 120, 0.08)),
    #fff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 850px;
  font-size: clamp(38px, 6vw, 76px);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(26px, 3vw, 38px);
}

h3 {
  font-size: 22px;
}

h4 {
  font-size: 16px;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: #43546a;
  font-size: clamp(17px, 2vw, 22px);
}

.actions,
.filter-row,
.chip-row,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions {
  margin-top: 26px;
}

.button,
.ghost-button,
.pill-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 28px rgba(138, 21, 56, 0.16);
}

.button:hover {
  background: var(--blue-2);
}

.ghost-button,
.pill-button {
  border: 1px solid #ead1da;
  color: var(--blue);
  background: #fff;
}

.pill-button {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 13px;
}

.pill-button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.card,
.panel,
.download-card,
.stat-card,
.lab-card,
.module-card,
.result-box,
.callout {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card,
.panel,
.download-card,
.stat-card,
.module-card,
.result-box,
.callout {
  padding: 22px;
}

.card {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 21, 56, 0.28);
  box-shadow: 0 22px 48px rgba(16, 32, 51, 0.12);
}

.lab-index-card {
  min-height: 190px;
  gap: 12px;
}

.lab-index-card h3 {
  font-size: 20px;
  line-height: 1.18;
}

.lab-index-card p {
  margin: 0;
  font-size: 14px;
}

.lab-index-card .chip-row {
  margin-top: auto;
}

.card p,
.panel p,
.download-card p,
.module-card p,
.lab-card p,
.result-box p,
.callout p {
  color: var(--muted);
}

.icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.stat-card strong {
  display: block;
  color: var(--blue);
  font-size: 30px;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 900;
}

.tag.green {
  color: var(--green);
  background: var(--soft-green);
}

.tag.amber {
  color: var(--amber);
  background: var(--soft-amber);
}

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

.metric-tile {
  min-height: 105px;
  padding: 16px;
  border: 1px solid #ead1da;
  border-radius: 8px;
  background: #fff7fa;
}

.metric-tile strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  color: #43546a;
  font-size: 13px;
  font-weight: 800;
}

.bar-row div {
  height: 13px;
  border-radius: 999px;
  background: #eadde3;
  overflow: hidden;
}

.bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--sky));
}

.mini-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-dashboard div {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #e7ded5;
  border-radius: 8px;
  background: #fff;
}

.mini-dashboard div:first-child {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  gap: 14px;
}

.module-card {
  box-shadow: none;
}

.module-card summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 900;
  font-size: 18px;
}

.module-card ul,
.clean-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.module-card li,
.clean-list li {
  margin: 7px 0;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.dataset-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue);
  background: #fbf7f8;
  font-size: 13px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.lab-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.lab-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.lab-sidebar a {
  display: grid;
  gap: 3px;
  padding: 12px 13px;
  border-radius: 8px;
  color: #3e5065;
  font-weight: 800;
}

.lab-sidebar span {
  color: var(--maroon);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lab-sidebar small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.lab-sidebar a.active,
.lab-sidebar a:hover {
  color: var(--blue);
  background: var(--soft-blue);
}

.lab-sidebar a.active small,
.lab-sidebar a:hover small {
  color: #344054;
}

.lab-card {
  overflow: hidden;
}

.lab-hero {
  padding: clamp(22px, 3vw, 32px);
  background:
    linear-gradient(135deg, rgba(138, 21, 56, 0.08), rgba(198, 154, 69, 0.08)),
    #fff;
  border-bottom: 1px solid var(--line);
}

.lab-hero h1 {
  max-width: 840px;
  font-size: clamp(30px, 4vw, 46px);
}

.lab-hero .lead {
  max-width: 760px;
  font-size: 17px;
}

.lab-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.lab-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 0;
}

.lab-main {
  padding: 30px;
}

.lab-aside {
  padding: 30px 24px;
  border-left: 1px solid var(--line);
  background: #fbfbfa;
}

.lab-main h2 {
  font-size: clamp(23px, 2.4vw, 30px);
}

.lab-main section:first-child h2 {
  max-width: 780px;
  font-size: clamp(24px, 2.8vw, 34px);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps li {
  counter-increment: steps;
  position: relative;
  min-height: 52px;
  padding: 0 0 20px 50px;
  color: #415168;
}

.steps li strong {
  color: var(--ink);
}

.steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 38px;
  bottom: 8px;
  width: 2px;
  background: #eadde3;
}

.step-tool {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 900;
}

.result-box {
  margin-top: 18px;
  box-shadow: none;
}

.result-box.success {
  border-color: #b8e1ce;
  background: #f3fbf7;
}

.result-box.warning {
  border-color: #f1d49b;
  background: #fffaf0;
}

details.challenge {
  margin-top: 18px;
  border: 1px solid #ead1da;
  border-radius: 8px;
  background: #fff9fb;
}

details.challenge summary {
  cursor: pointer;
  padding: 15px 18px;
  color: var(--blue);
  font-weight: 900;
}

details.challenge div {
  padding: 0 18px 18px;
  color: var(--muted);
}

.search-box {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #ead1da;
  border-radius: 8px;
  background: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 28px;
  background: rgba(7, 19, 33, 0.58);
}

.modal-backdrop.open {
  display: grid;
  place-items: center;
}

.modal {
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-body {
  padding: 20px;
}

.close-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 22px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

@media (max-width: 1060px) {
  .grid.four,
  .grid.three,
  .choice-grid,
  .hero,
  .lab-layout,
  .lab-body {
    grid-template-columns: 1fr;
  }

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

  .lab-sidebar {
    position: static;
  }

  .lab-aside {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-logo {
    width: 76px;
  }

  .brand span {
    min-width: 0;
  }

  .brand strong,
  .brand small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 8px);
    display: none;
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: grid;
  }

  .nav a {
    border-radius: 8px;
    background: #fbfbfa;
  }

  .page {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

  .hero-copy,
  .hero-visual,
  .lab-main,
  .lab-aside {
    padding: 20px;
  }

  h1 {
    font-size: 42px;
  }

  .portal-choice {
    min-height: 172px;
    padding: 22px;
  }

  .choice-icon {
    width: 58px;
    height: 58px;
  }

  .choice-icon svg {
    width: 30px;
    height: 30px;
  }

  .portal-choice strong {
    font-size: 24px;
  }

  .grid.four,
  .grid.two,
  .choice-grid,
  .metric-board,
  .download-card,
  .mini-dashboard {
    grid-template-columns: 1fr;
  }

  .download-card .button,
  .actions .button,
  .actions .ghost-button {
    width: 100%;
  }

  .section-head,
  .site-footer {
    display: block;
  }

  .bar-row {
    grid-template-columns: 78px minmax(0, 1fr) 42px;
  }
}

@media print {
  .topbar,
  .site-footer,
  .lab-sidebar,
  .actions,
  .filter-row {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .card,
  .panel,
  .download-card,
  .lab-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
