/* Part 61: the look of a VFR sectional. Chart-paper green, Class B blue for
   structure, magenta only for routes (as on the chart). Barlow Condensed for
   headings and numbers, like chart labels and placards; Atkinson Hyperlegible
   for reading. Overrides the shared site.css tokens, so Part 107 is untouched. */

@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #eef1e6;          /* chart paper */
  --surface: #f8faf3;
  --text: #18222b;        /* chart ink */
  --muted: #55626a;
  --border: #c9d1c0;
  --accent: #1f4fa0;      /* Class B blue */
  --accent-text: #ffffff;
  --route: #a3266f;       /* magenta: routes only */
  --instr-bg: #f8eccb;
  --instr-border: #b8862b;
  --mod: #1f4fa0;
  --mod-deep: #0e1621;
  --night: #0e1621;
  --night-ink: #e4e9ee;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1621; --surface: #142030; --text: #e4e9ee; --muted: #9aa8b5; --border: #2a3a4e;
    --accent: #86aeef; --accent-text: #0e1621; --route: #e58bc2;
    --instr-bg: #2c2414; --instr-border: #a07a1a; --mod: #86aeef;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1621; --surface: #142030; --text: #e4e9ee; --muted: #9aa8b5; --border: #2a3a4e;
  --accent: #86aeef; --accent-text: #0e1621; --route: #e58bc2;
  --instr-bg: #2c2414; --instr-border: #a07a1a; --mod: #86aeef;
}

html { overflow-x: clip; }
body { font-family: var(--body); font-size: 18px; line-height: 1.6; }
h1, h2, h3, .brand, .eyebrow, .why-tag, th, .button-link, .pager a, .lesson-n {
  font-family: var(--head); letter-spacing: 0.005em;
}
h1 { font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; margin: 0.2rem 0 0.6rem; }
h2 { font-weight: 700; font-size: 1.9rem; line-height: 1.05; }
h3 { font-weight: 600; font-size: 1.4rem; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--route); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Labels read like chart labels: sentence case, condensed, blue. */
.eyebrow { text-transform: none; letter-spacing: 0.01em; font-weight: 600; font-size: 1.05rem; color: var(--accent); margin: 0 0 0.2rem; }

.site-header { background: var(--bg); border-bottom: 2px solid var(--text); padding-block: 0.6rem; }
.brand { font-weight: 700; font-size: 1.35rem; }
.site-header nav a { font-weight: 700; }
.tools button { border-radius: 3px; font-size: 0.9rem; padding: 0.25rem 0.7rem; }
.site-footer { border-top: 2px solid var(--text); font-size: 0.85rem; }
button { border-radius: 3px; }

/* Buttons and links that act like buttons: squared, like a placard. */
.button-link { border-radius: 3px; border-width: 2px; font-weight: 700; font-size: 1.1rem; padding: 0.25em 0.8em; color: var(--accent); }
.button-link:hover { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- The chart ---------- */
.chart-map { margin: 0; }
.chart-map svg { display: block; width: 100%; height: auto; background: #e9eadf; }
.chart-map a { display: block; }
.chart-map figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
.cm-route .casing { fill: none; stroke: #000; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.cm-route .line { fill: none; stroke: #ff7a00; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.cm-practice { fill: rgba(255, 122, 0, 0.08); stroke: #ff7a00; stroke-width: 4; stroke-dasharray: 14 10; }
.cm-ring { fill: none; stroke: #ff7a00; stroke-width: 6; }
.cm-landmark circle { fill: none; stroke: #ff7a00; stroke-width: 4; }
.cm-label, .cm-landmark text { font-family: var(--head); font-weight: 700; fill: #000; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.cm-scale rect { fill: rgba(255, 255, 255, 0.85); }
.cm-scale line { stroke: #000; stroke-width: 3; }
.cm-scale text { font-family: var(--head); font-weight: 700; fill: #000; }

/* ---------- Home ---------- */
.home-head h1 { max-width: 20ch; }
.home-hero { width: min(72rem, calc(100vw - 32px)); margin: 1.5rem 0 2rem calc(50% - min(36rem, 50vw - 16px)); }
.home-hero svg { border: 2px solid var(--text); }
.lede { font-size: 1.2rem; color: var(--text); max-width: 34em; }
/* Lessons as checkpoints on a route: a real sequence, so they are numbered. */
.stage { margin-top: 2rem; }
.stage h2 { margin-bottom: 0.6rem; }
.route-list { list-style: none; padding: 0 0 0 0; margin: 0; position: relative; }
.route-list::before { content: ""; position: absolute; left: 1.15rem; top: 1rem; bottom: 1rem; width: 4px; background: var(--route); border-radius: 2px; }
.route-list li { position: relative; display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.9rem; align-items: center; padding: 0.4rem 0; }
/* Progress: a flown lesson's checkpoint fills in; the next one is marked. */
.route-list .flown { font: inherit; font-family: var(--head); font-weight: 700; font-size: 0.95rem; padding: 0.15rem 0.6rem; border-radius: 3px; border: 2px solid var(--border); background: transparent; color: var(--muted); }
.route-list .flown[aria-pressed="true"] { border-color: var(--route); background: var(--route); color: #fff; }
.route-list li.done .cp { background: var(--route); color: #fff; }
.route-list li.next .cp { box-shadow: 0 0 0 4px color-mix(in srgb, var(--route) 30%, transparent); }
.route-list .next-tag { display: none; margin-left: 0.3em; padding: 0 0.4em; font-size: 0.6em; vertical-align: middle; border-radius: 3px; background: var(--accent); color: var(--accent-text); }
.route-list li.next .next-tag { display: inline-block; }
.route-list .cp {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--bg); border: 3px solid var(--route); font-family: var(--head); font-weight: 700; font-size: 1.3rem; color: var(--text);
}
.route-list a { font-family: var(--head); font-weight: 700; font-size: 1.6rem; text-decoration: none; color: var(--text); line-height: 1.1; }
.route-list a:hover { color: var(--accent); }
.route-list .sub { display: block; color: var(--muted); font-size: 0.95rem; }

/* ---------- Briefing page ---------- */
.present-link { margin: 0.5rem 0 1.5rem; }
.briefing .slide { border-bottom: 1px solid var(--border); padding: 1.6rem 0; }
.lesson-head { display: grid; grid-template-columns: auto 1fr; gap: 0 1.2rem; align-items: end; }
.lesson-n { font-weight: 700; font-size: clamp(5rem, 16vw, 8.5rem); line-height: 0.8; color: var(--accent); }
.lesson-head h1 { margin: 0; }
.lesson-head .block { margin: 0.3rem 0 0; }
.title-slide .chart-map { margin-top: 1.4rem; }
.route-list .sub { font-family: var(--body); font-weight: 400; }
.title-slide .chart-map svg { border: 2px solid var(--text); }
.briefing .story-slide .story-text { font-size: 1.45rem; line-height: 1.4; }

/* The every-flight routine as a checklist card that spells PAVE down its left
   edge, with IMSAFE and NWKRAFT inside; the two briefings follow. */
.routine { list-style: none; padding: 0; margin: 0.8rem 0 1.2rem; border: 2px solid var(--text); border-radius: 4px; background: var(--surface); }
.routine > li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.7rem; padding: 0.55rem 0.9rem; margin: 0; border-top: 1px dashed var(--border); }
.routine > li:first-child { border-top: 0; }
.routine > li.brief:not(.lettered) { border-top: 1px dashed var(--border); }
.routine > li.lettered + li.brief { border-top: 2px solid var(--text); }
.routine .rl { font-family: var(--head); font-weight: 700; font-size: 2.1em; line-height: 0.95; color: var(--accent); text-align: center; }
.routine > li strong { font-family: var(--head); font-weight: 700; font-size: 1.15em; color: var(--accent); }
.routine .acro { list-style: none; padding: 0; margin: 0.3rem 0 0; columns: 2 15em; column-gap: 1.5em; font-size: 0.95em; }
.routine .acro li { margin: 0.1rem 0; break-inside: avoid; }
.routine .acro li::marker { content: none; }
.routine .acro strong { font-size: 1.15em; }
/* Short words (IMSAFE) run across, so the letters read as the word. */
.routine .acro.across { columns: auto; display: flex; flex-wrap: wrap; gap: 0.1rem 1.1em; }

.content-slide .why { border-left-width: 4px; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--accent) 9%, transparent); padding: 0.5rem 0.9rem; }
.why-tag { text-transform: none; letter-spacing: 0; font-size: 1.1em; font-weight: 700; color: var(--accent); }
.bullets .lead { font-weight: 700; }
ul { padding-left: 1.3rem; }
ul li::marker { color: var(--accent); }
th { font-weight: 700; font-size: 1.1rem; border-bottom: 2px solid var(--text); }
.instr-note, .instr { border-radius: 0 3px 3px 0; }
.instr-notes > h2 { padding-top: 1rem; }
.pager { border-top: 2px solid var(--text); margin-top: 1rem; }
.pager a { font-weight: 700; font-size: 1.2rem; }

/* ---------- Slides ---------- */
body.deck-mode { background: var(--bg); }
body.deck-mode .slide.current { font-size: clamp(1.1rem, 1.5vw + 0.4rem, 2.5rem); padding: 4vh 6vw; }
body.deck-mode .slide.current h1 { font-size: 3.4em; line-height: 0.95; }
body.deck-mode .slide.current h2 { font-size: 2.1em; }
body.deck-mode .slide.current .eyebrow { font-size: 0.8em; }
body.deck-mode .content-slide.current { border-top: 0; padding-top: 6vh; }
body.deck-mode .content-slide .why { font-size: 0.85em; }

/* Title slide: the lesson's title on the left, its flight on the chart on the right. */
body.deck-mode .title-slide.current {
  position: relative; overflow: hidden; background: var(--night); color: var(--night-ink); justify-content: center;
}
body.deck-mode .title-slide.current .chart-map { position: absolute; top: 0; bottom: 0; right: 0; left: 40%; margin: 0; border-left: 4px solid #ee93ca; }
body.deck-mode .title-slide.current .chart-map a, body.deck-mode .title-slide.current .chart-map svg { width: 100%; height: 100%; border: 0; }
body.deck-mode .title-slide.current .chart-map figcaption { position: absolute; left: 0; bottom: 0; margin: 0; padding: 0.3em 0.8em; font-size: 0.42em; color: #dfe6ec; background: rgba(14, 22, 33, 0.8); }
/* In the deck a click advances the slide, so the chart is not a link there. */
body.deck-mode .chart-map a { pointer-events: none; }
body.deck-mode .title-slide.current .lesson-head { width: 32vw; grid-template-columns: 1fr; gap: 0.3em; }
body.deck-mode .title-slide.current .lesson-n { color: #ee93ca; font-size: 5em; line-height: 0.85; }
body.deck-mode .title-slide.current .eyebrow, body.deck-mode .title-slide.current .block { color: #b9c5d1; }
body.deck-mode .title-slide.current h1 { color: #fff; font-size: 3em; }

/* The scenario: night, big type, like the moment before engine start. */
body.deck-mode .story-slide.hook.current { background: var(--night); color: var(--night-ink); }
body.deck-mode .story-slide.hook.current .eyebrow { color: #ee93ca; }
body.deck-mode .story-slide.hook .story-text { font-family: var(--head); font-weight: 600; font-size: 2.3em; line-height: 1.1; max-width: 22em; }
body.deck-mode .story-slide.hook p:not(.story-text):not(.eyebrow) { color: #b9c5d1; max-width: 40em; }

body.deck-mode .routine-slide.current { font-size: clamp(0.9rem, 1.05vw + 0.3rem, 1.8rem); }
body.deck-mode .routine-slide.current h2 { margin-bottom: 0.1em; }
body.deck-mode .routine-slide .routine { margin: 0.5em 0 0.8em; }
body.deck-mode .routine-slide .routine > li { padding: 0.3em 0.9em; }
body.deck-mode .routine-slide.current > p { margin: 0.25em 0; }
body.presenter-view .title-slide.current .lesson-n { font-size: 3em; }
#present-bar { background: var(--bg); border-top: 1px solid var(--border); font-size: 0.95rem; }
.pp-next .chart-map { display: none; }

/* Slides centered vertically, but a slide taller than the screen starts at its top and scrolls. */
body.deck-mode .slide.current { justify-content: safe center; }

/* Slides on a phone held upright. */
@media (orientation: portrait) {
  body.deck-mode .slide.current { padding: 3vh 5vw; font-size: clamp(1rem, 2.6vw + 0.5rem, 2rem); }
  body.deck-mode .slide.current h1 { font-size: 2.6em; }
  body.deck-mode .slide.current h2 { font-size: 1.8em; }
  /* Title: the map on top, the title under it. */
  body.deck-mode .title-slide.current { justify-content: flex-end; padding-bottom: 5vh; }
  body.deck-mode .title-slide.current .chart-map { left: 0; bottom: auto; height: 50%; border-left: 0; border-bottom: 4px solid #ee93ca; }
  body.deck-mode .title-slide.current .lesson-head { width: auto; }
  body.deck-mode .title-slide.current .lesson-n { font-size: 3.6em; }
  body.deck-mode .story-slide.hook .story-text { font-size: 1.7em; }
  body.deck-mode .routine-slide.current { font-size: clamp(0.85rem, 2.2vw + 0.4rem, 1.5rem); }
  body.deck-mode .routine-slide .routine > li { grid-template-columns: 1.6em 1fr; gap: 0 0.5em; }
}
@media (max-width: 700px) {
  #present-bar .hint { display: none; }
}

/* A closed answer takes no space here, so the questions stay large; fit.js refits the slide when one opens. */
body.deck-mode details.reveal:not([open])::details-content { content-visibility: hidden; }
body.deck-mode .slide.current .checks { font-size: 1em; }

/* ---------- Design pass: slides that look like slides ---------- */
/* The why reads as the slide's subtitle: blue rule, no grey box. */
.content-slide .why { background: none; border-left: 4px solid var(--accent); border-radius: 0; padding: 0.1rem 0 0.1rem 0.9rem; color: var(--muted); font-size: 1.05em; }
.why-tag { margin-right: 0.35em; }

@media (orientation: landscape) {
  /* Content slides: the title and its why on the left, the bullets large on the right. */
  body.deck-mode .content-slide.current {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto;
    align-content: center; column-gap: 5vw; row-gap: 0.4em; padding: 6vh 6vw;
  }
  body.deck-mode .content-slide.current h2 { grid-column: 1; grid-row: 1; align-self: end; font-size: 2.6em; margin: 0; }
  body.deck-mode .content-slide.current .why { grid-column: 1; grid-row: 2; align-self: start; font-size: 0.95em; margin: 0.4em 0 0; }
  body.deck-mode .content-slide.current .slide-body { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  body.deck-mode .content-slide.current .bullets { font-size: 1.1em; padding-left: 1.1em; }
  body.deck-mode .content-slide.current .bullets li { margin: 0.45em 0; }
  body.deck-mode .content-slide.current .bullets li::marker { color: #ff7a00; }
  /* The accident: a story, set in two columns like a magazine page. */
  body.deck-mode .accident-slide.current p:not(.eyebrow) { columns: 2 18em; column-gap: 3em; font-size: 0.82em; line-height: 1.55; }
}
body.deck-mode .accident-slide.current { border-top: 0.8vh solid #c0392b; }
body.deck-mode .accident-slide.current .eyebrow { color: #c0392b; font-size: 1em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.deck-mode .accident-slide.current .eyebrow { color: #f19a8a; } }
:root[data-theme="dark"] body.deck-mode .accident-slide.current .eyebrow { color: #f19a8a; }

/* Progress buttons: an invitation, not a disabled control. */
.route-list .flown { border-color: var(--accent); color: var(--accent); }
.route-list .flown:hover { background: var(--accent); color: var(--accent-text); }

/* The chart: the whole crop on wide screens, zoomed to the flight on phones. */
.chart-map .cm-focus { display: none; }
@media (max-width: 640px) {
  .chart-map .cm-full { display: none; }
  .chart-map .cm-focus { display: block; aspect-ratio: 1; }
}
body.deck-mode .title-slide.current .chart-map .cm-focus { display: none; }
body.deck-mode .title-slide.current .chart-map .cm-full { display: block; }

/* Home: the chart's note reads as its caption, and the lessons follow at once. */
.home-hero { margin-bottom: 0.4rem; }
.chart-note { color: var(--muted); font-size: 0.95rem; max-width: 40em; margin: 0 0 1.5rem; }
.handbook-note { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); }
