:root {
  color-scheme: light;
  --navy: #09254c;
  --yellow: #ffdf00;
  --ink: #152c49;
  --muted: #526174;
  --line: #d9e0e8;
  --paper: #fff;
  --wash: #f4f6f8;
  --sidebar: 282px;
  --topbar: 76px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--topbar) + 20px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 Calibri, Arial, sans-serif; }
a { color: var(--navy); text-underline-offset: .18em; }
button, input { font: inherit; }
button, .button { min-height: 44px; min-width: 44px; }
button, .button, input { border: 1px solid var(--line); border-radius: 4px; }
button, .button { padding: 9px 16px; background: white; color: var(--navy); cursor: pointer; }
button:hover, .button:hover { background: var(--wash); border-color: var(--navy); }
:focus-visible { outline: 3px solid #b88600; outline-offset: 3px; }
#main:focus { outline: none; }
.button { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; font-weight: 700; }
.primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.primary:hover { background: #ffe951; }
img, video { max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; text-wrap: pretty; }
h1 { margin: 0 0 24px; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.02em; }
h2 { font-size: 28px; margin: 38px 0 18px; }
h3 { font-size: 22px; }
p { margin: 0 0 18px; }
.view { overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; background: var(--yellow); }
.skip-link:focus { top: 8px; }
.topbar { position: sticky; z-index: 30; top: 0; height: var(--topbar); display: flex; align-items: center; gap: 24px; padding: 0 32px; background: var(--navy); color: white; border-bottom: 3px solid var(--yellow); }
.topbar a { color: white; text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.brand { font-weight: 700; font-size: 23px; gap: 18px; white-space: nowrap; }
.brand span { font-size: 16px; font-weight: 400; }
.topbar nav { display: flex; gap: 8px; margin-left: auto; }
.topbar nav a { padding: 8px 12px; font-size: 16px; }
.topbar a:hover, .topbar a[aria-current] { color: var(--yellow); }
#menu-toggle { display: none; }
#sidebar { position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); padding: 24px 20px; background: var(--wash); overflow-y: auto; border-right: 1px solid var(--line); font-size: 16px; }
#sidebar a { display: flex; min-height: 44px; align-items: center; padding: 10px 8px; text-decoration: none; border-radius: 3px; }
#sidebar a:hover { background: #e5ebf2; }
#sidebar a[aria-current] { background: var(--navy); color: white; }
#sidebar label { display: block; margin: 18px 0 6px; font-weight: 700; }
#search { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; background: white; color: var(--ink); }
#sidebar h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin: 28px 8px 8px; }
.module-link { flex-direction: column; align-items: flex-start !important; line-height: 1.3; margin-bottom: 4px; }
.module-link span { font-size: 13px; opacity: .75; margin-bottom: 4px; }
.sidebar-footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 12px; }
#main { margin-left: var(--sidebar); padding: 40px clamp(24px, 4vw, 64px) 64px; min-width: 0; }
.view { max-width: 1220px; margin-inline: auto; }
#inicio .intro { max-width: 760px; font-size: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }
.opening-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; margin: 32px 0; }
.module-row { display: grid; grid-template-columns: 150px 1fr 28px; align-items: center; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.module-row:hover h3 { text-decoration: underline; }
.module-row img { display: block; aspect-ratio: 16 / 9; object-fit: contain; }
.module-row h3 { margin: 6px 0; }
.module-row small { color: var(--muted); }
.lesson-heading { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.lesson-heading > div { min-width: 0; }
.lesson-heading h1 { font-size: clamp(26px, 2.5vw, 36px); margin: 0; }
.lesson-heading > .button { flex-shrink: 0; }
.slide-figure { margin: 0 0 32px; }
.slide-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--navy); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.lesson-text { max-width: 78ch; font-size: 20px; line-height: 1.65; }
.lesson-text h2 { font-size: 23px; }
.lesson-text p { white-space: normal; }
.lesson-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 24px; }
.lesson-pagination span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.video-block { margin: 32px 0; }
.video-block video { width: 100%; display: block; background: var(--navy); }
.video-block > a { display: inline-flex; min-height: 44px; align-items: center; }
/* The source canvas is never cropped, rearranged or overlaid with UI. */
body.presenting { background: var(--navy); overflow: hidden; --controls-height: 68px; }
.presenting .topbar, .presenting #sidebar, .presenting .skip-link { display: none; }
.presenting #main { margin: 0; padding: 0; width: 100%; height: calc(100dvh - var(--controls-height)); }
.presenting .slide-view { width: 100%; height: 100%; max-width: none; display: grid; place-items: center; }
.presenting .lesson-heading, .presenting .lesson-text, .presenting .lesson-pagination,
.presenting figcaption, .presenting .video-block > h3, .presenting .video-block > a,
.presenting .has-video .slide-figure { display: none; }
.presenting .slide-figure, .presenting .video-block { margin: 0; width: min(100vw, calc((100dvh - var(--controls-height)) * 16 / 9)); }
.presenting .slide-image, .presenting video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; display: block; }
#presentation-controls { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: var(--navy); color: white; border-top: 1px solid #3b526f; font-size: 16px; }
#presentation-controls button { border-color: #64758b; background: var(--navy); color: white; }
#presentation-controls button:hover { background: #203c60; }
#presentation-controls button:disabled { opacity: .45; cursor: default; }
#presentation-controls :focus-visible { outline-color: var(--yellow); }
#present-counter { min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
#slide-jump { width: 74px; min-height: 44px; padding: 6px 8px; color: var(--navy); background: white; }
#exit-presentation { color: var(--yellow) !important; }
#search-results { overflow-wrap: anywhere; }
#search-results:not(:empty) { margin: 16px 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#search-results p { font-size: 14px; margin-bottom: 8px; }
#search-results a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; line-height: 1.35; }
#search-results small { color: var(--muted); font-size: 14px; }
/* Supplementary reader pages use the same plain document rhythm. */
.exercise-view p, .exercise-view li { max-width: 80ch; }
.exercise-view img { display: block; object-fit: contain; }
.view details { margin: 24px 0; border: 1px solid var(--line); border-radius: 4px; padding: 0 18px 16px; }
.view summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--navy); font-weight: 700; }
.view summary + * { margin-top: 16px; }
.view table { width: 100%; border-collapse: collapse; font-size: 17px; }
.view th, .view td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.view th { background: var(--wash); }
.view pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.view code { font-size: .9em; }
#downloads a, #programacao a, #exercicios a, .exercise-view a { min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 1000px) {
  :root { --topbar: 118px; }
  .topbar { height: var(--topbar); padding: 8px 16px; gap: 8px 14px; flex-wrap: wrap; align-content: center; }
  #menu-toggle { display: block; padding: 8px; background: transparent; border-color: #64758b; color: white; }
  .brand { font-size: 21px; flex: 1; gap: 12px; }
  .brand span { font-size: 15px; }
  .topbar nav { width: 100%; margin: 0; justify-content: space-between; gap: 4px; }
  .topbar nav a { padding: 8px 12px; }
  #sidebar { display: none; z-index: 25; width: min(350px, 100%); }
  .menu-open #sidebar { display: block; box-shadow: 12px 0 24px #09254c26; }
  .menu-open { overflow: hidden; }
  #main { margin-left: 0; padding: 30px 24px 48px; }
  .lesson-heading { flex-direction: column; gap: 16px; }
  .module-row { grid-template-columns: 120px 1fr 20px; gap: 18px; }
  .presenting #sidebar, .presenting #menu-toggle { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  .brand { flex-direction: column; align-items: flex-start !important; gap: 0; line-height: 1.25; }
  #main { padding: 26px 18px 40px; }
  h1 { font-size: 32px; }
  h2 { font-size: 25px; }
  #inicio .intro { font-size: 20px; }
  .actions { flex-direction: column; align-items: stretch; }
  .module-row { grid-template-columns: 88px 1fr; gap: 14px; }
  .module-row > span { display: none; }
  .module-row h3 { font-size: 19px; }
  .module-row small { font-size: 14px; }
  .lesson-text { font-size: 19px; }
  .lesson-pagination { gap: 8px; }
  .lesson-pagination .button { padding-inline: 10px; }
  #presentation-controls { gap: 6px; padding: 8px; }
  #presentation-controls label { font-size: 14px; }
  #presentation-controls button { padding-inline: 12px; }
  #present-counter { min-width: 62px; }
  #slide-jump { width: 62px; }
  .view th, .view td { padding: 8px 5px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}


