:root {
  color-scheme: light;
  --paper: #f9f6ef;
  --panel: #fffcf7;
  --ink: #172935;
  --quiet: #4c606a;
  --blue: #174d66;
  --light-blue: #e4edf0;
  --yellow: #f6cb69;
  --warn: #a94d33;
  --rule: #d9d9d0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, p, ul, ol, figure { margin: 0; }
h1, h2 { text-wrap: balance; }
.wrap { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; inset: 12px auto auto 12px; background: var(--paper); transform: translateY(-200%); padding: 12px; }
.skip:focus { transform: translateY(0); }
.top { border-bottom: 1px solid var(--rule); }
.top-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 75px; flex-wrap: wrap; gap: 17px; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 730; letter-spacing: -.03em; }
.mark { position: relative; width: 31px; height: 31px; background: var(--yellow); border-radius: 7px; flex: 0 0 31px; }
.mark::before { content: ""; position: absolute; inset: 7px 8px 8px 8px; border: 2px solid var(--blue); border-right: 0; }
.mark::after { content: ""; position: absolute; top: 7px; bottom: 8px; right: 8px; width: 5px; border-right: 2px solid var(--warn); transform: skewX(15deg); transform-origin: bottom right; }
.top nav, .footer-links, .languages { display: flex; align-items: center; gap: clamp(16px,3vw,34px); flex-wrap: wrap; }
.top nav a, .footer-links a, .languages a { font-size: .9rem; text-decoration: none; padding-block: 11px; }
a[aria-current] { text-decoration: underline !important; text-underline-offset: 5px; }
.hero { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(34px,6vw,80px); align-items: start; padding-block: clamp(46px,7vw,104px); }
.hero-copy { padding-top: clamp(18px,5vw,68px); }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 700 .73rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .075em; color: var(--blue); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--warn); flex: 0 0 auto; }
h1 { font-size: clamp(3rem,5.55vw,5.5rem); line-height: .98; font-weight: 745; letter-spacing: -.059em; margin-top: 18px; }
h1 em { color: var(--blue); font-style: normal; }
.lead { color: var(--quiet); font-size: clamp(1.04rem,1.55vw,1.24rem); line-height: 1.57; max-width: 34ch; margin-top: 23px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 29px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid transparent; border-radius: 8px; min-height: 49px; padding: 9px 15px; text-decoration: none; font-weight: 700; }
.primary { background: var(--yellow); color: var(--ink); border-color: #d7b259; }
.primary:hover { background: #f9d88e; }
.secondary { border-color: var(--blue); }
.text-link { display: inline-block; margin-top: 17px; padding-block: 8px; font-size: .96rem; font-weight: 650; }
.demo { background: var(--panel); border: 1px solid #c8cdc9; border-radius: 13px; padding: clamp(15px,2.3vw,26px); box-shadow: 0 22px 44px -34px #31556e66; scroll-margin-top: 20px; }
figcaption { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
figcaption h2 { font-size: 1.16rem; letter-spacing: -.036em; }
figcaption p { margin-top: 5px; color: var(--quiet); line-height: 1.45; font-size: .87rem; }
.axis { font: 700 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 2px; padding: 7px; border: 1px solid #c5d0d4; border-radius: 4px; color: var(--blue); }
.plot { aspect-ratio: 640/318; background: #edf2f1; border: 1px solid #d4dedf; overflow: hidden; border-radius: 8px; }
.plot canvas { display: block; width: 100%; height: 100%; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 5px 16px; align-items: center; padding: 0; min-height: 39px; color: var(--quiet); font-size: .73rem; line-height: 1.4; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 15px; height: 0; border-top: 2px solid var(--blue); }
.legend i.dash { border-top-style: dashed; border-color: #546f88; }
.legend i.deviation { border-color: var(--warn); }
.demo-body { display: grid; grid-template-columns: minmax(143px,1fr) minmax(147px,1.15fr); gap: clamp(10px,1.4vw,18px); align-items: start; }
.program { list-style: none; padding: 8px; background: #f8f5ee; border: 1px solid #e6e1d6; border-radius: 7px; font: 600 .73rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.program li { display: flex; gap: 11px; align-items: center; padding: 2px 5px; border-radius: 3px; white-space: nowrap; }
.program li span { color: var(--quiet); font-weight: 500; }
.program li.fault { color: #863b28; background: #f6e3d8; }
.program li.fixed { color: var(--blue); background: #dfecef; }
.demo-control { min-width: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; background: #f2eee5; border: 1px solid #e3dbcc; border-radius: 7px; padding: 4px; }
.segmented button { border-radius: 4px; min-height: 42px; min-width: 44px; flex: 1 1 auto; padding: 4px 8px; border: 1px solid transparent; line-height: 1.2; font-family: inherit; font-weight: 700; font-size: .77rem; background: transparent; color: var(--blue); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
#result { color: var(--warn); font-size: .83rem; font-weight: 700; line-height: 1.5; margin: 11px 5px 0; min-height: 2.5em; }
.demo[data-state="corrected"] #result { color: var(--blue); }
.lesson-section { border-block: 1px solid #d5dfe2; background: #edf2f1; }
.classroom, .workshop { display: grid; padding-block: clamp(38px,6vw,75px); grid-template-columns: 1.05fr .95fr; gap: clamp(30px,7vw,105px); align-items: start; }
.classroom h2, .workshop h2, .help h2 { font-size: clamp(1.75rem,3.25vw,2.8rem); line-height: 1.11; letter-spacing: -.056em; }
.classroom .lead, .workshop .lead { margin-top: 14px; max-width: 42ch; }
.steps { list-style: none; counter-reset: task; padding: 0; }
.steps li { counter-increment: task; display: flex; align-items: center; gap: 15px; border-top: 1px solid #cfdcde; min-height: 61px; padding-block: 11px; line-height: 1.45; font-weight: 550; }
.steps li:last-child { border-bottom: 1px solid #cfdcde; }
.steps li::before { content: counter(task, decimal-leading-zero); color: var(--blue); font: 700 .71rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: #dfe8eb; padding: 8px; border-radius: 4px; flex: 0 0 auto; }
.scope { align-self: end; border-left: 3px solid var(--yellow); padding-left: 16px; color: var(--quiet); line-height: 1.65; font-size: .89rem; }
footer { border-top: 1px solid var(--rule); }
.footer-inner { padding-block: 12px; }
.languages a[aria-current] { color: var(--ink); font-weight: 650; }
.help { width: min(768px, calc(100% - 48px)); min-height: 65vh; padding-block: 47px 70px; }
.help h1 { margin-top: 0; }
.help .lead { margin: 17px 0 31px; max-width: none; }
.faq { border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule); padding: 9px 4px; }
summary { position: relative; display: block; padding: 12px 37px 12px 0; font-weight: 700; cursor: pointer; line-height: 1.4; }
summary::-webkit-details-marker { display: none; }
summary::after { position: absolute; content: "+"; right: 0; top: 8px; font-size: 1.3em; color: var(--blue); }
details[open] summary::after { content: "−"; }
details p, .contact p, .policy section p { color: var(--quiet); line-height: 1.67; }
details p { padding-bottom: 14px; }
.contact { margin-top: 37px; border: 1px solid #ccd8d9; background: #edf2f1; border-radius: 11px; padding: clamp(18px,4vw,30px); }
.contact h2, .policy section h2 { font-size: 1.42rem; letter-spacing: -.035em; margin-bottom: 10px; }
.contact p { margin-bottom: 16px; }
.contact .email { display: block; margin-top: 14px; overflow-wrap: anywhere; }
.policy section { padding: 19px 0 20px; border-top: 1px solid var(--rule); }
@media (max-width: 910px) {
  .wrap { width: min(760px,calc(100% - 48px)); }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-top: 0; }
  .classroom, .workshop { grid-template-columns: 1fr; gap: 23px; }
  .footer-inner { justify-content: flex-start; column-gap: 38px; }
}
@media (max-width: 460px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { min-height: 64px; }
  .top nav { gap: 14px; }
  h1 { font-size: clamp(2.45rem,10.7vw,3.3rem); }
  .hero { padding-top: 38px; gap: 28px; }
  .demo { padding: 12px; }
  .demo-body { grid-template-columns: 1fr; }
  .legend { padding-block: 6px; }
  .program { margin-top: 3px; }
  .segmented button { min-height: 44px; }
  #result { min-height: initial; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
