:root {
  --ink: #152131;
  --muted: #5c6b7d;
  --line: #d9e0e7;
  --canvas: #f5f7f9;
  --paper: #ffffff;
  --blue: #1268c5;
  --blue-dark: #0a447f;
  --green: #16845a;
  --purple: #7045b5;
  --orange: #d55a18;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(217, 224, 231, 0.92); background: rgba(245, 247, 249, 0.94); backdrop-filter: blur(12px); }
.nav { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 850; }
.brand-mark { display: flex; gap: 4px; }
.brand-mark i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.brand-mark i:nth-child(2) { background: var(--purple); }
.brand-mark i:nth-child(3) { background: var(--orange); }
.nav-links { display: flex; gap: 22px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.nav-links a:hover { color: var(--blue); }

.hero { padding: 70px 0 46px; text-align: center; background: var(--paper); }
.eyebrow, .kicker { margin-bottom: 9px; color: var(--blue); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { max-width: 1940px; margin: 0 auto; font-size: clamp(2.35rem, 5vw, 4.2rem); line-height: 1.07; }
.lede { max-width: 760px; margin: 19px auto 0; color: #455469; font-size: clamp(1.06rem, 2vw, 1.25rem); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 0.92rem; font-weight: 800; }
.button:hover { border-color: #9db9d7; color: var(--blue); }
.button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button.primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }

section { scroll-margin-top: 70px; }
.section { padding: 66px 0; }
.section.paper { background: var(--paper); }
.heading { max-width: 1360px; margin-bottom: 28px; }
h2 { margin-bottom: 10px; font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { margin-bottom: 5px; font-size: 1.02rem; }
.copy { margin-bottom: 0; color: var(--muted); }

.overview { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr); column-gap: 38px; row-gap: 22px; align-items: start; }
.overview-intro { grid-column: 1 / -1; max-width: 1360px; }
.overview-copy { color: #3f4e60; font-size: 1.02rem; }
.points { display: grid; grid-column: 1; gap: 12px; margin: 0; padding: 0; list-style: none; }
.points li { padding-left: 20px; position: relative; }
.planner-list, .checker-list, .execution-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.planner-list li, .checker-list li, .execution-list li { padding-left: 16px; }
.points .planner-list li::before, .points .checker-list li::before, .points .execution-list li::before { top: 0.56em; width: 5px; height: 5px; border-width: 1px; }
.execution-note { display: block; margin-top: 8px; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.61em; width: 8px; height: 8px; border: 2px solid var(--blue); border-radius: 50%; }
.framework { grid-column: 2; grid-row: 2; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(21, 33, 49, 0.06); }
.framework img { display: block; width: 100%; height: auto; padding: clamp(12px, 2vw, 22px); border: 1px solid #e7edf3; border-radius: 4px; background: #fff; }
.framework figcaption { margin: 9px 3px 0; color: var(--muted); font-size: 0.82rem; }

.layers { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.layer { min-height: 152px; padding: 18px 19px; border-right: 1px solid var(--line); }
.layer:last-child { border-right: 0; }
.layer-label { display: block; margin-bottom: 21px; color: var(--blue); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.layer:nth-child(2) .layer-label { color: var(--green); }
.layer:nth-child(3) .layer-label { color: var(--purple); }
.layer:nth-child(4) .layer-label { color: var(--orange); }
.layer p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.regimes { margin: 22px 0 0; color: var(--muted); font-size: 0.93rem; }
.regimes strong { color: var(--ink); }

.protocol-heading { max-width: 1360px; }
.protocol-block + .protocol-block { margin-top: 38px; }
.protocol-block > h3 { margin-bottom: 13px; font-size: 1.08rem; }
.table-scroll { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; color: #354457; font-size: 0.86rem; line-height: 1.45; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid #e7edf3; text-align: left; vertical-align: top; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
.data-table thead th { background: #f1f5f8; color: var(--ink); font-size: 0.76rem; font-weight: 850; text-transform: uppercase; }
.data-table tbody th { color: var(--ink); font-weight: 850; white-space: nowrap; }
.data-table code, .spec-grid code { padding: 1px 4px; border-radius: 3px; background: #edf2f6; color: #26384b; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.86em; }
.task-table { min-width: 760px; }
.settings-table { min-width: 820px; }
.adapter-table { min-width: 900px; }
.table-note { margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; }
.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.spec-grid > div { min-height: 116px; padding: 15px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec-grid dt { margin-bottom: 6px; color: var(--blue-dark); font-size: 0.75rem; font-weight: 850; text-transform: uppercase; }
.spec-grid dd { margin: 0; color: var(--muted); font-size: 0.86rem; }

.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.takeaway { min-height: 180px; padding: 19px 24px 19px 0; border-right: 1px solid var(--line); }
.takeaway + .takeaway { padding-left: 24px; }
.takeaway:last-child { border-right: 0; }
.stat { display: block; margin-bottom: 10px; color: var(--blue); font-size: 2.25rem; font-weight: 850; line-height: 1; }
.takeaway p { margin-bottom: 0; color: var(--muted); font-size: 0.92rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.tab { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #4e5e71; font-size: 0.89rem; font-weight: 800; cursor: pointer; }
.tab:hover, .tab[aria-selected="true"] { border-color: var(--blue); background: #edf5fd; color: var(--blue); }
.figure-panel[hidden] { display: none; }
.figure-switcher { display: flex; width: fit-content; max-width: 100%; gap: 3px; margin-bottom: 16px; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: #eaf0f5; }
.figure-tab { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 800; cursor: pointer; }
.figure-tab:hover { color: var(--ink); }
.figure-tab[aria-selected="true"] { background: var(--paper); color: var(--blue-dark); box-shadow: 0 1px 4px rgba(21, 33, 49, 0.14); }
.tab:focus-visible, .figure-tab:focus-visible { outline: 3px solid rgba(18, 104, 197, 0.28); outline-offset: 2px; }
.figure-view[hidden] { display: none; }
.figure-stack { display: grid; gap: 20px; }
.plot { margin: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(21, 33, 49, 0.05); }
.plot-media { display: block; overflow-x: auto; border-bottom: 1px solid #e7edf3; background: #fff; cursor: zoom-in; }
.plot-media img { display: block; width: 100%; height: auto; padding: clamp(14px, 2.4vw, 28px); background: #fff; }
.plot figcaption { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 13px 16px 15px; color: var(--muted); font-size: 0.84rem; }
.plot figcaption strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 0.9rem; }
.figure-caption-copy { min-width: 0; }
.figure-source { display: flex; flex: 0 0 auto; gap: 12px; font-size: 0.76rem; font-weight: 800; }
.figure-source a { color: var(--blue); }
.figure-source a:hover { color: var(--blue-dark); text-decoration: underline; }

.scene-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.scene { margin: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--paper); box-shadow: 0 6px 18px rgba(21, 33, 49, 0.05); }
.scene img { display: block; width: 100%; aspect-ratio: 1; padding: 10px; border-bottom: 1px solid #e7edf3; background: #fff; object-fit: cover; }
.scene figcaption { padding: 9px 10px 11px; color: var(--muted); font-size: 0.79rem; }

footer { padding: 24px 0 32px; color: var(--muted); font-size: 0.83rem; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
footer a { color: var(--blue); font-weight: 750; }

@media (max-width: 840px) {
  .overview { grid-template-columns: 1fr; }
  .overview-intro, .points, .framework { grid-column: auto; grid-row: auto; }
  .layers { grid-template-columns: repeat(2, 1fr); }
  .layer:nth-child(2) { border-right: 0; }
  .layer:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .container { width: min(100% - 28px, 1120px); }
  .nav-links { display: none; }
  .hero { padding: 54px 0 38px; }
  .section { padding: 52px 0; }
  .layers, .takeaways { grid-template-columns: 1fr; }
  .layer, .layer:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .layer:last-child { border-bottom: 0; }
  .takeaway, .takeaway + .takeaway { min-height: auto; padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .takeaway:last-child { border-bottom: 0; }
  .spec-grid { grid-template-columns: 1fr; }
  .spec-grid > div { min-height: auto; }
  .figure-switcher { width: 100%; }
  .plot-media img { width: 660px; max-width: none; }
  .plot figcaption { display: block; }
  .figure-source { margin-top: 9px; }
  .scene-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-row { display: block; }
  .footer-row p + p { margin-top: 8px; }
}
