:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --ink: #172033;
  --muted: #667085;
  --line: #dce4f0;
  --blue: #2f66d7;
  --blue-deep: #1746a2;
  --cyan: #0d9488;
  --orange: #e87524;
  --purple: #7957d5;
  --green: #16845b;
  --red: #b42318;
  --navy: #101a2d;
  --shadow: 0 14px 40px rgba(23, 32, 51, 0.08);
  --shadow-strong: 0 20px 55px rgba(23, 32, 51, 0.16);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 5%, rgba(47, 102, 215, 0.09), transparent 30rem),
    radial-gradient(circle at 90% 32%, rgba(13, 148, 136, 0.07), transparent 26rem),
    var(--bg);
  color: var(--ink);
  font: 16px/1.72 system-ui, -apple-system, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(47, 102, 215, 0.35);
  outline-offset: 3px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 5vw;
  background: rgba(16, 26, 45, 0.96);
  color: #fff;
  box-shadow: 0 8px 30px rgba(16, 26, 45, 0.14);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.top a {
  color: #cfe0ff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-actions > span {
  color: #b8c5dc;
}

.language-switch {
  padding: 5px 10px;
  border: 1px solid #506486;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.wrap {
  width: min(1180px, 90vw);
  margin: 0 auto;
}

.hero {
  padding: 64px 0 34px;
}

.hero h1,
.content > h1 {
  letter-spacing: -0.035em;
}

.hero h1 {
  max-width: 950px;
  margin: 0 0 18px;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 1.06;
}

.hero p {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.eyebrow,
.section-kicker {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  padding: 18px 0 50px;
}

/* Local learning dashboard */
.learning-dashboard {
  margin: 8px 0 24px;
  padding: clamp(20px, 4vw, 28px);
}

.learning-dashboard[hidden],
.course-search[hidden],
.review-form[hidden],
.review-empty[hidden],
.certificate-locked[hidden],
.certificate-unlocked[hidden],
.resume-reading[hidden] {
  display: none !important;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.dashboard-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.dashboard-heading p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0 14px;
}

.dashboard-stats > div {
  display: grid;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
}

.dashboard-stats strong {
  color: var(--blue-deep);
  font-size: 1.4rem;
}

.dashboard-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.course-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e5eaf2;
}

.course-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 300ms ease;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 17px 0 24px;
}

.badge-shelf h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.learning-badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 9px;
  padding: 10px 12px;
  border: 1px dashed #c7ceda;
  border-radius: 12px;
  background: #f6f7f9;
  color: #7b8494;
  filter: grayscale(1);
  opacity: 0.68;
}

.learning-badge > span {
  grid-row: 1 / 3;
  font-size: 1.35rem;
}

.learning-badge strong {
  font-size: 0.83rem;
}

.learning-badge small {
  font-size: 0.7rem;
}

.learning-badge.is-earned {
  border-style: solid;
  border-color: #b9d8cf;
  background: linear-gradient(145deg, #edfff8, #f2f5ff);
  color: var(--ink);
  filter: none;
  opacity: 1;
  box-shadow: 0 6px 18px rgba(23, 32, 51, 0.07);
}

.learning-archive {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.learning-archive summary {
  width: fit-content;
  color: var(--blue-deep);
  font-weight: 800;
  cursor: pointer;
}

.learning-archive > p {
  max-width: 760px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.archive-status {
  min-height: 1.5em;
}

.course-search {
  margin: 22px 0 0;
}

.course-search > label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
}

.search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.search-control input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #b8c5d8;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}

.search-status {
  min-height: 1.5em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card {
  position: relative;
  padding: 22px;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card[hidden] {
  display: none;
}

.card-status {
  float: right;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf0f5;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.card[data-learning-status="completed"] {
  border-color: #a8d7c8;
  background: linear-gradient(145deg, #fff, #f0fff9);
}

.card[data-learning-status="completed"] .card-status {
  background: #d8f8eb;
  color: var(--green);
}

.card[data-learning-status="started"] .card-status {
  background: #e8efff;
  color: var(--blue-deep);
}

.card:hover {
  border-color: #b8caee;
  box-shadow: var(--shadow-strong);
  text-decoration: none;
  transform: translateY(-4px);
}

.card h2,
.card h3 {
  margin: 8px 0;
  font-size: 1.1rem;
}

.card p {
  color: var(--muted);
}

.card-meta {
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 750;
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8efff;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 750;
}

.day-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px;
  padding: 34px 0 70px;
}

.reading-progress-bar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
}

.reading-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #5d8fff, #36d3bd);
  box-shadow: 0 0 10px rgba(54, 211, 189, 0.5);
}

.toc {
  position: sticky;
  top: 76px;
  height: max-content;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 18px;
}

.toc a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  line-height: 1.45;
}

.toc a.active {
  color: var(--blue);
  font-weight: 800;
}

.content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.content > h1 {
  margin: 5px 0 6px;
  font-size: clamp(2.15rem, 5vw, 3.5rem);
  line-height: 1.12;
  text-wrap: balance;
}

.hero-sub {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 1.12rem;
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 2px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e8efff;
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 800;
}

.reading-time::before {
  content: "◷";
}

.resume-reading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 6px;
  padding: 10px 12px;
  border: 1px solid #bad0f5;
  border-radius: 12px;
  background: #f1f6ff;
  color: var(--blue-deep);
  font-size: 0.88rem;
}

.resume-reading > span {
  flex: 1;
  font-weight: 750;
}

.resume-dismiss {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.section-nav {
  display: flex;
  gap: 7px;
  margin: 18px 0 8px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  scrollbar-width: thin;
}

.section-nav a {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.section-nav a:hover,
.section-nav a.is-current {
  background: #e8efff;
  color: var(--blue-deep);
  text-decoration: none;
}

.toc a.is-completed::after {
  margin-left: 5px;
  color: var(--green);
  content: "✓";
}

.content section {
  scroll-margin-top: 90px;
}

.content h2 {
  margin: 42px 0 14px;
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.content h3 {
  margin: 25px 0 8px;
  line-height: 1.4;
}

.content p {
  text-wrap: pretty;
}

.content ul {
  padding-left: 22px;
}

.section-heading {
  margin-top: 46px;
}

.section-heading h2 {
  margin-top: 4px;
}

.section-lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.03rem;
}

.callout {
  margin: 18px 0;
  padding: 15px 19px;
  border-left: 4px solid var(--cyan);
  border-radius: 10px;
  background: #e9fbf8;
}

.table-scroll {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.keyword-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

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

.keyword-table tr:last-child th,
.keyword-table tr:last-child td {
  border-bottom: 0;
}

.keyword-table thead {
  background: #eaf0ff;
}

.keyword-table tbody th {
  min-width: 120px;
  color: var(--blue-deep);
}

/* Historical timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  margin: 26px 0 20px;
}

.timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50px;
  width: 2px;
  background: linear-gradient(var(--blue), var(--cyan));
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: start;
}

.timeline-year {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 92px;
  margin-top: 18px;
  padding: 5px 9px;
  border: 2px solid #c8d8f6;
  border-radius: 999px;
  background: var(--panel);
  color: var(--blue-deep);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.timeline-content {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.timeline-content h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.timeline-content p {
  margin: 0 0 7px;
  color: #475467;
}

.timeline-content a {
  font-size: 0.84rem;
  font-weight: 750;
}

.history-bridge {
  padding: 14px 17px;
  border-radius: 12px;
  background: linear-gradient(110deg, #e8efff, #e8faf6);
}

.history-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0 20px;
}

.history-track {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.history-track > h3 {
  margin: 0;
  color: var(--blue-deep);
  font-size: 1.05rem;
}

.history-track .timeline {
  margin-bottom: 0;
}

.history-track .timeline::before {
  left: 37px;
}

.history-track .timeline-item {
  grid-template-columns: 76px minmax(0, 1fr);
}

.history-track .timeline-year {
  max-width: 70px;
  padding-inline: 6px;
  font-size: 0.68rem;
}

.timeline-content h4 {
  margin: 0 0 5px;
  font-size: 0.96rem;
  line-height: 1.4;
}

/* Layered infrastructure map */
.verification-date {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff4e8;
  color: #8a4318;
  font-size: 0.84rem;
}

.infra-layers {
  display: grid;
  gap: 20px;
  margin: 26px 0;
}

.infra-layer {
  min-width: 0;
}

.infra-layer > h3 {
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--purple);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.project-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.project-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.project-card dl,
.project-card dd {
  margin: 0;
}

.project-card dl {
  display: grid;
  gap: 9px;
}

.project-card dt {
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-card dd {
  color: #475467;
  font-size: 0.9rem;
}

.infra-matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.infra-matrix thead {
  background: #efeaff;
}

.infra-matrix tbody th {
  color: var(--blue-deep);
}

.infra-matrix tr:last-child th,
.infra-matrix tr:last-child td {
  border-bottom: 0;
}

/* Illustrated analogy */
.analogy-card {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid #cddaf1;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(121, 87, 213, 0.13), transparent 22rem),
    linear-gradient(145deg, #f7f9ff, #edf8f7);
  box-shadow: var(--shadow);
}

.analogy-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.analogy-copy h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.analogy-copy p {
  color: #475467;
}

.analogy-illustration {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
  margin: 22px 0 17px;
}

.analogy-piece {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  justify-items: center;
  min-width: 0;
  padding: 16px 12px;
  border: 1px solid rgba(47, 102, 215, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.analogy-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 5px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e5edff, #e4faf6);
  font-size: 1.75rem;
  box-shadow: inset 0 0 0 1px rgba(47, 102, 215, 0.08);
}

.analogy-piece > span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
}

.analogy-arrow {
  margin: 3px 0;
  color: var(--purple);
  font-weight: 900;
}

.analogy-boundary {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed #bdcbe2;
  color: #475467;
  font-size: 0.92rem;
}

/* Animated process visual */
.process-visual {
  overflow: hidden;
  padding: clamp(19px, 4vw, 28px);
  border: 1px solid #293a60;
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0, rgba(75, 139, 255, 0.24), transparent 22rem),
    radial-gradient(circle at 95% 100%, rgba(23, 190, 170, 0.17), transparent 22rem),
    #101a2f;
  color: #f3f7ff;
  box-shadow: 0 24px 60px rgba(16, 26, 47, 0.2);
}

.process-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.process-heading h3 {
  margin: 0 0 4px;
  font-size: 1.18rem;
}

.process-heading p {
  max-width: 680px;
  margin: 0;
  color: #b8c5dc;
}

.visual-toggle {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #506486;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #e8efff;
  cursor: pointer;
}

.visual-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
}

.visual-toggle:disabled {
  color: #a9b5c9;
  cursor: default;
  opacity: 0.8;
}

.process-track {
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 22px;
  padding: 0;
  list-style: none;
}

.process-step {
  position: relative;
  min-width: 0;
}

.process-step:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: calc(50% + 34px);
  width: calc(100% + 16px - 68px);
  height: 2px;
  background: #41506b;
  content: "";
  transform: translateY(-50%);
  transition: background 240ms ease, box-shadow 240ms ease;
}

.process-step.is-complete:not(:last-child)::after,
.process-step.is-active:not(:last-child)::after {
  background: linear-gradient(90deg, #5d8fff, #2dd4bf);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.5);
}

.process-step.is-active:not(:last-child)::before {
  position: absolute;
  z-index: 3;
  top: calc(50% - 4px);
  left: calc(50% + 28px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #66f0dc;
  box-shadow: 0 0 14px #66f0dc;
  content: "";
  animation: flow-particle-x 1.35s ease-in-out infinite;
}

.process-node {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 100%;
  min-height: 126px;
  padding: 13px 8px;
  border: 1px solid #3a4a68;
  border-radius: 15px;
  background: rgba(21, 35, 61, 0.92);
  color: #dce6f7;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.process-node:hover {
  border-color: #6f89b6;
  transform: translateY(-2px);
}

.process-node strong {
  align-self: end;
  line-height: 1.25;
}

.process-node > span:last-child {
  align-self: start;
  margin-top: 5px;
  color: #9eacc4;
  font-size: 0.75rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.process-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #243452;
  font-size: 1.45rem;
  transition: transform 220ms ease, background 220ms ease;
}

.process-step.is-complete .process-node {
  border-color: rgba(65, 184, 160, 0.52);
}

.process-step.is-active .process-node {
  border-color: #71a0ff;
  background: linear-gradient(155deg, rgba(45, 91, 174, 0.92), rgba(21, 54, 78, 0.94));
  box-shadow: 0 0 0 3px rgba(85, 139, 243, 0.16), 0 15px 34px rgba(3, 10, 24, 0.38);
  transform: translateY(-5px);
}

.process-step.is-active .process-icon {
  background: linear-gradient(145deg, #477ceb, #188f8a);
  transform: scale(1.08);
  animation: node-breathe 1.8s ease-in-out infinite;
}

.process-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.75fr);
  gap: 14px;
}

.process-detail-copy,
.process-insight {
  padding: 16px 18px;
  border: 1px solid rgba(142, 166, 204, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.process-detail-copy > span,
.process-insight > span {
  color: #7fd9cd;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.process-detail-copy h3 {
  margin: 4px 0 5px;
  font-size: 1.02rem;
}

.process-detail-copy p,
.process-insight p {
  margin: 0;
  color: #c4d0e3;
  font-size: 0.92rem;
}

.process-insight {
  background: rgba(38, 112, 106, 0.18);
}

.process-loop {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-left: 3px solid #7fd9cd;
  border-radius: 8px;
  background: rgba(127, 217, 205, 0.08);
  color: #c4d0e3;
  font-size: 0.88rem;
}

.process-loop strong {
  color: #7fd9cd;
}

.process-controls {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
}

.process-controls .button.secondary {
  border: 1px solid #4d6285;
  background: rgba(255, 255, 255, 0.07);
  color: #e8efff;
}

.process-progress {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: #34445f;
}

.process-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6595ff, #35d4bf);
  box-shadow: 0 0 14px rgba(53, 212, 191, 0.65);
  transition: width 350ms ease;
}

.static-diagram {
  min-width: 0;
  max-width: 100%;
  margin-top: 14px;
}

.static-diagram summary {
  width: fit-content;
  max-width: 100%;
  color: var(--blue);
  font-weight: 750;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.diagram {
  max-width: 100%;
  overflow: auto;
  margin: 15px 0;
  padding: 22px;
  border-radius: 16px;
  background: #111c31;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.45;
  white-space: pre;
}

.code {
  overflow: auto;
  padding: 18px;
  border-radius: 12px;
  background: #101828;
  color: #d0f3e8;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.lab-notes {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.lab-notes summary {
  color: var(--blue-deep);
  font-weight: 800;
  cursor: pointer;
}

.lab-notes label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 750;
}

.lab-notes textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid #b8c5d8;
  border-radius: 10px;
  background: #fbfcff;
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}

.lab-notes textarea:focus-visible {
  outline: 3px solid rgba(47, 102, 215, 0.35);
  outline-offset: 2px;
}

.lab-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.lab-notes [data-notes-status] {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 750;
}

.pitfall {
  padding: 14px 18px;
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  background: #fff3e9;
}

.quiz {
  margin-top: 42px;
  padding: clamp(18px, 4vw, 25px);
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quiz > h2 {
  margin-top: 0;
}

.quiz > p {
  margin-top: 0;
  color: var(--muted);
}

.question-card {
  min-width: 0;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.question-card legend {
  padding: 0 6px;
  font-weight: 800;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 9px 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f8fafc;
  cursor: pointer;
}

.quiz-option:hover {
  border-color: #b9caf0;
}

.quiz-option:focus-within {
  outline: 3px solid #9fc0ff;
  outline-offset: 2px;
}

.quiz-option input {
  margin-top: 6px;
  accent-color: var(--blue);
}

.question-card.is-correct {
  border-color: var(--green);
  background: #edfff4;
}

.question-card.is-incorrect {
  border-color: var(--red);
  background: #fff4f2;
}

.answer-explanation {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.answer-explanation p {
  margin: 6px 0 0;
}

.quiz-feedback {
  font-weight: 800;
}

.chapter-reward {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  overflow: hidden;
  margin: 18px 0;
  padding: 17px 19px;
  border: 1px solid #d3c6ff;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(121, 87, 213, 0.19), transparent 15rem),
    linear-gradient(135deg, #f8f5ff, #edfaf7);
  box-shadow: 0 12px 32px rgba(64, 42, 126, 0.12);
}

.chapter-reward[hidden] {
  display: none;
}

.chapter-reward.is-visible {
  animation: reward-arrive 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chapter-reward[data-variant="2"] {
  border-color: #a9ded5;
  background: linear-gradient(135deg, #edfffb, #f5f8ff);
}

.chapter-reward[data-variant="3"] {
  border-color: #f1c49e;
  background: linear-gradient(135deg, #fff7ec, #f7f2ff);
}

.reward-burst {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 1.8rem;
  box-shadow: inset 0 0 0 1px rgba(121, 87, 213, 0.12), 0 8px 20px rgba(23, 32, 51, 0.08);
}

.reward-kicker {
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chapter-reward h3 {
  margin: 2px 0 1px;
  font-size: 1.08rem;
}

.chapter-reward p {
  margin: 0;
  color: #475467;
}

.reference-list li {
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.quiz [hidden] {
  display: none !important;
}

.discussion-section {
  margin-top: 42px;
  padding: clamp(18px, 4vw, 25px);
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.discussion-section .section-heading {
  margin-top: 0;
}

.discussion-section .section-lead {
  margin-bottom: 22px;
}

.discussion-section .giscus {
  min-height: 180px;
}

.discussion-section .giscus-frame {
  width: 100%;
}

.discussion-fallback {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Mistake review */
.review-page {
  padding: 48px 0 72px;
}

.review-hero {
  max-width: 820px;
  margin-bottom: 28px;
}

.review-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
}

.review-hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.review-empty {
  padding: 30px;
  text-align: center;
}

.review-empty > span {
  font-size: 2.5rem;
}

.review-empty h2 {
  margin: 8px 0 4px;
}

.review-empty p {
  margin: 0;
  color: var(--muted);
}

.review-toolbar {
  position: sticky;
  z-index: 10;
  top: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px 15px;
}

.review-list {
  display: grid;
  gap: 16px;
}

.review-card {
  margin: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.review-card legend {
  display: grid;
  gap: 5px;
  max-width: min(780px, 82vw);
}

.review-card legend a {
  width: max-content;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 750;
}

/* Local completion certificate */
.certificate-page {
  padding: 48px 0 72px;
}

.certificate-hero {
  max-width: 820px;
  margin-bottom: 28px;
}

.certificate-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
}

.certificate-hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.certificate-locked {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 760px;
  padding: 26px;
}

.certificate-lock-icon {
  font-size: 2.6rem;
}

.certificate-locked h2,
.certificate-locked p {
  margin: 0 0 5px;
}

.certificate-locked p {
  color: var(--muted);
}

.certificate-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 16px;
}

.certificate-controls label {
  grid-column: 1 / -1;
  font-weight: 800;
}

.certificate-controls input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #aab9d0;
  border-radius: 9px;
  color: var(--ink);
}

.certificate-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 1040px;
  min-height: 650px;
  margin: 0 auto;
  padding: clamp(38px, 7vw, 78px);
  border: 1px solid #9bb5dc;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(47, 102, 215, 0.16), transparent 30rem),
    radial-gradient(circle at 0 100%, rgba(13, 148, 136, 0.14), transparent 28rem),
    #fff;
  box-shadow: inset 0 0 0 9px #fff, inset 0 0 0 11px #d5e0f0, var(--shadow-strong);
  text-align: center;
}

.certificate-orbit {
  position: absolute;
  z-index: -1;
  top: -190px;
  right: -180px;
  width: 480px;
  height: 480px;
  border: 2px solid rgba(47, 102, 215, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(47, 102, 215, 0.035), 0 0 0 82px rgba(13, 148, 136, 0.025);
}

.certificate-mark {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--blue-deep), var(--cyan));
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 30px rgba(23, 70, 162, 0.22);
}

.certificate-mark span {
  margin-left: 2px;
  color: #9ff5e7;
}

.certificate-overline {
  margin: 0;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.certificate-card h2 {
  margin: 10px 0 22px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.certificate-presented {
  margin: 0;
  color: var(--muted);
}

.certificate-name {
  display: block;
  max-width: 720px;
  margin: 8px auto 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid #b6c9e5;
  color: var(--blue-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  overflow-wrap: anywhere;
}

.certificate-statement {
  max-width: 760px;
  margin: 0 auto 30px;
  color: #475467;
  font-size: 1.02rem;
}

.certificate-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 760px;
  margin: 0 auto;
  border-block: 1px solid #d8e1ef;
}

.certificate-metrics > div {
  display: grid;
  padding: 14px 8px;
}

.certificate-metrics > div + div {
  border-left: 1px solid #d8e1ef;
}

.certificate-metrics strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.certificate-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.certificate-footer-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.75rem;
}

.certificate-disclaimer {
  max-width: 900px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 38px 0 0;
}

.button {
  display: inline-block;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
  line-height: 1.45;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.button.secondary {
  background: #e7efff;
  color: var(--blue-deep);
}

.button.danger {
  background: #fff0ee;
  color: var(--red);
  box-shadow: inset 0 0 0 1px #efb8b2;
}

footer {
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.noscript-banner {
  width: min(1180px, 90vw);
  margin: 16px auto;
  padding: 12px 16px;
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  background: #fff3e9;
  color: #7a3512;
}

@keyframes flow-particle-x {
  0% {
    left: calc(50% + 28px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: calc(150% - 28px);
    opacity: 0;
  }
}

@keyframes flow-particle-y {
  0% {
    top: calc(100% - 7px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: calc(100% + 23px);
    opacity: 0;
  }
}

@keyframes node-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(113, 160, 255, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(113, 160, 255, 0.13);
  }
}

@keyframes reward-arrive {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .day-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
  }

  .process-track {
    gap: 9px;
  }

  .process-step:not(:last-child)::after {
    left: calc(50% + 28px);
    width: calc(100% + 9px - 56px);
  }

  .process-node {
    min-height: 116px;
    padding-inline: 5px;
  }

  .history-tracks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .top {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .wrap {
    width: min(92vw, 680px);
  }

  .dashboard-heading {
    display: grid;
    gap: 8px;
  }

  .review-toolbar {
    top: 0;
  }

  .certificate-page {
    padding-top: 30px;
  }

  .hero {
    padding-top: 38px;
  }

  .day-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 18px;
  }

  .toc {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    gap: 7px;
    width: 100vw;
    max-height: none;
    margin-left: calc(50% - 50vw);
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-width: 1px 0;
    border-radius: 0;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.12);
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .toc .eyebrow {
    display: none;
  }

  .toc a {
    flex: 0 0 auto;
    min-height: 44px;
    max-width: calc(92vw - 20px);
    padding: 10px 12px;
    overflow: hidden;
    border-radius: 9px;
    background: var(--panel-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .toc a.active {
    background: #e8efff;
    box-shadow: inset 0 0 0 1px #bed0f4;
  }

  .timeline::before {
    left: 38px;
  }

  .timeline-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .timeline-year {
    max-width: 72px;
    padding-inline: 6px;
    font-size: 0.7rem;
  }

  .process-heading,
  .process-detail {
    grid-template-columns: 1fr;
  }

  .process-heading {
    display: grid;
  }

  .visual-toggle {
    width: max-content;
  }

  .process-track {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .process-node {
    grid-template-columns: 52px minmax(0, auto);
    grid-template-rows: auto auto;
    justify-content: start;
    justify-items: start;
    min-height: 82px;
    padding: 12px 15px;
    text-align: left;
  }

  .process-icon {
    grid-row: 1 / 3;
    align-self: center;
    margin-right: 11px;
  }

  .process-node strong {
    align-self: end;
  }

  .process-node > span:last-child {
    align-self: start;
  }

  .process-step:not(:last-child)::after {
    top: calc(100% - 3px);
    left: 50%;
    width: 2px;
    height: 30px;
    transform: translateX(-50%);
  }

  .process-step.is-active:not(:last-child)::before {
    top: calc(100% - 7px);
    left: calc(50% - 4px);
    animation-name: flow-particle-y;
  }

  .process-controls {
    grid-template-columns: 1fr 1fr;
  }

  .process-progress {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .process-controls .button {
    text-align: center;
  }
}

@media (max-width: 460px) {
  body {
    line-height: 1.66;
  }

  .content > h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.35rem);
  }

  .hero-sub {
    font-size: 1rem;
  }

  .learning-dashboard {
    padding: 16px;
  }

  .dashboard-stats {
    gap: 7px;
  }

  .dashboard-stats > div {
    padding: 10px 8px;
  }

  .dashboard-stats strong {
    font-size: 1.1rem;
  }

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

  .search-control {
    grid-template-columns: 1fr;
  }

  .resume-reading {
    flex-wrap: wrap;
  }

  .resume-reading > span {
    flex-basis: calc(100% - 46px);
  }

  .resume-reading .button {
    flex: 1;
    order: 3;
    text-align: center;
  }

  .section-nav a {
    min-height: 40px;
    padding: 9px 11px;
  }

  .lab-note-actions {
    display: grid;
  }

  .archive-actions {
    display: grid;
  }

  .archive-actions .button {
    width: 100%;
    text-align: center;
  }

  .review-page {
    padding-top: 30px;
  }

  .review-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .review-toolbar .button {
    text-align: center;
  }

  .certificate-controls {
    grid-template-columns: 1fr;
  }

  .certificate-controls .button {
    text-align: center;
  }

  .certificate-card {
    min-height: 0;
    padding: 34px 24px;
    border-radius: 16px;
    box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 7px #d5e0f0, var(--shadow);
  }

  .certificate-metrics {
    grid-template-columns: 1fr;
  }

  .certificate-metrics > div + div {
    border-top: 1px solid #d8e1ef;
    border-left: 0;
  }

  .certificate-footer-line {
    align-items: center;
    flex-direction: column;
    gap: 5px;
  }

  .content h2,
  .section-heading {
    margin-top: 34px;
  }

  .section-heading h2 {
    margin-top: 4px;
  }

  .timeline::before {
    left: 7px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 22px;
  }

  .timeline-year {
    margin: 0 0 7px;
  }

  .timeline-year::before {
    position: absolute;
    top: 50%;
    left: -20px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
    transform: translateY(-50%);
  }

  .history-track {
    padding: 12px;
  }

  .history-track .timeline::before {
    left: 7px;
  }

  .history-track .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 18px;
  }

  .history-track .timeline-content {
    padding: 14px;
  }

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

  .project-card {
    padding: 14px;
  }

  .chapter-reward {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }

  .reward-burst {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.5rem;
  }

  .table-scroll.responsive-cards {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .keyword-table,
  .infra-matrix {
    min-width: 0;
    border-collapse: separate;
  }

  .keyword-table thead,
  .infra-matrix thead {
    display: none;
  }

  .keyword-table tbody,
  .infra-matrix tbody {
    display: grid;
    gap: 12px;
  }

  .keyword-table tr,
  .infra-matrix tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: 0 6px 18px rgba(23, 32, 51, 0.05);
  }

  .keyword-table th,
  .keyword-table td,
  .infra-matrix th,
  .infra-matrix td {
    display: grid;
    grid-template-columns: minmax(102px, 0.4fr) minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
  }

  .keyword-table th::before,
  .keyword-table td::before,
  .infra-matrix th::before,
  .infra-matrix td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    content: attr(data-label);
  }

  .keyword-table tr > :last-child,
  .infra-matrix tr > :last-child {
    border-bottom: 0;
  }

  .keyword-table tbody th,
  .infra-matrix tbody th {
    min-width: 0;
    background: #f4f7ff;
  }

  .analogy-illustration {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    align-items: stretch;
    flex-direction: column;
  }

  .nav .button {
    text-align: center;
  }
}

@media (max-width: 340px) {
  .keyword-table th,
  .keyword-table td,
  .infra-matrix th,
  .infra-matrix td {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .keyword-table th::before,
  .keyword-table td::before,
  .infra-matrix th::before,
  .infra-matrix td::before {
    font-size: 0.64rem;
    letter-spacing: 0;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body[data-page-kind="certificate"] {
    background: #fff;
  }

  body[data-page-kind="certificate"] .top,
  body[data-page-kind="certificate"] footer,
  body[data-page-kind="certificate"] .certificate-hero,
  body[data-page-kind="certificate"] .certificate-controls,
  body[data-page-kind="certificate"] .certificate-disclaimer {
    display: none !important;
  }

  body[data-page-kind="certificate"] .certificate-page {
    width: 100%;
    padding: 0;
  }

  body[data-page-kind="certificate"] .certificate-card {
    width: 297mm;
    max-width: none;
    min-height: 210mm;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: inset 0 0 0 9mm #fff, inset 0 0 0 9.6mm #d5e0f0;
    print-color-adjust: exact;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
