.learning-guides {
  --learn-ink: #17243d;
  --learn-muted: #51607a;
  --learn-line: #dce3ed;
  --learn-accent: #2840ab;
  --learn-panel: #f6f8fe;
  width: min(100%, 1112px);
  margin-inline: auto;
  color: var(--learn-ink);
  line-height: 1.65;
}

.learning-guides :where(p, figure, dl, dd, ul, ol) { margin: 0; }

.learning-guides .learn-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.10fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(24px, 5vw, 66px);
  padding: clamp(26px, 5vw, 64px);
  border-radius: 26px;
  background: #172441;
  color: #e5ebf8;
}

.learn-hero-copy { min-width: 0; }
.learning-guides .learn-hero-label {
  margin-bottom: 12px;
  color: #dcefa1;
  font-size: .85rem;
  font-weight: 700;
}

.learning-guides .learn-hero h1 {
  max-width: 13ch;
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.learning-guides .learn-hero-copy > p:last-of-type {
  max-width: 48ch;
  margin-bottom: 22px;
  color: #e5ebf8;
  font-size: clamp(.98rem, 1.5vw, 1.09rem);
}

.learning-guides .learn-hero-button {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  padding: .62rem 1rem;
  border-radius: 10px;
  background: #e5f79a;
  color: #15213a;
  font-weight: 750;
  text-decoration: none;
}

.learning-guides .learn-hero-button:hover { background: #f0ffc5; color: #15213a; }

.learn-hero-figure, .learn-figure {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--learn-line);
  border-radius: 16px;
  background: var(--learn-panel);
}

.learn-hero-figure img, .learn-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.learn-hero-figure figcaption, .learn-figure figcaption {
  padding: .72rem 1rem;
  border-top: 1px solid var(--learn-line);
  color: var(--learn-muted);
  font-size: .85rem;
  line-height: 1.45;
}

.learn-hero-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem .8rem;
  background: #fff;
}

.learning-guides .learn-hero-figure a, .learning-guides .learn-next-links a,
.learning-guides .learn-footer a {
  color: var(--learn-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.learning-guides .learn-hero :focus-visible { outline-color: #b9ceff; }

.learn-topics { margin: clamp(28px, 5vw, 56px) 0; }
.learn-topics, .learn-lesson { scroll-margin-top: 6rem; }

.learning-guides .learn-topics h2, .learning-guides .learn-lesson h2 {
  margin: 0;
  color: var(--learn-ink);
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  line-height: 1.18;
  letter-spacing: -.042em;
}

.learn-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin-top: 16px;
  list-style: none;
}

.learning-guides .learn-topic {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  height: 100%;
  min-height: 78px;
  margin: 0;
  padding: .88rem;
  border: 1px solid var(--learn-line);
  border-radius: 14px;
  background: #fff;
  color: var(--learn-ink);
  text-decoration: none;
}

.learning-guides .learn-topic:hover {
  border-color: #8798d8;
  background: #fcfcff;
  color: var(--learn-accent);
}

.learn-topic-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 10px;
  font: 700 1.21rem/1 "Courier Prime", ui-monospace, monospace;
}

.learn-blue { background: #e8edff; color: #2840ab; }
.learn-mint { background: #e0f2e9; color: #155b45; }
.learn-purple { background: #eee7fa; color: #64368c; }

.learn-topic-copy { display: grid; gap: .17rem; line-height: 1.38; }
.learn-topic-copy strong { font-size: .99rem; }
.learn-topic-copy > span { color: var(--learn-muted); font-size: .85rem; }
.learn-topic-arrow { color: var(--learn-accent); line-height: 1.35; }

.learn-lesson-list { display: grid; gap: clamp(14px, 2.8vw, 28px); }

.learn-lesson {
  min-width: 0;
  padding: clamp(18px, 4.5vw, 48px);
  border: 1px solid var(--learn-line);
  border-radius: 22px;
  background: #fff;
}

.learn-lesson:target { border-color: #8192d4; }
.learn-lesson-heading { display: flex; align-items: center; gap: 12px; }

.learning-guides .learn-deck {
  max-width: 70ch;
  margin: .75rem 0 1.4rem;
  color: var(--learn-muted);
  font-size: 1rem;
}

.learn-example {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, .9fr);
  align-items: start;
  gap: clamp(16px, 4vw, 42px);
}

.learning-guides .learn-lesson h3, .learn-table caption {
  margin: 0 0 .55rem;
  color: var(--learn-ink);
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: -.018em;
  font-weight: 750;
}

.learn-steps {
  display: grid;
  gap: .55rem;
  margin-top: .75rem;
  padding-inline-start: 1.4rem;
}

.learn-steps li { padding-inline-start: .19rem; }
.learn-steps li::marker { color: var(--learn-accent); font-weight: 750; }

.learning-guides code {
  color: #293b83;
  font-size: .93em;
  overflow-wrap: anywhere;
}

.learn-reference {
  min-width: 0;
  padding: clamp(12px, 2.5vw, 23px);
  border: 1px solid var(--learn-line);
  border-radius: 16px;
  background: var(--learn-panel);
}

.learn-reference > p { color: var(--learn-muted); font-size: .9rem; }
.learn-reference .learn-equation { margin-bottom: .62rem; font-size: clamp(1rem, 2vw, 1.36rem); font-weight: 750; }

.learn-table { width: 100%; margin-bottom: .75rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.learn-table caption { padding: 0; caption-side: top; text-align: start; }
.learn-table th, .learn-table td { padding: .42rem .2rem; border-bottom: 1px solid var(--learn-line); text-align: center; font-size: .85rem; }
.learn-table th:first-child { padding-inline-start: 0; text-align: start; }

.learn-counts { margin-bottom: .65rem; }
.learn-counts div { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--learn-line); }
.learn-counts dd { font-weight: 750; }

.learn-exercise {
  max-width: 78ch;
  margin-top: 1.5rem;
  padding: clamp(12px, 2.5vw, 25px);
  border: 1px solid #dbe4e0;
  border-radius: 15px;
  background: #f6faf8;
}

.learn-exercise details { border-top: 1px solid #dbe4e0; }
.learn-exercise details:first-of-type { margin-top: .75rem; }

.learn-exercise summary {
  min-height: 44px;
  padding: .55rem .1rem;
  color: var(--learn-accent);
  cursor: pointer;
  font-weight: 700;
}

.learn-exercise details[open] p { margin: 0 0 .7rem; padding-inline: .1rem; }

.learn-next { display: grid; gap: .6rem; margin-top: 1.35rem; }
.learning-guides .learn-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 30rem;
  padding: .87rem 1rem;
  border: 1px solid #d8def2;
  border-radius: 12px;
  background: #edf0fe;
  color: #213584;
  text-decoration: none;
}

.learning-guides .learn-pick:hover { border-color: #899adc; background: #e5ebff; }
.learn-pick span > * { display: block; }
.learn-pick-label, .learn-pick-meta { font-size: .82rem; }
.learn-pick strong { line-height: 1.35; }
.learn-next-links, .learn-footer { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; }
.learn-next-links a, .learn-footer a { display: inline-flex; align-items: center; gap: .32em; min-height: 44px; }
.learn-footer { align-items: center; justify-content: space-between; margin-top: 1.25rem; }

@media (max-width: 900px) {
  .learn-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .learning-guides .learn-hero, .learn-example { grid-template-columns: minmax(0, 1fr); }
  .learning-guides .learn-hero h1 { max-width: 17ch; }
  .learn-hero-figure, .learn-figure { width: min(100%, 520px); }
}

@media (max-width: 480px) {
  .learning-guides .learn-hero { padding: 18px; border-radius: 16px; }
  .learn-topic-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .learning-guides .learn-topic { min-height: 62px; padding: .65rem; }
  .learn-lesson { padding: 15px; border-radius: 16px; }
  .learn-lesson-heading { align-items: flex-start; }
  .learn-lesson-heading .learn-topic-icon { width: 2rem; height: 2rem; font-size: 1rem; }
}
