:root {
  color-scheme: light;
  --paper: #f3f6f9;
  --surface: #ffffff;
  --surface-soft: #eaf0f5;
  --ink: #152229;
  --muted: #5d6c75;
  --accent: #0868e8;
  --accent-strong: #0756bd;
  --accent-soft: #e5f0ff;
  --line: #d5dee5;
  --code: #101a21;
  --code-ink: #e7f3f8;
  --shadow: 0 10px 30px rgba(33, 55, 70, .07);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background:
    linear-gradient(rgba(21, 34, 41, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 34, 41, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  font-size: .97rem;
  line-height: 1.52;
}

main {
  width: min(1040px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

h1,
h2,
h3,
.eyebrow,
button,
summary {
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
}

h1 {
  max-width: none;
  margin: .25rem 0 .65rem;
  font-size: clamp(2.25rem, 4.2vw, 2.85rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.045em;
}

h2 {
  margin: 1.95rem 0 .6rem;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -.02em;
}

h3 {
  margin: 0 0 .45rem;
  font-size: .95rem;
  line-height: 1.3;
}

p,
li { max-width: 82ch; }

p { margin: .55rem 0; }

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:hover { color: var(--accent); }

.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.lede {
  max-width: 76ch;
  margin: 0 0 .8rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.time {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  margin: 0;
  padding: .18rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  color: var(--muted);
  font: 700 .7rem "Avenir Next", Avenir, sans-serif;
}

.model {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .65rem;
  align-items: stretch;
  margin: 1rem 0;
}

.card,
.check,
.mission {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
}

.card { padding: .85rem 1rem; }

.card strong {
  display: block;
  margin-bottom: .1rem;
  color: var(--accent-strong);
  font-size: .92rem;
  font-weight: 800;
}

.arrow {
  align-self: center;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 800;
}

.mission {
  display: grid;
  grid-template-columns: minmax(170px, .55fr) 2fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-top: 3px solid var(--accent);
}

.mission strong {
  color: var(--accent-strong);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mission p {
  max-width: none;
  margin: 0;
}

.step { margin: 1.2rem 0; }

.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: .75rem 0 1.15rem;
}

.step-grid .step {
  min-width: 0;
  margin: 0;
  padding: .85rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .52);
}

.step-grid .step pre:last-child,
.step-grid .step details:last-child,
.step-grid .step p:last-child { margin-bottom: 0; }

pre {
  position: relative;
  overflow-x: auto;
  margin: .65rem 0 1rem;
  padding: .8rem 3.25rem .8rem .95rem;
  border: 1px solid #263943;
  border-radius: 10px;
  background: var(--code);
  box-shadow: 0 8px 20px rgba(16, 26, 33, .1);
  color: var(--code-ink);
  font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

p code,
li code,
.card code {
  padding: .08em .3em;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #164e82;
  font-size: .9em;
}

.copy {
  position: absolute;
  top: .45rem;
  right: .45rem;
  border: 1px solid #526873;
  border-radius: 6px;
  padding: .25rem .45rem;
  background: rgba(255, 255, 255, .04);
  color: var(--code-ink);
  font-size: .68rem;
  cursor: pointer;
}

.copy:hover { background: #253740; }

details {
  margin: .65rem 0;
  padding: .55rem .75rem;
  border: 1px dashed #bdcbd4;
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
}

details p:last-child { margin-bottom: 0; }

summary {
  color: #25343c;
  font-size: .86rem;
  font-weight: 750;
  cursor: pointer;
}

.check {
  padding: 1rem;
}

.quiz {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.quiz > p,
.quiz > button,
.quiz > .feedback {
  grid-column: 1 / -1;
}

.quiz > p:first-child { margin: 0 0 .2rem; }

.quiz label {
  display: flex;
  gap: .45rem;
  align-items: center;
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: .84rem;
  cursor: pointer;
}

.quiz label:hover {
  border-color: #9ebce5;
  background: var(--accent-soft);
}

.feedback {
  min-height: 1.3em;
  margin: 0;
  color: var(--accent-strong);
  font-size: .84rem;
  font-weight: 700;
}

button.check-answer {
  justify-self: start;
  margin-top: .15rem;
  border: 0;
  border-radius: 7px;
  padding: .52rem .75rem;
  background: var(--accent);
  color: white;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}

button.check-answer:hover { background: var(--accent-strong); }

footer {
  margin-top: 2.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}

footer p {
  display: inline;
  margin-right: 1rem;
}

@media (max-width: 700px) {
  main {
    width: min(100% - 1.5rem, 1040px);
    padding-top: 1.5rem;
  }

  h1 { font-size: clamp(2rem, 11vw, 2.45rem); }

  .mission {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

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

  .arrow {
    transform: rotate(90deg);
    text-align: center;
  }

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

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

@media (prefers-reduced-motion: no-preference) {
  main { animation: settle-in .28s ease-out both; }

  @keyframes settle-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media print {
  body { background: white; }
  main { width: 100%; padding: 1rem 0; }
  .copy,
  button.check-answer { display: none; }
  a { color: inherit; }
  .card,
  .check,
  .mission { box-shadow: none; }
}
