@font-face {
  font-family: 'Patrick Hand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/patrick-hand-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Patrick Hand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/patrick-hand-latin-ext-400-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-latin-ext-700-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --paper: #fcf8ef;
  --paper-raised: #fffaf2;
  --paper-perforation: url('../paper-perforation.svg');
  --ink: #122b62;
  --ink-soft: #485a76;
  --blue: #0561ef;
  --blue-dark: #0349b7;
  --blue-wash: #cfe7ff;
  --yellow: #ffe776;
  --rule: #8ca9c21d;
  --margin-rule: #dd7a7a80;
  --edge: #d6cdbf;
  --shadow: 0 3px 4px #42321b16, 0 9px 22px #42321b07;
  --shadow-header: 0 3px 9px #40311d1c;
  --shadow-sheet:
    0 2px 5px -2px #4a37201f, 4px 12px 22px -8px #4a37203b, 10px 25px 42px -18px #4a37202e;
  --diagram-fill: #edf5fb;
  --sketch-fill: #72b4ee;
  --carry-ink: #ad4b13;
  --success: #246641;
  --error: #a33829;
  --font-title: 'Caveat', 'Segoe Print', cursive;
  --font-body: 'Patrick Hand', 'Segoe Print', cursive;
  --font-ui: var(--font-body);
  --space-1: 0.35rem;
  --space-2: 0.75rem;
  --space-3: 1.2rem;
  --space-4: 1.8rem;
  --space-5: 2.7rem;
  --space-6: 4rem;
  --radius: 18px;
  --reading-width: 810px;
  --page-width: 1440px;
  --header-height: 72px;
  --nav-marker-duration: 520ms;
  --line-height: 1.55;
}
[data-theme='dark'] {
  color-scheme: dark;
  --paper: #181f2c;
  --paper-raised: #202a3a;
  --paper-perforation: url('../paper-perforation-dark.svg');
  --ink: #e0eaff;
  --ink-soft: #b8c9e0;
  --blue: #8abaff;
  --blue-dark: #1b51aa;
  --blue-wash: #284265;
  --yellow: #65571f;
  --rule: #a3c2e112;
  --margin-rule: #df8a8a55;
  --edge: #42506a;
  --diagram-fill: #24374c;
  --sketch-fill: #5d91c9;
  --carry-ink: #ffb782;
  --success: #97ddb0;
  --error: #ffb1a1;
  --shadow: 0 4px 12px #0003;
  --shadow-header: 0 3px 12px #0004;
  --shadow-sheet: 0 2px 5px -2px #0003, 4px 14px 24px -9px #0008, 10px 26px 42px -18px #0007;
}
/* Breakpoints centralizados em responsive.css: 1120 px (cabeçalho compacto),
   760 px (mobile), 420/360 px (celulares estreitos); ajustes intermediários
   em 1000/1350 px e limite de conteúdo em 1660 px. */

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 22px/var(--line-height) var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) {
  overflow: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button,
a,
input,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
  border-radius: 4px;
}
::selection {
  background: var(--blue-wash);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
img,
svg {
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 4.2vw, 4.2rem);
}
h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.55rem);
}
h3 {
  font-size: 1.65rem;
}
h4 {
  font-size: 1.5rem;
}
p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.icon {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  vertical-align: middle;
}
.flip {
  transform: rotate(180deg);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 10px;
  z-index: 100;
  transform: translateY(-200%);
  background: var(--paper-raised);
  padding: 10px 20px;
  border: 2px solid var(--blue);
}
.skip-link:focus {
  transform: none;
}
.small-note,
.availability-note {
  color: var(--ink-soft);
  font-size: 19px;
}
.availability-note {
  margin-top: 1.4rem;
  max-width: 850px;
}
.eyebrow {
  font-size: 20px;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.underline {
  position: relative;
  display: inline-block;
  padding-bottom: 13px;
}
.underline::after {
  content: '';
  position: absolute;
  inset: auto 0 2px;
  height: 7px;
  border-top: 4px solid #e9c331;
  border-radius: 50%;
  transform: rotate(-1deg);
}
.highlight {
  position: relative;
  isolation: isolate;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.15em;
}
.highlight::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 23% -0.09em 1%;
  border-radius: 25% 7% 18% 5% / 24% 28% 20% 24%;
  transform: rotate(-1deg);
  background: var(--yellow);
  box-shadow:
    5px -4px 0 -1px var(--yellow),
    -4px 3px 0 -1px var(--yellow);
}
.highlight--blue::before {
  background: var(--blue-wash);
  box-shadow:
    5px -4px 0 -1px var(--blue-wash),
    -4px 3px 0 -1px var(--blue-wash);
}
.hand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-family: var(--font-title);
  font-size: 1.55rem;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.hand-link:hover {
  text-decoration-thickness: 2px;
}
.paper-card {
  background: linear-gradient(115deg, transparent, #dac6a508), var(--paper-raised);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
a.paper-card {
  transition:
    transform 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
a.paper-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 5px 14px #12326517;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 25px;
  border: 1.5px solid #0757d2;
  border-radius: 16px;
  background: linear-gradient(#0969f7, #0347b6);
  box-shadow: 0 3px 0 #082c5e19;
  color: #fff;
  font: 700 1.7rem/1.2 var(--font-title);
  text-align: center;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #082c5e14;
}
.button--paper {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--blue);
}
.button--small {
  font-size: 1.4rem;
  padding: 10px 20px;
  min-height: 48px;
}
.text-button {
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: 21px;
  color: var(--blue);
  padding: 4px 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.geometry {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: auto;
  color: var(--ink);
  overflow: visible;
}
.geometry text {
  fill: currentColor;
  font: 700 25px var(--font-title);
}
.geometry text[data-carry] {
  fill: var(--carry-ink);
}
.geometry-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.geometry-dash {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.7;
  stroke-dasharray: 7 6;
}
.geometry-accent {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
}
.angle-fill {
  fill: var(--yellow);
  stroke: #d1ad18;
  stroke-width: 1;
}
.geometry--compact {
  max-width: 150px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper-raised);
  box-shadow: var(--shadow-header);
  border-bottom: 1px solid var(--edge);
}
.header-inner {
  max-width: 1660px;
  margin: auto;
  padding: 10px 3.2%;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
  font: 700 2.6rem/1 var(--font-title);
  white-space: nowrap;
}
.brand > .icon {
  width: 50px;
  height: 45px;
  color: var(--blue);
}
.brand > span {
  position: relative;
  padding-bottom: 7px;
}
.brand > span::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 72%;
  border-top: 3px solid var(--blue);
  border-radius: 50%;
  height: 5px;
  transform: rotate(-3deg);
}
.brand > span > span {
  color: var(--blue);
}
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border-left: 1px solid var(--edge);
  padding-left: 30px;
  flex: 1;
}
.desktop-nav > a {
  font: 700 1.55rem var(--font-title);
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  isolation: isolate;
}
.desktop-nav > a > .icon {
  width: 17px;
  height: 17px;
}
.desktop-nav > a[aria-current]::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 5px -6px;
  background: var(--blue-wash);
  border-radius: 20% 10% 20% 8%;
  transform: rotate(-3deg);
  animation: nav-marker-sweep var(--nav-marker-duration) cubic-bezier(0.22, 0.65, 0.35, 1) both;
}
.desktop-nav > a[aria-current]::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 5px;
  right: 5px;
  border-top: 2px solid var(--blue);
  transform: rotate(-3deg);
  animation: nav-marker-sweep 360ms ease-out 140ms both;
}
@keyframes nav-marker-sweep {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.desktop-nav > a:hover {
  color: var(--blue);
}
.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.search-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  border: 1.5px solid #6086b7;
  border-radius: 15px;
  min-height: 44px;
  background: transparent;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.search-trigger .icon {
  color: var(--ink);
}
.search-trigger kbd {
  border: 1px solid var(--edge);
  border-radius: 4px;
  font: 15px sans-serif;
  padding: 0 4px;
  color: var(--ink-soft);
  margin-left: 10px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 12px;
  width: 45px;
  height: 45px;
  background: var(--paper-raised);
  box-shadow: 0 2px 3px #0000000c;
}
.mobile-toggle {
  display: none;
}
.mobile-menu {
  border-top: 1px solid var(--edge);
  padding: 12px 25px 20px;
  background: var(--paper-raised);
}
.mobile-menu > a,
.mobile-menu > button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--edge);
  background: none;
  padding: 7px 5px;
  text-align: left;
}
.mobile-menu > [aria-current] {
  color: var(--blue);
}
.notebook {
  position: relative;
  isolation: isolate;
  max-width: 1660px;
  min-height: calc(100vh - 210px);
  margin: 0 auto;
  padding: 26px 5.6% 60px 7%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    var(--rule) 31px,
    var(--rule) 32px
  );
}
.notebook::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 4.7%;
  width: 1px;
  background: var(--margin-rule);
  z-index: -1;
}
.notebook::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 34px;
  background-image: var(--paper-perforation);
  background-size: 34px 56px;
  background-repeat: repeat-y;
  pointer-events: none;
  z-index: -1;
}
.site-footer {
  max-width: 1440px;
  padding: 24px 5%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-soft);
  font-size: 18px;
  border-top: 1px solid var(--edge);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  font-size: 18px;
}
.footer-preferences {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.footer-preferences:hover {
  color: var(--blue);
  text-decoration: underline;
}
.site-footer > a:first-child {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--ink);
}
.site-footer > a:hover {
  color: var(--blue);
}
.breadcrumbs {
  font-size: 19px;
  margin-bottom: 30px;
  color: var(--ink-soft);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.breadcrumbs .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}
.breadcrumbs li > .icon {
  width: 13px;
}
.breadcrumbs a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.page-heading {
  margin: 32px 0 45px;
}
.page-heading > p {
  max-width: 730px;
  margin: 16px 0 0;
  font-size: 24px;
}
.subject-heading,
.lesson-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid var(--edge);
  padding-bottom: 30px;
}
.subject-heading > div:first-child,
.lesson-heading > div:first-child {
  max-width: 810px;
}
.subject-heading p,
.lesson-heading p {
  margin: 12px 0 0 108px;
  font-size: 23px;
  max-width: 650px;
}
.title-with-icon {
  display: flex;
  align-items: center;
  gap: 23px;
}
.heading-sketch {
  display: inline-grid;
  place-items: center;
  width: 85px;
  height: 85px;
  background: var(--blue-wash);
  border-radius: 35% 25% 30% 23%;
  transform: rotate(-4deg);
  flex-shrink: 0;
}
.heading-sketch .geometry {
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  transform: rotate(4deg);
}
.heading-illustration {
  width: 210px;
  flex-shrink: 0;
  padding-right: 5px;
}
.lesson-list {
  display: grid;
  gap: 16px;
}
.subject-lessons {
  margin: 25px 0 45px;
}
.study-column {
  max-width: var(--reading-width);
  margin: 0 auto 40px;
}
.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  max-width: 850px;
  margin: auto;
}
.heading-sketch > .icon {
  width: 70%;
  height: 70%;
  transform: rotate(4deg);
}
.heading-illustration > .icon {
  width: 160px;
  height: 160px;
}

.notebook--home {
  padding-top: 40px;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 65px;
  padding: 12px 0 55px;
}
.hero-copy h1 {
  font-size: clamp(2.8rem, 4.15vw, 4.5rem);
  line-height: 1.16;
  position: relative;
  letter-spacing: -0.6px;
  max-width: 830px;
}
.hero-copy h1 .highlight {
  white-space: nowrap;
}
.hero-intro {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.1vw, 2.2rem);
  line-height: 1.35;
  margin: 23px 0 30px;
  max-width: 700px;
  position: relative;
}
.hero-intro::after {
  content: '';
  display: block;
  width: 60%;
  height: 10px;
  border-top: 3px solid #81b5f1;
  border-radius: 50%;
  transform: rotate(-1deg);
  margin-top: 9px;
}
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 24px 0 0;
}
.hero-buttons .button {
  flex: 1;
  white-space: nowrap;
}
.home-hero .hero-buttons .button {
  flex: 0 1 auto;
  min-width: min(100%, 310px);
}
.hero-sheet {
  position: relative;
  transform: rotate(-4deg);
  padding: 27px 25px 20px 52px;
  border: 0;
  border-radius: 6px 16px 18px 12px;
  background:
    repeating-linear-gradient(transparent 0, transparent 30px, var(--rule) 30px, var(--rule) 31px),
    var(--paper-raised);
  box-shadow: var(--shadow-sheet);
  margin: 0 6px 0 0;
}
.hero-sheet::before {
  content: '';
  position: absolute;
  left: 34px;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--margin-rule);
}
.hero-sheet::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 10px;
  width: 28px;
  background-image: var(--paper-perforation);
  background-size: 28px 47px;
  background-repeat: repeat-y;
  pointer-events: none;
}
.hero-sheet h2 {
  font-size: 2.25rem;
  margin: 0 0 22px;
  text-align: center;
}
.hero-sheet h2::after {
  content: '';
  display: block;
  width: 88%;
  margin: 6px auto;
  border-top: 3px solid #e7c628;
  transform: rotate(-1deg);
}
.hero-sheet > p {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.7rem;
  margin: 12px 0;
}
.sheet-equation {
  border: 2px solid #337ed4;
  border-radius: 15px;
  padding: 10px 5px;
  text-align: center;
  margin: 7px 0 22px;
  font-size: 19px;
}
.sheet-formula {
  background: var(--yellow);
  border-radius: 22px 30px 20px 17px;
  padding: 1px 5px;
  font-size: 23px;
}
.sheet-formula .katex-display {
  margin: 12px 0;
}
.hero-sheet > p.sheet-condition {
  font: 17px var(--font-body);
  color: var(--ink-soft);
  margin: 13px 0 0;
  text-align: center;
}
.paperclip {
  position: absolute;
  right: 30px;
  top: -26px;
  width: 22px;
  height: 65px;
  border: 2px solid #8b8578;
  border-radius: 13px;
  box-shadow:
    inset 0 0 0 2px #fff7,
    1px 1px 1px #0002;
  transform: rotate(23deg);
}
.doodle-spark {
  position: absolute;
  right: 2%;
  top: -22px;
  width: 35px;
  height: 30px;
  background: linear-gradient(110deg, transparent 42%, #edc42b 43% 51%, transparent 52%);
}
.doodle-spark::before,
.doodle-spark::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 23px;
  border-radius: 6px;
  background: #edc42b;
  right: -10px;
  bottom: -6px;
  transform: rotate(48deg);
}
.doodle-spark::after {
  right: -25px;
  bottom: -18px;
  transform: rotate(75deg);
  height: 19px;
}
.explore {
  padding: 14px 0 10px;
}
.home-about {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--edge);
}
.home-about-intro {
  max-width: var(--reading-width);
  margin: var(--space-4) 0;
}
.home-about-topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.home-about-topic h3 {
  margin-bottom: var(--space-2);
}
.home-about-topic p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 20px;
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
}
.subject-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 15px 19px;
}
.subject-symbol {
  display: grid;
  place-items: center;
  background: var(--blue-wash);
  border-radius: 25% 16% 30% 14%;
  width: 53px;
  height: 48px;
  transform: rotate(-3deg);
  flex-shrink: 0;
}
.subject-symbol .icon {
  width: 37px;
  height: 37px;
  transform: rotate(3deg);
}
.subject-card > .icon {
  margin-left: auto;
  width: 22px;
}
.subject-card-text {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.subject-name {
  display: block;
  font: 700 1.8rem/1.05 var(--font-title);
}
.subject-status {
  display: block;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.1;
  margin-top: 6px;
}
.subject-card--planned .subject-symbol {
  opacity: 0.75;
}
.planned-dot {
  color: var(--ink-soft);
  font-size: 27px;
}
.subject-grid--index {
  margin: 30px 0;
}
.lesson-card {
  display: flex;
  align-items: center;
  gap: 23px;
  padding: 22px 25px;
  min-height: 112px;
}
.lesson-number {
  font: 700 2.2rem var(--font-title);
  padding: 0 13px;
  background: var(--blue-wash);
  border-radius: 10px;
  flex-shrink: 0;
}
.lesson-card-copy {
  flex: 1;
}
.lesson-card-copy h3 {
  font-size: 1.9rem;
  margin-bottom: 5px;
}
.lesson-card-copy p {
  font-size: 20px;
  margin: 0;
  line-height: 1.3;
}
.lesson-card-sketch {
  width: 130px;
  flex-shrink: 0;
}
.lesson-sketch {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}
.lesson-sketch text {
  fill: currentColor;
  stroke: none;
  font: 700 30px var(--font-title);
}
.lesson-sketch .lesson-sketch-label {
  font-size: 24px;
}
.circle-arrow {
  width: 35px;
  height: 35px;
  border: 1px solid #8eb7e6;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--blue);
}

.lesson-layout {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.lesson-toc {
  position: sticky;
  top: calc(var(--header-height) + 22px);
}
.lesson-toc details {
  background: var(--paper-raised);
  border: 1px solid var(--edge);
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
.lesson-toc summary {
  display: none;
}
.lesson-toc details:not([open]) > nav {
  display: block;
}
.toc-title {
  font: 700 1.8rem var(--font-title);
  margin-bottom: 20px;
}
.toc-scroll-wrap {
  position: relative;
}
.toc-scroll {
  max-height: calc(100svh - var(--header-height) - 150px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding-bottom: 30px;
}
.toc-scroll::-webkit-scrollbar {
  display: none;
}
.toc-scroll:focus-visible {
  outline-offset: -3px;
}
.toc-more {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  place-items: center;
  height: 32px;
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: linear-gradient(to top, var(--paper-raised) 65%, transparent);
}
.toc-more .icon {
  width: 18px;
  height: 18px;
  opacity: 0.65;
}
.toc-more:hover,
.toc-more:focus-visible {
  color: var(--blue);
}
.lesson-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lesson-toc li {
  position: relative;
}
.lesson-toc li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 20px;
  bottom: -15px;
  border-left: 1px solid #a2bddc;
}
.lesson-toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 18px;
  line-height: 1.3;
  padding: 8px 0;
  position: relative;
}
.lesson-toc a:hover,
.lesson-toc a[aria-current] {
  color: var(--blue);
}
.toc-dot {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1px solid var(--blue);
  border-radius: 50%;
  background: var(--paper-raised);
}
.lesson-toc a[aria-current] .toc-dot {
  background: var(--blue);
}
.lesson-content {
  min-width: 0;
  max-width: var(--reading-width);
  margin: auto;
}
.lesson-section {
  padding: 0 0 32px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--edge);
  scroll-margin-top: calc(var(--header-height) + 22px);
}
.lesson-section > h2 {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin-bottom: 24px;
  font-size: 2.15rem;
}
.section-number {
  display: inline-grid;
  place-items: center;
  min-width: 35px;
  height: 35px;
  border-radius: 50% 40% 50% 46%;
  background: #f4d349;
  color: #15315a;
  font: 700 1.7rem var(--font-title);
  transform: rotate(-6deg);
}
.lesson-section > p {
  margin-bottom: 20px;
}
.lesson-figure {
  margin: 26px auto 30px;
  text-align: center;
  max-width: 460px;
}
.lesson-figure .geometry {
  max-width: 315px;
}
.lesson-figure figcaption {
  font-size: 18px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.4;
}
.subheading {
  font-size: 1.7rem;
  margin: 29px 0 16px;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin: 22px 0 27px;
}
.comparison-item {
  padding: 15px 12px;
  text-align: center;
  min-width: 0;
}
.comparison-item h4 {
  font-size: 1.55rem;
}
.comparison-item .geometry {
  width: 140px;
  margin: 13px auto 5px;
}
.comparison-item p {
  font-size: 18px;
  line-height: 1.35;
  margin: 0;
}
.content-list {
  padding-left: 25px;
  margin: 18px 0 24px;
}
.content-list li {
  margin-bottom: 14px;
  padding-left: 4px;
}
.content-list li::marker {
  color: var(--blue);
}
.content-note {
  border-left: 3px solid #97bfe9;
  padding: 5px 0 5px 20px;
  margin: 27px 0;
}
.content-note h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.content-note p {
  margin: 0;
  font-size: 20px;
}
.formula-block {
  margin: 24px 0 27px;
  text-align: center;
}
.math-scroll {
  container-type: inline-size;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 12px 8px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.math-layout--wide {
  display: none;
}
.math-scroll .katex-display {
  margin: 6px 0;
  font-size: 1.1em;
}
.formula-condition {
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 8px auto 0;
  max-width: 650px;
}
.katex {
  font-size: 1em;
}
.worked-example {
  margin: 32px 0;
}
.worked-example > h3 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 18px;
}
.worked-example > p {
  margin-bottom: 20px;
}
.example-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 22px;
  align-items: center;
}
.example-layout--text {
  display: block;
}
.example-layout--text .example-resolution {
  border-radius: 4px 16px 8px 6px;
}
.example-resolution {
  background: color-mix(in srgb, var(--blue-wash) 47%, transparent);
  border-radius: 12px;
  padding: 20px 23px;
  min-width: 0;
}
.example-resolution h4 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.example-resolution ol {
  padding-left: 24px;
  margin: 0;
}
.example-resolution li {
  margin-bottom: 13px;
  padding-left: 3px;
}
.example-resolution li:last-child {
  margin-bottom: 0;
}
.example-result {
  margin: 20px 0 0;
  font-size: 23px;
}
.completion-row {
  margin: 30px 0;
}
.completion-row p {
  font-size: 17px;
  color: var(--ink-soft);
  margin-top: 12px;
}
.lesson-navigation {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--edge);
  padding-top: 24px;
  margin-bottom: 10px;
}
.lesson-navigation .button {
  font-size: 1.4rem;
  padding: 10px 18px;
}
.formula-entry {
  padding-bottom: 30px;
  margin-bottom: 35px;
  border-bottom: 1px solid var(--edge);
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.formula-entry :is(h2, h3) {
  font-size: 1.9rem;
}
.formula-entry .hand-link {
  font-size: 1.3rem;
}
.study-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 900px;
}
.study-lesson .formula-entry:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.review-status {
  font-size: 18px;
  color: var(--ink-soft);
}

.search-dialog {
  border: 1px solid var(--edge);
  border-radius: 22px;
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 25px 100px #0004;
  width: min(650px, calc(100% - 30px));
  max-height: 80vh;
  padding: 25px;
  margin: 12vh auto auto;
  overflow: hidden;
}
.search-dialog[open] {
  display: flex;
  flex-direction: column;
}
.search-heading,
.search-field,
.search-status,
.search-hint,
.search-dialog > label {
  flex-shrink: 0;
}
.search-results-area {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.search-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding-bottom: 28px;
}
.search-scroll::-webkit-scrollbar {
  display: none;
}
.search-scroll:focus-visible {
  outline-offset: -3px;
}
.search-more {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0;
  border: 0;
  background: linear-gradient(to top, var(--paper-raised) 65%, transparent);
  color: var(--ink-soft);
}
.search-more .icon {
  width: 20px;
  height: 20px;
  opacity: 0.65;
}
.search-more:hover .icon,
.search-more:focus-visible .icon {
  opacity: 1;
  color: var(--blue);
}
.search-dialog::backdrop {
  background: #15224066;
  backdrop-filter: blur(3px);
}
.search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.search-heading h2 {
  font-size: 2.2rem;
}
.search-heading .icon-button {
  flex-shrink: 0;
}
.search-dialog > label {
  font-size: 19px;
  display: block;
  margin-bottom: 8px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--blue);
  border-radius: 13px;
  padding: 10px 13px;
}
.search-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 22px;
  min-width: 0;
}
.search-field:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.search-status {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 18px 0 6px;
}
.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-results a {
  display: block;
  padding: 12px;
  border-bottom: 1px solid var(--edge);
  border-radius: 8px;
}
.search-results a:hover {
  background: var(--blue-wash);
}
.search-results strong {
  display: block;
  font: 700 1.6rem var(--font-title);
}
.search-results span {
  display: block;
  font-size: 17px;
  color: var(--ink-soft);
}
.search-hint {
  font-size: 16px;
  margin: 20px 0 0;
  color: var(--ink-soft);
}
.analytics-notice {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  width: min(600px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: var(--shadow-sheet);
}
.analytics-notice h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.analytics-notice p {
  font-size: 19px;
}
.analytics-notice p a {
  color: var(--blue);
  text-decoration: underline;
}
.analytics-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.analytics-notice-actions .button {
  flex: 1 1 210px;
}
.institutional-content > section {
  margin-top: 32px;
  scroll-margin-top: calc(var(--header-height) + 20px);
}
.institutional-index {
  padding: 22px 0;
  border-block: 1px solid var(--edge);
}
.institutional-index h2 {
  font-size: 1.65rem;
  margin-bottom: 16px;
}
.institutional-index ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  padding-left: 23px;
  margin: 0;
  font-size: 19px;
}
.institutional-index a {
  color: var(--blue);
}
.institutional-index a:hover {
  text-decoration: underline;
}
.privacy-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 22px 0 16px;
}
.privacy-controls .button {
  white-space: normal;
  text-align: center;
}
.institutional-content > section h2 {
  margin-bottom: 16px;
  color: var(--blue);
  font-size: 1.9rem;
}
.institutional-content > section a:not(.hand-link) {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-heading .institutional-updated {
  font-size: 18px;
  color: var(--ink-soft);
}
.feedback-form-link {
  margin: 4px 0 22px;
}
.feedback-form {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 2042px;
  border: 0;
  margin-bottom: 22px;
}
.practice-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px) auto;
  align-items: end;
  gap: 20px;
  padding: 22px 0;
  border-block: 1px solid var(--edge);
}
.practice-filter-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.practice-filter-field label {
  font-size: 20px;
}
.practice-filter-field select {
  min-width: 0;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--blue);
  border-radius: 13px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--paper-raised);
  font: inherit;
}
.practice-filter-reset {
  min-height: 56px;
  font-size: 22px;
}
.practice-results {
  margin: 22px 0 16px;
  color: var(--ink-soft);
  font-size: 19px;
}
.practice-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.practice-topic {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  min-width: 0;
}
.practice-topic-subject {
  color: var(--ink-soft);
  font-size: 18px;
}
.practice-topic h2 {
  font-size: 1.9rem;
  text-wrap: pretty;
}
.practice-topic-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 18px;
  color: var(--ink-soft);
}
.practice-topic-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font: 700 1.45rem var(--font-title);
}
.practice-topic-action .icon {
  width: 21px;
  height: 21px;
}
.practice-empty {
  padding: 25px 0;
  color: var(--ink-soft);
}
.practice-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  margin-top: 22px;
}
.practice-links .hand-link,
.practice-back {
  font-size: 1.5rem;
}
.practice-back {
  margin-top: 30px;
}
.exercise-set {
  margin: 24px 0 0;
  padding-top: 15px;
}
.exercise-progress {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--edge);
  padding-bottom: 13px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 19px;
}
.exercise-level {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.exercise-statement {
  font: 400 23px/1.5 var(--font-body);
  margin-bottom: 22px;
  text-wrap: pretty;
}
.exercise-set fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  min-width: 0;
}
.exercise-option {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 52px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--edge);
  cursor: pointer;
}
.exercise-option:hover,
.exercise-option:has(input:checked) {
  background: color-mix(in srgb, var(--blue-wash) 50%, transparent);
}
.exercise-option input {
  accent-color: var(--blue);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
}
.option-letter {
  font-family: var(--font-title);
  color: var(--ink-soft);
  font-size: 1.4rem;
}
.exercise-option[data-correct] {
  border-left: 3px solid var(--success);
}
.exercise-option[data-incorrect] {
  border-left: 3px solid var(--error);
}
.exercise-option > span:last-child {
  min-width: 0;
}
.exercise-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--edge);
  padding-top: 15px;
  margin-top: 24px;
}
.answer-feedback {
  min-height: 30px;
  font-size: 20px;
  margin: 15px 0 0;
}
.answer-feedback[data-correct='true'] {
  color: var(--success);
}
.answer-feedback[data-correct='false'] {
  color: var(--error);
}
.exercise-solution {
  border-left: 3px solid #87b6eb;
  margin: 15px 0 0;
  padding: 7px 0 7px 20px;
}
.exercise-solution summary {
  cursor: pointer;
  font: 700 1.65rem var(--font-title);
}
.exercise-solution ol {
  padding-left: 22px;
  margin: 15px 0;
}
.exercise-solution li {
  margin-bottom: 12px;
}
.exercise-solution > p {
  margin-top: 18px;
}
.written-label {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}
.exercise-set textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--paper-raised);
  padding: 13px;
  margin-bottom: 18px;
  min-height: 130px;
}
.completion-row [aria-pressed='true'] {
  border-color: var(--success);
  color: var(--success);
}

/* Todos os breakpoints de layout, do desktop ao celular estreito. */
@container (min-width: 560px) {
  .math-layout--wide {
    display: block;
  }
  .math-layout--stacked {
    display: none;
  }
}
@media (min-width: 1660px) {
  .notebook {
    padding-left: 116px;
    padding-right: 93px;
  }
}
@media (max-width: 1350px) {
  .header-inner {
    gap: 22px;
    padding-left: 3%;
    padding-right: 3%;
  }
  .desktop-nav {
    padding-left: 20px;
    gap: 16px;
  }
  .brand {
    font-size: 2.3rem;
  }
  .brand > .icon {
    width: 42px;
  }
  .search-trigger kbd {
    display: none;
  }
  .search-trigger {
    max-width: 245px;
  }
  .search-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .home-hero {
    gap: 35px;
    grid-template-columns: 1.35fr 1fr;
  }
  .hero-copy h1 {
    font-size: 3.5rem;
  }
  .hero-buttons {
    gap: 14px;
  }
  .hero-buttons .button {
    font-size: 1.5rem;
    padding: 11px 16px;
  }
  .subject-card {
    gap: 12px;
    padding: 14px 15px;
  }
  .subject-name {
    font-size: 1.6rem;
  }
  .subject-symbol {
    width: 45px;
    height: 45px;
  }
  .subject-symbol .icon {
    width: 31px;
    height: 31px;
  }
  .hero-sheet h2 {
    font-size: 2.1rem;
  }
  .sheet-formula {
    font-size: 20px;
  }
  .sheet-equation {
    font-size: 16px;
  }
}
@media (max-width: 1120px) {
  .practice-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :root {
    --header-height: 68px;
  }
  .header-inner {
    min-height: var(--header-height);
    gap: 20px;
  }
  .desktop-nav {
    gap: 17px;
    justify-content: flex-start;
  }
  .desktop-nav > a {
    font-size: 1.4rem;
  }
  .search-trigger {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 8px;
  }
  .search-trigger span {
    display: none;
  }
  .header-actions {
    gap: 10px;
  }
  .brand {
    font-size: 2.1rem;
  }
  .notebook {
    padding-left: 7%;
    padding-right: 4%;
  }
  .subject-heading p,
  .lesson-heading p {
    margin-left: 0;
  }
  .heading-illustration {
    width: 170px;
  }
  .heading-sketch {
    height: 70px;
    width: 70px;
  }
  .lesson-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 25px;
  }
  .lesson-toc details {
    padding: 18px 13px;
  }
  .lesson-toc a {
    font-size: 17px;
    gap: 9px;
  }
  .lesson-section > h2 {
    font-size: 1.95rem;
  }
  .comparison-grid {
    gap: 10px;
  }
  .comparison-item {
    padding: 13px 8px;
  }
  .comparison-item p {
    font-size: 17px;
  }
  .comparison-item h4 {
    font-size: 1.35rem;
  }
  .lesson-content {
    font-size: 21px;
  }
}
@media (max-width: 1000px) {
  .home-hero {
    gap: 28px;
    grid-template-columns: 1.2fr 1fr;
  }
  .hero-copy h1 {
    font-size: 2.9rem;
  }
  .hero-intro {
    font-size: 1.6rem;
  }
  .hero-buttons .button {
    font-size: 1.3rem;
    padding: 10px 12px;
    gap: 8px;
  }
  .hero-sheet {
    padding: 23px 18px 18px 40px;
  }
  .hero-sheet::before {
    left: 27px;
  }
  .hero-sheet h2 {
    font-size: 1.75rem;
  }
  .hero-sheet > p {
    font-size: 1.4rem;
  }
  .sheet-equation {
    font-size: 13px;
  }
  .sheet-formula {
    font-size: 16px;
  }
  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .subject-name {
    font-size: 1.9rem;
  }
  .subject-symbol {
    width: 53px;
    height: 48px;
  }
  .subject-card {
    min-height: 90px;
  }
}
@media (max-width: 760px) {
  .institutional-index ol {
    grid-template-columns: minmax(0, 1fr);
  }
  .practice-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
  }
  .practice-filter-reset {
    min-height: 44px;
    justify-self: start;
  }
  .practice-topic-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .practice-topic {
    padding: 20px;
  }
  .study-subject-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Mantém o traço original, só ajustando seu encaixe nos títulos. */
  :is(h1, h2, h3, h4) .highlight::before {
    inset: 12% 0.04em 12%;
  }
  :root {
    --header-height: 68px;
  }
  .desktop-nav {
    display: none;
  }
  .header-inner {
    min-height: var(--header-height);
    padding: 10px 22px;
    gap: 10px;
    justify-content: space-between;
  }
  .brand {
    font-size: 2.2rem;
    gap: 10px;
  }
  .brand > .icon {
    width: 40px;
    height: 38px;
  }
  .header-actions {
    gap: 10px;
  }
  .theme-toggle {
    display: none;
  }
  .mobile-toggle {
    display: grid;
    box-shadow: none;
    background: none;
    border: 0;
    width: 36px;
  }
  .mobile-toggle .icon {
    width: 28px;
    height: 28px;
  }
  .notebook {
    padding: 22px 22px 42px 39px;
    min-height: calc(100vh - 200px);
  }
  .notebook::before {
    left: 28px;
    opacity: 0.25;
  }
  .notebook::after {
    width: 23px;
    background-size: 23px 45px;
  }
  .breadcrumbs {
    font-size: 17px;
    margin-bottom: 22px;
  }
  .breadcrumbs ol,
  .breadcrumbs li {
    gap: 6px;
  }
  .page-heading {
    margin: 25px 0 30px;
  }
  .page-heading > p {
    font-size: 21px;
  }
  .subject-heading,
  .lesson-heading {
    padding-bottom: 20px;
    gap: 0;
    border-bottom: 0;
  }
  .heading-illustration {
    display: none;
  }
  .subject-heading p,
  .lesson-heading p {
    font-size: 21px;
  }
  .title-with-icon {
    gap: 18px;
    align-items: center;
  }
  .title-with-icon h1 {
    font-size: 2.6rem;
  }
  .heading-sketch {
    width: 68px;
    height: 68px;
  }
  .subject-heading p {
    margin-left: 86px;
  }
  .lesson-heading p {
    margin-left: 86px;
  }
  .section-heading {
    gap: 15px;
    align-items: flex-start;
  }
  .section-heading .hand-link {
    font-size: 1.3rem;
  }
  .site-footer {
    flex-wrap: wrap;
    padding: 20px 25px 25px 39px;
    font-size: 17px;
    gap: 10px;
  }
  .site-footer > span {
    width: 100%;
    order: 3;
  }
  .footer-links {
    width: 100%;
    gap: 12px 18px;
  }
  .subject-lessons {
    margin-top: 30px;
  }
  .subject-lessons .section-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .notebook--home {
    padding-top: 36px;
  }
  .home-hero {
    display: block;
    padding: 5px 0 30px;
  }
  .hero-copy h1 {
    font-size: clamp(2.35rem, 6.9vw, 3.5rem);
    line-height: 1.17;
    letter-spacing: -0.5px;
    max-width: 610px;
  }
  .desktop-break {
    display: none;
  }
  .hero-intro {
    font: 400 22px/1.4 var(--font-body);
    margin: 24px 0;
    max-width: 460px;
  }
  .hero-intro::after {
    display: none;
  }
  .hero-sheet {
    display: none;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 13px;
    margin-top: 24px;
    max-width: 500px;
  }
  .hero-buttons .button {
    font-size: 1.6rem;
    min-height: 55px;
    padding: 12px 16px;
    gap: 12px;
  }
  .doodle-spark {
    right: 7%;
    top: -15px;
    transform: scale(0.6);
  }
  .explore {
    padding-top: 6px;
  }
  .explore .section-heading {
    margin-bottom: 22px;
  }
  .explore .section-heading > .hand-link {
    display: none;
  }
  .explore h2 {
    font-size: 2.15rem;
  }
  .subject-grid {
    gap: 12px;
  }
  .subject-card {
    min-height: 83px;
    gap: 10px;
    padding: 12px 11px;
    border-radius: 17px;
  }
  .subject-name {
    font-size: 1.5rem;
  }
  .subject-symbol {
    width: 37px;
    height: 40px;
  }
  .subject-symbol .icon {
    width: 29px;
    height: 29px;
  }
  .subject-card > .icon,
  .planned-dot {
    display: none;
  }
  .subject-status {
    font-size: 13px;
  }
  .availability-note {
    font-size: 17px;
    margin-top: 22px;
  }
  .home-about {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
  }
  .home-about-topics {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson-card {
    padding: 20px 18px;
    gap: 17px;
    min-height: 83px;
  }
  .lesson-card-copy h3 {
    font-size: 1.7rem;
    margin: 0;
  }
  .lesson-card-copy p {
    display: none;
  }
  .lesson-number {
    font-size: 1.9rem;
    padding: 2px 11px;
  }
  .lesson-card-sketch {
    display: none;
  }
  .circle-arrow {
    border: 0;
    width: 23px;
  }
  .lesson-list {
    gap: 15px;
  }
  .subject-grid--index {
    margin-top: 22px;
  }
  .lesson-layout {
    display: block;
  }
  body:has(.lesson-toc) {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .lesson-toc {
    position: fixed;
    top: auto;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 48px;
    margin: 0;
    z-index: 40;
  }
  .lesson-toc details {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .lesson-toc summary {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--blue);
    border-radius: 50% 45% 48% 44%;
    background: var(--paper-raised);
    color: var(--blue);
    box-shadow: var(--shadow-sheet);
    cursor: pointer;
    list-style: none;
  }
  .lesson-toc summary::-webkit-details-marker {
    display: none;
  }
  .lesson-toc .toc-summary-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .lesson-toc .toc-close-icon,
  .lesson-toc details[open] .toc-list-icon {
    display: none;
  }
  .lesson-toc details[open] summary {
    background: var(--blue-wash);
  }
  .lesson-toc details[open] .toc-close-icon {
    display: block;
  }
  .lesson-toc details:not([open]) > nav {
    display: none;
  }
  .lesson-toc nav {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(360px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    padding: 18px 20px 10px;
    background: var(--paper-raised);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sheet);
  }
  .toc-scroll {
    max-height: min(52svh, calc(100dvh - var(--header-height) - 180px));
    overflow-y: auto;
    padding-bottom: 40px;
  }
  .toc-more {
    height: 40px;
  }
  .toc-title {
    display: block;
    font-size: 1.7rem;
    margin-bottom: 14px;
  }
  .lesson-toc a {
    font-size: 20px;
    padding: 10px 0;
  }
  .lesson-section {
    padding-bottom: 24px;
    margin-bottom: 28px;
  }
  .lesson-section > h2 {
    font-size: 1.9rem;
    margin-bottom: 20px;
    gap: 9px;
  }
  .section-number {
    min-width: 31px;
    height: 31px;
    font-size: 1.5rem;
  }
  .lesson-content {
    font-size: 21px;
    line-height: 1.5;
  }
  .subheading {
    font-size: 1.6rem;
  }
  .lesson-figure {
    margin: 22px auto;
  }
  .lesson-figure .geometry {
    max-width: 270px;
  }
  .lesson-figure figcaption {
    font-size: 17px;
  }
  .comparison-grid {
    gap: 9px;
  }
  .comparison-item {
    padding: 12px 6px;
  }
  .comparison-item h4 {
    font-size: 1.25rem;
  }
  .comparison-item .geometry {
    width: 100%;
    margin: 12px auto 7px;
  }
  .comparison-item p {
    font-size: 16px;
  }
  .example-layout {
    grid-template-columns: 1fr;
  }
  .example-layout > .geometry {
    max-width: 270px;
  }
  .example-resolution {
    padding: 18px;
  }
  .example-resolution li {
    font-size: 20px;
  }
  .worked-example > h3 {
    font-size: 1.6rem;
  }
  .formula-condition {
    font-size: 17px;
  }
  .formula-block {
    margin: 20px 0;
  }
  .math-scroll .katex-display {
    font-size: 1em;
  }
  .completion-row .button {
    font-size: 1.4rem;
    width: 100%;
    gap: 10px;
    padding: 12px;
  }
  .lesson-navigation {
    gap: 10px;
  }
  .lesson-navigation .button {
    font-size: 1.25rem;
    padding: 10px 12px;
    gap: 7px;
  }
  .lesson-navigation .icon {
    width: 19px;
  }
  .content-note {
    padding-left: 15px;
  }
  .content-note p {
    font-size: 19px;
  }
  .search-dialog {
    padding: 20px;
    margin-top: 7vh;
  }
  .search-heading h2 {
    font-size: 1.9rem;
  }
  .search-field input {
    font-size: 20px;
  }
  .exercise-statement {
    font-size: 21px;
  }
  .exercise-option {
    gap: 10px;
    font-size: 21px;
    padding: 13px 5px;
  }
  .exercise-progress {
    font-size: 17px;
  }
  .exercise-solution {
    padding-left: 15px;
  }
  .exercise-solution li {
    font-size: 20px;
  }
  .exercise-controls .text-button {
    font-size: 19px;
  }
  .exercise-controls .icon {
    width: 20px;
  }
}
@media (max-width: 420px) {
  .title-with-icon--long {
    flex-wrap: wrap;
  }
  .title-with-icon--long h1 {
    flex-basis: 100%;
    min-width: 0;
  }
  .header-inner {
    padding: 8px 15px;
  }
  .brand {
    font-size: 2rem;
  }
  .brand > .icon {
    width: 35px;
  }
  .header-actions {
    gap: 4px;
  }
  .notebook {
    padding-right: 17px;
    padding-left: 32px;
  }
  .notebook::before {
    left: 23px;
  }
  .title-with-icon {
    gap: 13px;
  }
  .heading-sketch {
    width: 55px;
    height: 60px;
  }
  .title-with-icon h1 {
    font-size: 2.4rem;
  }
  .subject-heading p,
  .lesson-heading p {
    margin-left: 0;
    margin-top: 18px;
  }
  .site-footer {
    padding-left: 32px;
  }
  .subject-name {
    font-size: 1.4rem;
  }
  .subject-symbol {
    width: 31px;
  }
  .subject-symbol .icon {
    width: 26px;
    height: 26px;
  }
  .subject-card {
    gap: 8px;
    padding: 11px 9px;
  }
  .hero-copy h1 {
    font-size: 2.35rem;
  }
  .hero-copy h1 .highlight {
    white-space: normal;
  }
  .hero-intro {
    font-size: 21px;
  }
  .explore h2 {
    font-size: 2rem;
  }
}
@media (max-width: 360px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .comparison-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px;
  }
  .comparison-item h4 {
    font-size: 1.6rem;
  }
  .comparison-item .geometry {
    grid-column: 2;
    grid-row: 1/3;
  }
  .comparison-item p {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 360px) {
  .subject-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .subject-card-text {
    width: 100%;
  }
  .subject-name {
    font-size: 1.4rem;
  }
  .subject-status {
    font-size: 14px;
  }
  .hero-copy h1 {
    font-size: 2.05rem;
  }
}

