:root {
  color-scheme: light;
  --ink: #15161a;
  --muted: #5a6270;
  --paper: #fbfaf6;
  --line: #c8c2b5;
  --cap: #b83d34;
  --align: #1f7a68;
  --policy: #6d5ab8;
  --infra: #315f8a;
  --gold: #a96f12;
  --soft: #fffdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ece8df;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
}

.screen-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 56px);
  background: #20242b;
  color: white;
}

.screen-header h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 68px);
  line-height: 0.95;
}

.screen-header p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #d7d2c5;
}

button {
  min-width: 104px;
  border: 1px solid #f6d27b;
  border-radius: 6px;
  padding: 10px 16px;
  background: #f6d27b;
  color: #17130b;
  font-weight: 700;
  cursor: pointer;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px clamp(20px, 4vw, 56px) 0;
}

.tabs a {
  border: 1px solid #b9b1a2;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fffdf7;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}

.learn-section {
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto;
}

.section-intro {
  max-width: 780px;
  margin-bottom: 16px;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
}

.section-intro p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.resource-card {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
  box-shadow: 0 12px 28px rgb(21 22 26 / 0.08);
}

.resource-card:hover .resource-image {
  transform: translateY(-5px) rotate(-2deg);
}

.resource-image {
  width: 88px;
  height: 88px;
  transition: transform 180ms ease;
}

.resource-card h3 {
  margin: 12px 0 8px;
  font-size: 24px;
}

.resource-card p {
  margin: 0;
  color: #30343b;
}

.walkthrough-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
}

.walk-stage,
.walk-controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: 0 12px 28px rgb(21 22 26 / 0.08);
}

.walk-stage {
  padding: 18px;
}

.mini-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-track,
.gap-meter {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #ffffff;
}

.mini-track {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-content: center;
}

.mini-track span,
.gap-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-track strong,
.gap-meter strong {
  font-size: 30px;
  line-height: 1;
}

.bar {
  grid-column: 1 / -1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e1d5;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 520ms ease;
}

.capability-track .bar i {
  background: var(--cap);
}

.alignment-track .bar i {
  background: var(--align);
}

.regulation-track .bar i {
  background: var(--policy);
}

.gap-meter {
  display: grid;
  align-content: center;
  background: #f8f4ea;
  transition: background 220ms ease, border-color 220ms ease;
}

.gap-meter small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.gap-meter.is-risk {
  border-color: var(--cap);
  background: #ffe5e2;
  animation: riskPulse 1200ms ease-in-out infinite;
}

.lab-demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f4ec;
}

.lab-demo h3 {
  margin: 0;
  font-size: 28px;
}

.resource-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.resource-chip {
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  min-width: 96px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  animation: chipPop 380ms ease both;
}

.resource-chip img {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
}

.resource-chip strong {
  line-height: 1;
}

.resource-chip span {
  color: var(--muted);
  font-size: 11px;
}

.walk-card {
  min-height: 170px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 18px;
  background: white;
  animation: cardLift 420ms ease both;
}

.walk-card h3 {
  margin: 0 0 10px;
  font-size: 30px;
}

.walk-card p:last-child {
  max-width: 680px;
  margin: 0;
  color: #30343b;
  font-size: 17px;
}

.walk-controls {
  padding: 14px;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-button,
.button-row button {
  width: 100%;
  min-width: 0;
  border-color: var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
}

.step-button.is-active {
  border-color: var(--ink);
  background: #20242b;
  color: white;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.button-row button {
  text-align: center;
  background: #f6d27b;
}

.sheet {
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.sheet-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 16px;
}

.sheet-heading h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-grid,
.tile-grid,
.lab-grid,
.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.card,
.lab,
.tile,
.reference,
.track,
.token {
  min-height: 180px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  padding: 12px;
  background: #fffdf8;
  break-inside: avoid;
  page-break-inside: avoid;
}

.card {
  aspect-ratio: 2.5 / 3.5;
  display: flex;
  flex-direction: column;
}

.card.compact-card {
  min-height: 150px;
}

.card-header,
.tile-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.category {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
}

.name {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.05;
}

.cost {
  margin: 10px 0;
  color: var(--gold);
  font-weight: 800;
}

.text {
  margin: auto 0 0;
  font-size: 15px;
}

.lab {
  min-height: 360px;
}

.lab h3,
.tile h3,
.reference h3,
.track h3,
.token h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.05;
}

.motto {
  margin: 0 0 12px;
  color: var(--muted);
  font-style: italic;
}

.field {
  margin: 9px 0;
  font-size: 14px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.tile[data-type="Capability"] {
  border-color: var(--cap);
}

.tile[data-type="Alignment"] {
  border-color: var(--align);
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.track-line {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  margin-top: 12px;
}

.pip {
  min-height: 22px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted);
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.token {
  min-height: 118px;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.token h3 {
  font-size: 15px;
}

.token p {
  margin: 4px 0 0;
  font-size: 12px;
}

.reference ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

@keyframes riskPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(184 61 52 / 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(184 61 52 / 0.12);
  }
}

@keyframes chipPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardLift {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .screen-header,
  .lab-demo {
    align-items: stretch;
    flex-direction: column;
  }

  .walkthrough-layout {
    grid-template-columns: 1fr;
  }

  .mini-board {
    grid-template-columns: 1fr;
  }

  .resource-strip {
    justify-content: flex-start;
  }
}

@media print {
  @page {
    size: letter;
    margin: 0.4in;
  }

  body {
    background: white;
  }

  .screen-header,
  .screen-only {
    display: none;
  }

  .sheet {
    width: auto;
    margin: 0 0 0.25in;
    padding: 0;
    border: 0;
    background: white;
    page-break-after: always;
  }

  .sheet-heading {
    margin-bottom: 0.14in;
  }

  .card-grid {
    grid-template-columns: repeat(3, 2.45in);
    gap: 0.1in;
  }

  .card {
    width: 2.45in;
    min-height: 3.43in;
    aspect-ratio: auto;
  }

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

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

  .token-grid {
    grid-template-columns: repeat(4, 1.35in);
  }

  .token {
    width: 1.35in;
    min-height: 1.35in;
  }
}
