@font-face {
  font-family: "Space Grotesk";
  src: url("space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root { --font-sans: "Space Grotesk", "Segoe UI", Arial, sans-serif; --study-accent: #8dd9ed; }
[data-theme="light"] { --study-accent: #00647f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-background);
  font: 400 var(--font-size-body)/var(--line-height-normal) var(--font-sans);
  text-rendering: geometricPrecision;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--color-ink-strong); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent-strong); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, .scroll:focus-visible, input:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 3px; }
::selection { color: var(--color-selection-text); background: var(--color-selection-bg); }
.skip { position: fixed; z-index: 10; left: 1rem; top: -5rem; padding: .8rem; color: var(--color-ink-strong); background: var(--color-surface-strong); }
.skip:focus { top: .5rem; }
.dock, main, footer { width: min(var(--container-width), calc(100% - 32px)); margin-inline: auto; }
.dock {
  position: sticky; top: 16px; z-index: 5; margin-top: 16px; padding: 12px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  border: 1px solid var(--color-line); border-radius: var(--radius-dock);
  background: var(--color-header-surface); box-shadow: var(--shadow-card);
}
.brand, .actions, .routes, .resources, .view, .switch, .identity { display: flex; align-items: center; }
.brand { justify-self: start; gap: 12px; font-weight: 600; letter-spacing: .01em; }
.brand img { border-radius: 50%; object-fit: cover; }
.routes, .switch { padding: 4px; border: 1px solid var(--color-line); background: var(--color-control-surface-soft); border-radius: 999px; }
.routes { gap: 4px; justify-content: center; }
.routes a, .switch button { border: 1px solid transparent; border-radius: 999px; color: var(--color-muted); background: transparent; font-weight: 600; }
.routes a { display: grid; place-items: center; white-space: nowrap; min-height: 34px; padding: 0 14px; font-size: .8125rem; }
.routes [aria-current], .switch button[aria-pressed="true"] { border-color: var(--hover-base-1-selected-border); background: var(--hover-base-1-selected-surface); color: var(--hover-base-1-selected-text); }
.routes a:hover, .switch button:hover, .resources a:hover, .icon:hover { background: var(--hover-base-1-hover-surface); color: var(--hover-base-1-hover-text); }
.actions { justify-self: end; gap: 8px; }
.icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--color-line); border-radius: 50%; background: var(--color-control-surface); }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.theme-icon { width: 15px; height: 15px; border: 1.7px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.appearance { position: relative; }
.appearance fieldset { position: absolute; right: 0; top: 48px; width: 148px; margin: 0; padding: .75rem; border: 1px solid var(--color-line-strong); border-radius: var(--radius-panel); background: var(--color-menu-surface); box-shadow: var(--shadow-soft); }
.appearance legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.appearance label { display: flex; align-items: center; gap: .5rem; padding: .35rem; cursor: pointer; }
.appearance input { accent-color: var(--color-accent); }
main { padding-top: 40px; }
.panel { border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-surface); box-shadow: var(--shadow-card); }
.intro { position: relative; padding: clamp(24px,4vw,40px); margin-bottom: 24px; border-color: var(--color-line-strong); background: var(--color-surface-strong); box-shadow: var(--shadow-soft); }
.intro > div:first-child { max-width: calc(100% - 225px); }
h1 { font-size: var(--font-size-page-title); line-height: 1.06; font-weight: 700; letter-spacing: .01em; }
.intro p { max-width: 68ch; margin-top: 20px; color: var(--color-muted); font-size: .9375rem; line-height: 1.65; }
.view { position: absolute; top: 16px; right: 16px; gap: 8px; }
.view > span, .identity, .disclosure summary strong { text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; font-weight: 700; }
.view > span { color: var(--color-subtle); }
.switch { padding: 3px; }
.switch button { min-height: 44px; min-width: 94px; font-size: .75rem; }
.study { display: grid; grid-template-columns: minmax(280px,.82fr) minmax(0,1.18fr); overflow: hidden; }
.visual { display: grid; align-content: center; gap: 14px; padding: clamp(18px,3vw,36px); background: #030e1c; border-right: 1px solid var(--color-line); color: #e7eff8; }
.visual figcaption { color: #b5cbd9; text-align: center; font-weight: 600; font-size: .8125rem; }
.diagram { border: 1px solid #344e63; background: #0c1e30; box-shadow: 0 8px 24px #02081360; border-radius: 12px; overflow: hidden; }
.diagram-head, .scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diagram-head { padding: 13px 20px; border-bottom: 1px solid #314458; }
.file, code, .branch { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.branch { color: #9fb9c9; }
.commits { list-style: none; margin: 0; padding: 24px 20px; }
.commits li { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.commits li + li { margin-top: 20px; }
.commits li:first-child:before { content: ""; position: absolute; top: 14px; height: calc(100% + 15px); left: 5px; width: 1px; background: #67869e; }
.dot { width: 11px; height: 11px; margin-top: 6px; flex: none; border: 2px solid #8ccae6; border-radius: 50%; background: #0c1e30; z-index: 1; }
.commits li:last-child .dot { background: #8ccae6; }
.commits small, .scope span { font-size: .75rem; color: #a5bdcc; }
.commits strong { display: block; font-size: 1.1rem; font-weight: 600; }
.commits code { display: block; padding-top: 4px; }
.added { color: #9ee5c5; } .removed { color: #f3b4a9; }
.scope { padding: 12px 20px; border-top: 1px solid #314458; background: #10263a; }
.scope strong { display: block; color: #d9e5ee; font-size: .88rem; font-weight: 500; }
.content { align-self: start; padding: clamp(24px,3.4vw,40px); }
.identity { gap: 10px; color: var(--study-accent); margin-bottom: 12px; }
.gitmark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--color-ink-strong); background: var(--color-control-surface-strong); border: 1px solid var(--color-line); font-family: ui-monospace, Menlo, monospace; text-transform: none; letter-spacing: 0; font-size: .9rem; }
h2 { font-weight: 700; line-height: 1.15; font-size: var(--font-size-research-title); }
.subtitle { font-size: .8125rem; font-weight: 600; color: var(--color-subtle); margin: 6px 0 22px; }
.summary { font-size: .9375rem; color: var(--color-muted); line-height: 1.65; }
.finding { margin: 16px 0 20px; padding: 9px 12px; font-weight: 600; font-size: .8125rem; border-radius: 8px; border: 1px solid var(--color-impact-border); background: var(--color-impact-surface); color: var(--study-accent); }
.disclosure { border-block-start: 1px solid var(--color-line); }
.disclosure summary { display: flex; gap: 12px; align-items: center; min-height: 74px; padding: 12px 6px; }
.disclosure summary:after { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); margin: 0 10px; }
.disclosure[open] summary:after { transform: rotate(225deg); }
.disclosure summary > span:first-child { flex: 1; }
.disclosure summary strong { display: block; color: var(--study-accent); }
.disclosure summary span span { display: block; margin-top: 3px; color: var(--color-muted); font-weight: 600; }
.chip { font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--color-chip-accent-border); background: var(--color-chip-accent-surface); color: var(--study-accent); }
.inside { padding: 2px 6px 16px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
caption { text-align: left; margin: 0 0 8px; color: var(--color-muted); }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--color-line); }
thead { background: var(--color-control-surface); }
th { font-weight: 600; }
.evidence, .method p { margin: 10px 0; color: var(--color-muted); line-height: 1.6; }
.evidence a { text-decoration: underline; white-space: nowrap; }
.method h3 { font-size: 1rem; margin-top: 12px; }
.resources { border-top: 1px solid var(--color-line); padding-top: 18px; flex-wrap: wrap; gap: 8px; }
.resources a, footer a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--color-line); background: var(--color-control-surface); font-size: .8125rem; font-weight: 600; }
footer { margin: 40px auto 16px; padding: 12px 16px; border: 1px solid var(--color-line); border-radius: var(--radius-dock); background: var(--color-glass-blob); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .8125rem; color: var(--color-muted); }
@media(max-width:980px) {
  html { scroll-padding-top: 16px; }
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .dock { position: fixed; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); margin: 0; display: flex; justify-content: center; gap: 5px; padding: 6px; }
  .brand,.actions > a { display: none; }
  .routes { overflow-x: auto; justify-content: start; border: 0; background: transparent; padding: 0; gap: 2px; }
  .routes a { min-height: 40px; padding: 0 9px; }
  .appearance fieldset { top: auto; bottom: 48px; }
}
@media(max-width:920px) {
  .study { grid-template-columns: 1fr; }
  .visual { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .diagram { width: min(100%,480px); margin-inline: auto; }
}
@media(max-width:860px) {
  main, footer { width: calc(100% - 24px); }
  main { padding-top: 24px; }
  .intro { padding: 24px; }
  .intro > div:first-child { max-width: none; }
  .view { position: static; margin-top: 16px; }
}
@media(max-width:520px) {
  .content { padding: 20px 16px; }
  .visual { padding: 18px 16px; }
  .commits { padding: 16px 18px; }
  .commits li + li { margin-top: 12px; }
  .commits li:first-child:before { height: calc(100% + 7px); }
  footer { flex-wrap: wrap; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
