@font-face {
  font-family: "Fira Sans Local";
  src: url("assets/fonts/FiraSans-Book.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans Local";
  src: url("assets/fonts/FiraSans-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Mono Local";
  src: url("assets/fonts/NotoSansMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Mono Local";
  src: url("assets/fonts/NotoSansMono-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #101927;
  --ink-soft: #394658;
  --paper: #eef1f2;
  --surface: #f8faf9;
  --surface-2: #dfe5e7;
  --navy: #0b2135;
  --navy-2: #12324d;
  --accent: #e45f2b;
  --accent-dark: #a93612;
  --line: #bdc7cb;
  --good: #336f5a;
  --danger: #a1382f;
  --radius: 14px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --shadow: 0 18px 48px rgb(11 33 53 / .12);
  --max: 1240px;
  --font: "Fira Sans Local", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Noto Sans Mono Local", "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf2f4;
  --ink-soft: #b9c4ca;
  --paper: #0d1822;
  --surface: #142430;
  --surface-2: #213540;
  --navy: #07131d;
  --navy-2: #102b40;
  --accent: #f47745;
  --accent-dark: #ff936a;
  --line: #3e525e;
  --good: #76b69d;
  --danger: #f08b82;
  --shadow: 0 18px 48px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); line-height: 1.55; text-rendering: optimizeLegibility; }
::selection { color: var(--surface); background: var(--accent-dark); }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: .7rem 1rem; transform: translateY(-160%); color: #fff; background: var(--accent-dark); border-radius: 8px; transition: transform 160ms var(--ease-out); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 10; top: 0; min-height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding: .75rem max(1.2rem, calc((100vw - var(--max)) / 2)); color: #f5f8f8; background: rgb(11 33 53 / .94); border-bottom: 1px solid rgb(255 255 255 / .14); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 720; font-size: .84rem; line-height: 1.05; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; align-content: center; gap: 4px; padding: 7px; border: 1px solid rgb(255 255 255 / .35); border-radius: 9px; }
.brand-mark i { height: 2px; display: block; background: var(--accent); transform-origin: left; }
.brand-mark i:nth-child(2) { transform: scaleX(.7); }
.brand-mark i:nth-child(3) { transform: scaleX(.4); }
#main-nav { justify-self: center; display: flex; align-items: center; gap: clamp(.7rem, 2vw, 1.7rem); }
#main-nav a { position: relative; color: #d9e3e7; font-size: .9rem; text-decoration: none; }
#main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.45rem; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease-out); }
#main-nav a:hover::after, #main-nav a[aria-current="true"]::after { transform: scaleX(1); }
.theme-toggle, .nav-toggle, .sim-toggle { min-height: 42px; padding: .55rem .85rem; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 9px; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 180ms ease, color 180ms ease; }
.theme-toggle:hover, .sim-toggle:hover { color: var(--navy); background: #f5f8f8; }
.theme-toggle:active, .nav-toggle:active, .sim-toggle:active, .usb-tabs button:active { transform: scale(.97); }
.nav-toggle { display: none; }

main { overflow: clip; }
.hero { min-height: min(760px, calc(100dvh - 72px)); display: grid; grid-template-columns: .86fr 1.14fr; color: #f6f8f7; background: var(--navy); }
.hero-copy { padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 5.5rem) 4rem max(1.25rem, calc((100vw - var(--max)) / 2)); align-self: center; }
.hero h1 { max-width: 11ch; margin: 0; font-size: clamp(3.6rem, 6.4vw, 5.4rem); line-height: .91; letter-spacing: -.04em; text-wrap: balance; }
.hero-copy > p { max-width: 28rem; margin: 1.5rem 0; color: #c7d2d7; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.primary-link { display: inline-flex; align-items: center; min-height: 48px; padding: .75rem 1rem; color: #fff; background: var(--accent-dark); border-radius: 9px; font-weight: 700; text-decoration: none; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.primary-link:hover { background: #c44318; }
.primary-link:active { transform: scale(.98); }
.hero-signal { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 3rem max(1.25rem, calc((100vw - var(--max)) / 2)) 3rem clamp(1.5rem, 4vw, 4rem); background: var(--navy-2); border-left: 1px solid rgb(255 255 255 / .12); }
.signal-label { color: #91a9b5; font: .72rem var(--mono); letter-spacing: .14em; }
.scope-grid { position: relative; align-self: center; height: clamp(240px, 40vw, 410px); overflow: hidden; border: 1px solid rgb(255 255 255 / .16); border-radius: var(--radius); background-image: linear-gradient(rgb(255 255 255 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .07) 1px, transparent 1px); background-size: 36px 36px; }
.scope-line { position: absolute; left: -5%; width: 110%; height: 20%; top: 22%; background: var(--accent); clip-path: polygon(0 70%, 8% 70%, 8% 22%, 17% 22%, 17% 75%, 25% 75%, 25% 45%, 34% 45%, 34% 12%, 42% 12%, 42% 70%, 52% 70%, 52% 35%, 60% 35%, 60% 78%, 70% 78%, 70% 16%, 78% 16%, 78% 67%, 88% 67%, 88% 40%, 100% 40%, 100% 48%, 89% 48%, 89% 76%, 77% 76%, 77% 24%, 71% 24%, 71% 86%, 59% 86%, 59% 43%, 53% 43%, 53% 78%, 41% 78%, 41% 20%, 35% 20%, 35% 53%, 24% 53%, 24% 83%, 16% 83%, 16% 30%, 9% 30%, 9% 78%, 0 78%); }
.line-b { top: 46%; opacity: .55; transform: scaleY(.7) translateX(5%); }
.line-c { top: 68%; opacity: .28; transform: scaleY(.45) translateX(-4%); }
.hero-signal p { margin: 1.3rem 0 0; color: #c7d2d7; }
.hero-signal strong { color: #fff; }

.chapter, .sources { width: min(calc(100% - 2.5rem), var(--max)); margin-inline: auto; padding: clamp(5rem, 9vw, 8rem) 0; }
.section-heading { max-width: 820px; margin-bottom: clamp(2.3rem, 5vw, 4rem); }
.section-heading h2, .uart-copy h2 { margin: 0 0 1rem; font-size: clamp(2.15rem, 5vw, 4.7rem); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.section-heading p { max-width: 62ch; margin: 0; color: var(--ink-soft); font-size: 1.08rem; }
.compact-heading { max-width: 670px; }

.comparison-stage { overflow: hidden; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.sim-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem .7rem 1.25rem; border-bottom: 1px solid var(--line); }
.sim-toolbar p { margin: 0; color: var(--ink-soft); font: .78rem var(--mono); }
.sim-toggle { color: var(--ink); }
.sim-toggle:hover { color: var(--surface); background: var(--ink); }
.lane-panel { display: grid; grid-template-columns: 260px 1fr; min-height: 240px; border-bottom: 1px solid var(--line); }
.lane-panel:last-child { border-bottom: 0; }
.panel-copy { padding: 2rem; border-right: 1px solid var(--line); }
.panel-copy h3 { margin: 0 0 .6rem; font-size: 1.5rem; }
.panel-copy p { margin: 0; color: var(--ink-soft); }
.lanes, .serial-track { position: relative; align-self: center; height: 176px; margin: 1.5rem 2rem; }
.parallel-lanes { display: grid; grid-template-rows: repeat(8, 1fr); gap: 4px; }
.parallel-lanes::before, .serial-track::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 17px, var(--line) 18px 19px, transparent 20px 22px); opacity: .7; }
.parallel-lanes span, .serial-track span { z-index: 1; align-self: center; width: 24px; height: 24px; display: grid; place-items: center; color: #fff; background: var(--accent-dark); border-radius: 6px; font: 700 .72rem var(--mono); animation: bit-parallel 3s var(--ease-in-out) infinite; animation-delay: calc(var(--i) * 22ms); }
.serial-track { height: 64px; display: flex; align-items: center; }
.serial-track::before { background: linear-gradient(transparent 31px, var(--line) 32px 33px, transparent 34px); }
.serial-track span { position: absolute; left: -1.5rem; animation-name: bit-serial; animation-duration: 5.2s; animation-delay: calc(var(--i) * 560ms); opacity: 0; }
@keyframes bit-parallel { 0% { transform: translateX(0); opacity: .2; } 12% { opacity: 1; } 72% { opacity: 1; } 100% { transform: translateX(calc(100vw - 430px)); opacity: .1; } }
@keyframes bit-serial { 0% { transform: translateX(0); opacity: 0; } 8%, 68% { opacity: 1; } 76%, 100% { transform: translateX(calc(100vw - 430px)); opacity: 0; } }
.paused * { animation-play-state: paused !important; }
.compare-columns { display: grid; grid-template-columns: 1fr 1fr .78fr; gap: 1px; margin-top: 2rem; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.compare-columns > * { padding: 2rem; background: var(--surface); }
.compare-columns h3 { margin-top: 0; }
.compare-columns dl { margin: 0; }
.compare-columns dl div { margin-top: 1rem; }
.compare-columns dt { color: var(--accent-dark); font: 700 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.compare-columns dd { margin: .2rem 0 0; }
.fact-callout { color: #fff; background: var(--accent-dark); }
.fact-callout strong { font-size: 1.3rem; }
.fact-callout p { margin-bottom: 0; }

.uart-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; margin-top: clamp(6rem, 10vw, 10rem); }
.uart-copy h2 { font-size: clamp(2.3rem, 4.6vw, 4.1rem); }
.uart-copy > p { color: var(--ink-soft); font-size: 1.08rem; }
.compact-list { padding: 0; list-style: none; }
.compact-list li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.warning-note, .context-note { margin-top: 1.5rem; padding: 1rem 1.2rem; color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-radius: var(--radius); }
details { margin-top: 1rem; background: var(--surface); border-radius: var(--radius); }
summary { padding: 1rem 1.2rem; font-weight: 700; cursor: pointer; }
details p { padding: 0 1.2rem 1.2rem; margin: 0; color: var(--ink-soft); }
.uart-frame { min-width: 0; margin: 0; padding: clamp(1.2rem, 3vw, 2.5rem); color: #f5f8f8; background: var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); }
.uart-frame figcaption { margin-bottom: 2rem; color: #c8d5da; }
.uart-frame code { color: #ff9d78; }
.frame-bits { display: grid; grid-template-columns: repeat(10, minmax(54px, 1fr)); overflow-x: auto; padding-bottom: 1rem; }
.frame-bits span { min-height: 116px; display: grid; place-items: center; align-content: center; border: 1px solid #547081; border-right: 0; }
.frame-bits span:first-child { border-radius: 9px 0 0 9px; }
.frame-bits span:last-child { border-right: 1px solid #547081; border-radius: 0 9px 9px 0; }
.frame-bits b { font: 700 1.2rem var(--mono); }
.frame-bits small { margin-top: .45rem; color: #9eb1bb; font: .68rem var(--mono); }
.frame-bits .start, .frame-bits .stop { background: var(--accent-dark); border-color: #ff976e; }
.frame-bits .start small, .frame-bits .stop small { color: #fff; }
.uart-frame > p { color: #aebdc5; font-size: .86rem; }

.direction-lab { overflow: hidden; color: #f4f7f7; background: var(--navy); border: 1px solid rgb(255 255 255 / .15); border-radius: var(--radius); box-shadow: var(--shadow); }
.dark-toolbar { border-color: rgb(255 255 255 / .14); }
.dark-toolbar p { color: #b8c8cf; }
.light-button { color: #fff; }
.direction-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.direction-mode { min-width: 0; padding: clamp(1.4rem, 3vw, 2.5rem); border-right: 1px solid rgb(255 255 255 / .14); }
.direction-mode:last-child { border: 0; }
.direction-mode h3 { margin: 0; font-size: 1.55rem; }
.direction-mode p { color: #b9c9d0; }
.direction-mode small { color: #97abb4; }
.flow { height: 150px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 1rem; }
.flow b { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #86a1ae; border-radius: 50%; }
.flow span { position: relative; height: 2px; background: #587687; }
.flow span::before, .flow span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 50%; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); animation: flow-right 2.4s linear infinite; }
.flow span::after { display: none; }
.flow .two-way::after { display: block; animation-name: flow-left; }
.flow .alternate::before { animation-name: flow-right-half; animation-duration: 4.8s; }
.flow .alternate::after { animation-name: flow-left-half; animation-duration: 4.8s; }
@keyframes flow-right { from { left: 0; } to { left: 100%; } }
@keyframes flow-left { from { left: 100%; } to { left: 0; } }
@keyframes flow-right-half { 0% { left: 0; opacity: 0; } 4%, 46% { opacity: 1; } 50%, 100% { left: 100%; opacity: 0; } }
@keyframes flow-left-half { 0%, 50% { left: 100%; opacity: 0; } 54%, 96% { opacity: 1; } 100% { left: 0; opacity: 0; } }

.usb-explorer { display: grid; grid-template-columns: 210px 1fr; background: var(--navy); color: #f5f8f8; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.usb-tabs { display: grid; align-content: start; padding: .75rem; border-right: 1px solid rgb(255 255 255 / .14); }
.usb-tabs button { min-height: 50px; padding: .7rem 1rem; color: #b8c8cf; text-align: left; background: transparent; border: 0; border-radius: 9px; cursor: pointer; transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease; }
.usb-tabs button[aria-selected="true"] { color: #fff; background: var(--accent-dark); font-weight: 700; }
.usb-readout { min-height: 280px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.usb-readout > div { padding: clamp(1.5rem, 4vw, 3.5rem); }
.usb-readout > div:first-child { border-right: 1px solid rgb(255 255 255 / .14); }
.usb-readout span { color: #a8bac3; font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.usb-readout strong { display: block; margin: .6rem 0; color: #ff9d78; font-size: clamp(2.4rem, 5vw, 4.7rem); line-height: .95; letter-spacing: -.04em; }
.usb-readout small { color: #a8bac3; }
.usb-readout h3 { margin: .6rem 0; font-size: 1.7rem; }
.usb-readout p { margin: 0; color: #c4d0d5; }
.usb-note { grid-column: 1 / -1; margin: 0; padding: 1rem 1.25rem; color: #c2d0d6; background: #071b2b; font-size: .86rem; }
.unit-explainer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; align-items: center; margin: 2rem 0 6rem; padding: 2rem; border-bottom: 1px solid var(--line); }
.big-equation { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.big-equation strong { font-size: clamp(1.8rem, 4vw, 3.4rem); letter-spacing: -.03em; }
.big-equation span { color: var(--accent-dark); font: .76rem var(--mono); text-transform: uppercase; }
.unit-explainer p { color: var(--ink-soft); }
.connector-map { display: grid; grid-template-columns: .75fr 1.25fr; gap: 4rem; align-items: center; }
.connector-intro h3 { margin: 0 0 .8rem; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1; }
.connector-intro p { color: var(--ink-soft); }
.connector-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.connector-shapes > div { min-width: 0; display: grid; justify-items: center; text-align: center; }
.shape { width: 100%; max-width: 120px; height: 74px; display: block; margin-bottom: 1rem; background: var(--surface); border: 6px solid var(--ink); box-shadow: inset 0 0 0 4px var(--surface-2); }
.type-b { clip-path: polygon(15% 0, 85% 0, 100% 22%, 100% 100%, 0 100%, 0 22%); }
.micro { height: 54px; margin-top: 20px; clip-path: polygon(8% 0, 92% 0, 100% 35%, 92% 100%, 8% 100%, 0 35%); }
.type-c { height: 56px; margin-top: 18px; border-radius: 28px; }
.connector-shapes small { color: var(--ink-soft); }

.history { width: 100%; max-width: none; padding-inline: max(1.25rem, calc((100vw - var(--max)) / 2)); background: var(--surface-2); }
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 35%); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem 0 2rem; scrollbar-color: var(--accent) var(--surface); }
.timeline article { scroll-snap-align: start; display: grid; grid-template-rows: 260px auto; overflow: hidden; background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(11 33 53 / .1); }
.timeline figure { position: relative; margin: 0; overflow: hidden; background: #c7cfd2; }
.timeline img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.05); transition: transform 360ms var(--ease-out), filter 220ms ease; }
.timeline figcaption { position: absolute; left: 1rem; bottom: 1rem; padding: .4rem .55rem; color: #fff; background: rgb(11 33 53 / .9); border-radius: 7px; font: .7rem var(--mono); }
.timeline article > div { padding: 1.4rem; }
.timeline h3 { margin: 0 0 .5rem; font-size: 1.45rem; }
.timeline p { margin: 0; color: var(--ink-soft); }
@media (hover: hover) and (pointer: fine) { .timeline article:hover img { transform: scale(1.035); filter: saturate(1) contrast(1.03); } }

.lane-scale { display: grid; gap: .8rem; padding: 2rem; color: #fff; background: var(--navy); border-radius: var(--radius); }
.lane-scale > div { display: grid; grid-template-columns: 1fr 54px 150px; align-items: center; gap: 1rem; }
.lane-scale span { width: var(--w); height: 18px; display: block; background: var(--accent); border-radius: 5px; }
.lane-scale b { font: 700 1rem var(--mono); }
.lane-scale small { color: #afc0c8; }
.pcie-generations { margin: 2rem 0 6rem; }
.pcie-generations h3 { font-size: 1rem; }
.gen-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; overflow: hidden; background: var(--line); border-radius: var(--radius); }
.gen-strip span { padding: 1rem; background: var(--surface); font: .75rem var(--mono); }
.gen-strip b { display: block; margin-bottom: .35rem; color: var(--accent-dark); font-size: 1rem; }
.format-photo { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.format-photo figure { margin: 0; }
.format-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.format-photo figcaption { margin-top: .7rem; color: var(--ink-soft); font-size: .82rem; }
.format-photo h3 { margin: 0; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -.03em; }
.format-photo p { color: var(--ink-soft); }
.table-wrap { margin-top: 4rem; overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { padding: 1rem 1.25rem; color: #d4dfe3; background: var(--navy); text-align: left; font-weight: 700; }
th, td { padding: 1rem 1.25rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { color: var(--ink-soft); font: 700 .72rem var(--mono); text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { color: var(--accent-dark); }

.wireless { width: 100%; max-width: none; padding-inline: max(1.25rem, calc((100vw - var(--max)) / 2)); background: var(--surface); }
.wifi-spectrum { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.spectrum-heading { grid-column: 1 / -1; max-width: 650px; }
.spectrum-heading h3 { margin: 0; font-size: 1.8rem; }
.spectrum-heading p { color: var(--ink-soft); }
.band { min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem; color: #fff; border-radius: var(--radius); background: var(--navy); }
.band b { font-size: clamp(1.7rem, 3vw, 2.7rem); }
.band span { margin-top: .3rem; }
.band small { margin-top: .8rem; color: #b7c6cd; }
.band5 { background: #173b54; }
.band6 { color: #25170e; background: #e78859; }
.band6 small { color: #3f2113; }
.wifi-table-wrap { box-shadow: none; border: 1px solid var(--line); }
.wifi-table tbody tr:nth-child(7), .wifi-table tbody tr:nth-child(8) { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.table-note { max-width: 78ch; margin: .8rem 0 0; color: var(--ink-soft); font-size: .82rem; }
.context-note { max-width: 860px; }
.security-scale { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; align-items: center; margin: 6rem 0; padding: 2rem; background: var(--paper); border-radius: var(--radius); }
.security-scale h3 { margin: 0; font-size: 1.8rem; }
.security-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.security-items span { padding: 1rem; background: var(--surface); }
.security-items b, .security-items small { display: block; }
.security-items .avoid b { color: var(--danger); text-decoration: line-through; }
.security-items .best b { color: var(--good); }
.security-scale > p { grid-column: 2; margin: 0; color: var(--ink-soft); }
.bluetooth-compare { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.bluetooth-copy h3 { margin-top: 0; font-size: clamp(2.2rem, 4vw, 3.8rem); line-height: 1; letter-spacing: -.03em; }
.bluetooth-copy p { color: var(--ink-soft); }
.comparison-matrix { min-width: 0; border-top: 1px solid var(--accent); }
.comparison-matrix > div { display: grid; grid-template-columns: .7fr 1fr 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comparison-matrix .matrix-head { font-size: 1.3rem; }
.comparison-matrix strong { color: var(--ink-soft); font: .74rem var(--mono); text-transform: uppercase; }
.pairing-advice { display: grid; grid-template-columns: .6fr 1fr 1fr; gap: 2rem; align-items: start; margin-top: 4rem; padding: 2rem; color: #fff; background: var(--accent-dark); border-radius: var(--radius); }
.pairing-advice strong { font-size: 1.5rem; }
.pairing-advice p { margin: 0; }

.sources { padding-bottom: 4rem; }
.sources h2 { margin: 0 0 2rem; font-size: 2rem; }
.sources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.sources-grid h3 { font-size: 1rem; }
.sources-grid ul { padding-left: 1.2rem; }
.sources-grid li { margin-bottom: .6rem; color: var(--ink-soft); font-size: .88rem; }
.source-disclaimer { max-width: 80ch; margin-top: 2rem; color: var(--ink-soft); font-size: .82rem; }
footer { min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem max(1.25rem, calc((100vw - var(--max)) / 2)); color: #c4d1d6; background: var(--navy); }
footer p { margin: 0; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: auto auto 1fr; gap: .8rem; }
  .nav-toggle { display: inline-flex; justify-self: end; color: #fff; }
  .theme-toggle { justify-self: end; }
  #main-nav { position: absolute; top: 100%; left: 1rem; right: 1rem; display: grid; gap: .3rem; padding: .8rem; background: var(--navy-2); border: 1px solid rgb(255 255 255 / .15); border-radius: var(--radius); box-shadow: var(--shadow); transform-origin: top right; transition: opacity 160ms ease, transform 180ms var(--ease-out); }
  #main-nav:not([data-open="true"]) { visibility: hidden; opacity: 0; transform: scale(.97) translateY(-8px); }
  #main-nav a { padding: .7rem; }
  .hero { grid-template-columns: 1fr 1.15fr; }
  .compare-columns { grid-template-columns: 1fr 1fr; }
  .fact-callout { grid-column: 1 / -1; }
  .connector-map { grid-template-columns: 1fr; gap: 2rem; }
  .format-photo, .bluetooth-compare { grid-template-columns: 1fr; }
  .timeline { grid-auto-columns: minmax(300px, 55%); }
  .security-scale { grid-template-columns: 1fr; }
  .security-scale > p { grid-column: auto; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 72px; }
  .site-header { min-height: 66px; padding-inline: 1rem; }
  .brand { font-size: 0; gap: 0; }
  .brand-mark { width: 38px; height: 38px; }
  .nav-toggle, .theme-toggle { min-height: 40px; padding: .45rem .65rem; font-size: .82rem; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-copy { min-height: 520px; display: grid; align-content: center; padding: 4rem 1.25rem; }
  .hero h1 { font-size: clamp(3.45rem, 17vw, 5.2rem); }
  .hero-signal { min-height: 420px; padding: 2rem 1.25rem; border-left: 0; border-top: 1px solid rgb(255 255 255 / .12); }
  .chapter, .sources { width: min(calc(100% - 2rem), var(--max)); padding: 4.5rem 0; }
  .history, .wireless { width: 100%; padding-inline: 1rem; }
  .section-heading h2, .uart-copy h2 { font-size: clamp(2.35rem, 12vw, 3.7rem); }
  .lane-panel { grid-template-columns: 1fr; min-height: 270px; }
  .panel-copy { padding: 1.2rem 1.4rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .lanes, .serial-track { margin: 1rem 1.4rem; }
  @keyframes bit-parallel { 0% { transform: translateX(0); opacity: .2; } 12%, 72% { opacity: 1; } 100% { transform: translateX(calc(100vw - 100px)); opacity: .1; } }
  @keyframes bit-serial { 0% { transform: translateX(0); opacity: 0; } 8%, 68% { opacity: 1; } 76%, 100% { transform: translateX(calc(100vw - 100px)); opacity: 0; } }
  .compare-columns, .uart-layout, .direction-grid, .usb-readout, .unit-explainer, .connector-map, .format-photo, .wifi-spectrum, .bluetooth-compare, .sources-grid, .pairing-advice { grid-template-columns: 1fr; }
  .fact-callout { grid-column: auto; }
  .uart-layout { margin-top: 5rem; }
  .direction-mode { border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .14); }
  .usb-explorer { grid-template-columns: 1fr; }
  .usb-tabs { grid-template-columns: repeat(6, minmax(92px, 1fr)); overflow-x: auto; border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .14); }
  .usb-readout > div:first-child { border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .14); }
  .unit-explainer { gap: 1rem; padding-inline: 0; }
  .connector-shapes { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .timeline { grid-auto-columns: 86%; }
  .gen-strip { grid-template-columns: repeat(2, 1fr); }
  .lane-scale { padding: 1.2rem; }
  .lane-scale > div { grid-template-columns: 1fr 42px; }
  .lane-scale small { grid-column: 1 / -1; }
  .spectrum-heading { grid-column: auto; }
  .security-items { grid-template-columns: 1fr 1fr; }
  .comparison-matrix { overflow-x: auto; }
  .comparison-matrix > div { min-width: 650px; }
  .pairing-advice { gap: 1rem; }
  th, td { min-width: 160px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .parallel-lanes span { transform: translateX(35vw); opacity: 1; }
  .serial-track span { position: relative; left: 0; margin-right: .35rem; opacity: 1; transform: none; }
  .flow span::before { left: 70%; }
  .flow .two-way::after { left: 30%; }
}

@media (prefers-contrast: more) {
  :root { --line: #65727b; }
  .site-header, .directions, .lane-scale, .uart-frame, .usb-explorer, footer { border: 2px solid currentColor; }
}
