@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap");
.reading-layout > div,
.lesson,
.panel {
  min-width: 0;
  overflow-wrap: anywhere;
}
.header-fields {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  gap: 3px;
  min-width: 500px;
}
.header-wrap {
  overflow: auto;
}
.header-fields button {
  font-size: 11px;
  padding: 12px 4px;
  background: #edf2ff;
  color: #2447a5;
  border: 1px solid #cdd9f6;
  line-height: 1.4;
}
.header-fields button:hover {
  background: #dce7ff;
}
.header-fields button.selected {
  background: #315dee;
  color: #fff;
}
:root {
  --ink: #172743;
  --muted: #61708a;
  --blue: #315dee;
  --line: #dce4f1;
  --soft: #f3f6fc;
  --green: #d5f3df;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}
body {
  margin: 0;
  background: #fcfdff;
  color: var(--ink);
  font:
    16px/1.7 "DM Sans",
    sans-serif;
}
h1,
h2,
h3,
.brand {
  font-family: Manrope, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(38px, 5.2vw, 72px);
  max-width: 950px;
  margin: 15px 0 22px;
  font-weight: 800;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 21px;
}
em {
  font-style: normal;
  color: var(--blue);
}
a {
  color: var(--blue);
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 0;
  border-radius: 10px;
  padding: 11px 19px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}
button:hover,
.button:hover {
  filter: brightness(0.95);
}
button:disabled {
  background: #e6ebf3;
  color: #75829a;
  cursor: default;
}
.quiet {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #98b0ff;
  outline-offset: 4px;
}
.top {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding: 20px 4%;
  background: #fffffff5;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 23px;
  white-space: nowrap;
}
.brand small {
  font:
    11px "DM Sans",
    sans-serif;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  color: var(--muted);
}
.top nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.top nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.top nav a[aria-current] {
  color: var(--blue);
  font-weight: 700;
}
.skip {
  position: absolute;
  left: 15px;
  top: -100px;
  z-index: 10;
  background: white;
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
main {
  max-width: 1240px;
  margin: auto;
  padding: 58px 35px 90px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--blue);
}
.intro {
  color: var(--muted);
  font-size: 19px;
  max-width: 760px;
  margin-bottom: 35px;
}
section {
  margin: 34px 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
}
.network-art {
  background: linear-gradient(135deg, #eff4ff, #f3f6fe);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}
.network-art svg {
  width: 100%;
}
.network-art p {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}
.panel,
.lesson {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  margin-bottom: 24px;
}
.panel h2 {
  margin-top: 0;
}
.panel p {
  color: var(--muted);
}
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.steps li {
  border-top: 2px solid var(--line);
  padding: 20px 0;
}
.steps span {
  color: var(--blue);
  font-size: 12px;
}
.steps a {
  text-decoration: none;
  color: var(--ink);
}
.steps p {
  font-size: 14px;
  color: var(--muted);
}
.stats {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.stats dt {
  font-size: 34px;
  font-weight: 700;
  color: var(--blue);
}
.stats dd {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
label {
  display: block;
  margin: 15px 0 7px;
  font-size: 14px;
  font-weight: 600;
}
input:not([type="checkbox"]),
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  background: white;
  color: var(--ink);
}
input[type="checkbox"] {
  accent-color: var(--blue);
  margin-right: 8px;
}
textarea {
  min-height: 135px;
  resize: vertical;
}
form button {
  margin-top: 15px;
}
output {
  display: block;
  white-space: pre-line;
  font-size: 14px;
  margin-top: 14px;
  overflow-wrap: anywhere;
}
details {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 20px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
.reading-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 35px;
}
.topic-nav {
  position: sticky;
  top: 110px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 75vh;
  overflow: auto;
}
.topic-nav a {
  font-size: 13px;
  color: var(--muted);
  padding: 9px;
  text-decoration: none;
  border-radius: 8px;
}
.topic-nav a:hover {
  background: var(--soft);
  color: var(--blue);
}
.lesson {
  scroll-margin-top: 110px;
}
.lesson section p {
  max-width: 72ch;
}
pre {
  background: var(--soft);
  padding: 20px;
  border-radius: 12px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.tool-grid .panel {
  margin: 0;
}
.pills,
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pills a {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
}
.bits {
  display: flex;
  gap: 5px;
}
.bits button {
  padding: 8px 0;
  flex: 1;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
}
.bits button[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}
.question {
  margin: 25px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.question h3 {
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.options {
  display: grid;
  gap: 8px;
}
.options button {
  background: var(--soft);
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid transparent;
  font-weight: 400;
}
.options button.selected {
  border-color: var(--blue);
  color: var(--blue);
  background: #edf2ff;
}
.options button.correct {
  border-color: #88c79b;
  background: #edf9f0;
  color: #176838;
}
.options button.incorrect {
  border-color: #e4aab0;
  background: #fff1f2;
  color: #9d303b;
}
.feedback {
  font-size: 14px;
  color: var(--muted);
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}
.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.exam-link {
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s;
}
.exam-link:hover {
  transform: translateY(-4px);
}
.exam-link span {
  font-size: 12px;
  color: var(--blue);
}
.exam-status {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
.exam-status button {
  margin-left: auto;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}
.flash-panel {
  max-width: 850px;
  margin: 48px auto;
}
#card-counter {
  margin: 24px 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.flash-panel > .controls {
  margin-top: 28px;
  gap: 12px;
}
.flash {
  width: 100%;
  min-height: 300px;
  text-align: left;
  padding: 44px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 25px;
  line-height: 1.5;
}
.flash small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 25px;
}
#card-back {
  display: block;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.85;
  max-width: 65ch;
}
#card-front {
  display: block;
}
#ratings {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
#card-shuffle {
  margin-left: auto;
  background: var(--soft);
  color: var(--blue);
}
#ratings button {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}
#ratings button[data-rating="known"] {
  background: var(--green);
  border-color: var(--green);
}
footer {
  border-top: 1px solid var(--line);
  padding: 30px 5%;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
footer p {
  flex-basis: 100%;
  margin: 0;
}
footer output {
  flex-basis: 100%;
}
[hidden] {
  display: none !important;
}
#packet-layers {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 8px;
  flex-wrap: wrap;
}
#packet-layers li {
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}
#packet-layers li.active {
  background: #e7eeff;
  border-color: var(--blue);
}
.resolved {
  opacity: 0.65;
}
.reveal {
  animation: arrive 0.4s ease;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 1000px) {
  .top {
    flex-wrap: wrap;
  }
  .top nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow: auto;
    gap: 25px;
  }
  .top > .quiet {
    margin-left: auto;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .reading-layout {
    grid-template-columns: 1fr;
  }
  .topic-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  main {
    padding: 35px 20px;
  }
  .hero-grid,
  .tool-grid,
  .exam-grid {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .panel,
  .lesson {
    padding: 23px;
  }
  .stats {
    flex-wrap: wrap;
  }
  .stats > div {
    width: 40%;
  }
  .top {
    padding: 15px 20px;
    gap: 10px;
  }
  .brand small {
    display: none;
  }
  .top nav {
    gap: 20px;
  }
  .top nav a {
    font-size: 13px;
  }
  h2 {
    font-size: 26px;
  }
  .flash {
    padding: 25px;
    font-size: 21px;
  }
  .exam-status {
    flex-wrap: wrap;
  }
  .exam-status button {
    margin-left: 0;
  }
  .network-art {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .top,
  footer,
  button,
  .topic-nav {
    display: none;
  }
  main {
    padding: 0;
  }
  .panel,
  .lesson {
    break-inside: avoid;
  }
  body {
    font-size: 11pt;
  }
}
.question,
.options,
.options button {
  min-width: 0;
  overflow-wrap: anywhere;
  max-width: 100%;
}
