@font-face {
  font-family: Inter;
  src: url("assets/inter-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("assets/inter-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #526174;
  --blue: #0066cc;
  --paper: #ffffff;
  --wash: #f1f6fc;
  --line: #dce5ef;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 Inter, Arial, sans-serif;
  font-synthesis: none;
}
a { color: var(--blue); text-underline-offset: 5px; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 2px; }
main, .masthead, footer { width: min(1180px, calc(100% - 96px)); margin-inline: auto; }
h1, h2 { font-weight: 500; letter-spacing: -.045em; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 29px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 25px; font-weight: 500; letter-spacing: -.04em; text-decoration: none; color: var(--ink); }
.brand img { display: block; }
.masthead nav { display: flex; align-items: center; gap: 30px; }
.masthead nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--blue); }
.introduction { padding: 82px 0 48px; }
.byline { display: inline-block; margin-bottom: 26px; font-size: 15px; text-decoration: none; }
h1 { font-size: clamp(42px, 5.8vw, 74px); line-height: 1.12; margin: 0; }
.introduction-bottom { display: grid; grid-template-columns: 1.35fr 1fr; gap: 80px; margin-top: 30px; }
.lead { max-width: 630px; font-size: 22px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.intro-note { font-size: 15px; color: var(--muted); margin: 0; }
.introduction-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; padding-top: 4px; }
.start { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 13px 22px; background: var(--blue); color: white; text-decoration: none; border-radius: 5px; font-size: 15px; font-weight: 500; }
.start:hover { background: #0056ae; text-decoration: none; }
.setup { font-size: 14px; text-decoration: none; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 82px; }
.previews > a { display: block; min-width: 0; text-decoration: none; }
.preview-image { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--wash); }
.previews img { display: block; width: 100%; height: auto; }
.previews span { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 16px; font-size: 19px; font-weight: 500; color: var(--ink); letter-spacing: -.025em; }
.previews small { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.previews a:hover span { color: var(--blue); }
.catalog { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 65px; margin-bottom: 90px; }
.catalog > nav { align-self: start; position: sticky; top: 28px; }
.catalog > nav h2 { font-size: 15px; font-weight: 500; letter-spacing: -.015em; margin: 0 0 18px; }
.catalog > nav a { display: block; padding: 7px 0; color: var(--muted); font-size: 14px; text-decoration: none; }
.catalog > nav a:hover { color: var(--blue); text-decoration: underline; }
.topic { margin-bottom: 48px; scroll-margin-top: 28px; }
.topic:last-child { margin-bottom: 0; }
.topic h2 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; }
.topic header p { max-width: 650px; font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.topic ul { list-style: none; padding: 0; margin: 0; }
.topic li { padding: 0; border-top: 1px solid var(--line); }
.notebook-title { display: block; padding: 17px 0; font-size: 16px; font-weight: 500; color: var(--blue); text-decoration: none; }
.notebook-title:hover, .notebook-title:focus-visible { text-decoration: underline; background: var(--wash); }
footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border-top: 1px solid var(--line); padding-block: 28px 35px; color: var(--muted); font-size: 12px; }
footer a { text-decoration: none; }
footer p { margin: 9px 0 0; }
footer p a { color: var(--muted); }
.footer-brand { color: var(--ink); font-size: 17px; font-weight: 500; letter-spacing: -.025em; }
.skip { position: absolute; top: 8px; left: 16px; background: white; padding: 10px; z-index: 1; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }

@media (max-width: 900px) {
  main, .masthead, footer { width: calc(100% - 56px); }
  .introduction { padding-top: 54px; }
  .introduction-bottom { gap: 35px; }
  .lead { font-size: 20px; }
  .catalog { grid-template-columns: 180px minmax(0, 1fr); gap: 35px; }
  .previews span { flex-direction: column; gap: 3px; }
}

@media (max-width: 650px) {
  main, .masthead, footer { width: calc(100% - 40px); }
  .masthead { padding-block: 22px; gap: 18px; }
  .brand { font-size: 22px; gap: 8px; }
  .brand img { width: 27px; height: 27px; }
  .masthead nav { gap: 16px; }
  .masthead nav a { font-size: 12px; }
  .masthead nav a:nth-child(2) { display: none; }
  .introduction { padding: 46px 0 32px; }
  .byline { font-size: 13px; margin-bottom: 22px; }
  h1 { font-size: clamp(38px, 9vw, 54px); }
  .introduction-bottom { grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
  .lead { font-size: 19px; }
  .intro-note { font-size: 14px; }
  .previews { grid-template-columns: 1fr; gap: 28px; margin-bottom: 52px; }
  .previews span { flex-direction: row; font-size: 18px; }
  .catalog { grid-template-columns: 1fr; gap: 32px; margin-bottom: 55px; }
  .catalog > nav { position: static; display: flex; flex-wrap: wrap; gap: 2px 20px; }
  .catalog > nav h2 { width: 100%; margin-bottom: 9px; }
  .catalog > nav a { min-height: 36px; }
  .topic { margin-bottom: 36px; }
  .topic h2 { font-size: 27px; }
  .topic header p { font-size: 14px; }
  .notebook-title { font-size: 15px; }
  footer { flex-direction: column; gap: 20px; }
}

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