/* EbikesX - network skeleton (SolarSystemOS structure), light reference ground.
   Layout: sticky head, hero with the legal-ladder speed axis as signature art, data strip,
   sticky contents sidebar, tables banded by legal class. */

:root {
  --bg: #F2F5F4;
  --bg-2: #E7ECEA;
  --panel: #FFFFFF;
  --line: #CFD7D4;
  --line-soft: #DEE4E2;
  --fg: #121A1F;
  --fg-2: #3A4850;
  --fg-3: #66757D;
  --head: #1F4E62;
  --link: #0F5C73;
  --hero: #E4EBE8;
  --grid: rgba(31,78,98,.07);
  /* legal ladder - the one color system that carries meaning */
  --l-scoot: #6553D0;
  --l-bike: #0E8A70;
  --l-gray: #B97B05;
  --l-moped: #C9481F;
  --l-moto: #5A6870;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --wrap: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1316; --bg-2: #141B1F; --panel: #172025; --line: #2A363C; --line-soft: #212B30;
    --fg: #E5ECEE; --fg-2: #A9B6BC; --fg-3: #7C8A91; --head: #A9C1D6; --link: #8FC9DB;
    --hero: #0B1013; --grid: rgba(169,193,214,.06);
    --l-scoot: #9B8FF2; --l-bike: #39C4A2; --l-gray: #EDB23A; --l-moped: #F07A50; --l-moto: #8B9AA3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1316; --bg-2: #141B1F; --panel: #172025; --line: #2A363C; --line-soft: #212B30;
  --fg: #E5ECEE; --fg-2: #A9B6BC; --fg-3: #7C8A91; --head: #A9C1D6; --link: #8FC9DB;
  --hero: #0B1013; --grid: rgba(169,193,214,.06);
  --l-scoot: #9B8FF2; --l-bike: #39C4A2; --l-gray: #EDB23A; --l-moped: #F07A50; --l-moto: #8B9AA3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- header ---------- */
.head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.head__in { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.logo svg { width: 28px; height: 28px; }
.logo__word { font-family: var(--display); font-variation-settings: "wdth" 112; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo__word span { color: var(--l-bike); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--fg-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--l-bike); }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); font: 500 14px var(--body); padding: 6px 12px; cursor: pointer; }

/* ---------- home hero ---------- */
.hero { position: relative; background: var(--hero); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; }
.hero__in { position: relative; padding-block: 64px 28px; }
.hero h1 { font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 750; font-size: clamp(34px, 5.2vw, 64px); line-height: 1.02; letter-spacing: -.02em; margin: 14px 0 20px; max-width: 16ch; }
.hero__sub { font-size: clamp(17px, 1.5vw, 19.5px); color: var(--fg-2); max-width: 62ch; margin: 0; }
.hero__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--fg); color: var(--bg); background: var(--fg); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }

.ladder { margin-top: 36px; overflow-x: auto; }
.ladder svg { display: block; width: 100%; min-width: 760px; height: auto; }
.ladder text { font-family: var(--mono); }

.meta { position: relative; border-top: 1px solid var(--line); }
.meta__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.meta__c { padding: 16px 20px; border-left: 1px solid var(--line); }
.meta__c:first-child { border-left: 0; padding-left: 0; }
.meta__v { font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.meta__v em { font-style: normal; color: var(--fg-3); font-size: 13px; }

/* ---------- home sections ---------- */
.sec { padding-block: 72px; border-bottom: 1px solid var(--line-soft); }
.sec__k { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--head); display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.sec__k::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.sec h2 { font-family: var(--display); font-variation-settings: "wdth" 110; font-weight: 700; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.015em; color: var(--fg); margin: 0 0 12px; max-width: 26ch; }
.sec__lede { color: var(--fg-2); max-width: 64ch; margin: 0 0 36px; }

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pillar { background: var(--panel); padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pillar--wide { grid-column: span 2; }
.pillar h3 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 21px; margin: 0; }
.pillar h3 a { color: var(--fg); text-decoration: none; }
.pillar h3 a:hover { color: var(--link); }
.pillar p { margin: 0; color: var(--fg-2); font-size: 15.5px; }
.pillar ul { list-style: none; margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14.5px; }
.pillar svg { width: 40px; height: 40px; color: var(--head); }

.laws { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.tile { aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 500; text-decoration: none; color: var(--fg-2); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.tile:hover { border-color: var(--link); color: var(--link); }
.tile--on { background: var(--l-bike); color: var(--panel); border-color: var(--l-bike); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; }
.card h3 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 22px; margin: 6px 0 14px; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 16px; font-size: 15px; }
.card dt { color: var(--fg-3); }
.card dd { margin: 0; }
.flag { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--l-gray); border: 1px solid currentColor; border-radius: 3px; padding: 1px 6px; }

.makers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 40px; }
.maker { background: var(--panel); padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.maker b { font-weight: 600; }
.maker span { font-family: var(--mono); font-size: 12px; color: var(--fg-3); }

/* ---------- tables (shared) ---------- */
.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.tbl caption { text-align: left; padding: 12px 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.tbl th { text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); padding: 10px 16px; background: var(--bg-2); }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.tbl td.num { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl tr[data-l] td:first-child { border-left: 4px solid var(--lc); font-weight: 600; }
[data-l="scoot"] { --lc: var(--l-scoot); }
[data-l="bike"] { --lc: var(--l-bike); }
[data-l="gray"] { --lc: var(--l-gray); }
[data-l="moped"] { --lc: var(--l-moped); }
[data-l="moto"] { --lc: var(--l-moto); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lc); margin-right: 8px; vertical-align: 1px; }

/* ---------- interior page ---------- */
.dp-hero { position: relative; background: var(--hero); border-bottom: 1px solid var(--line); overflow: hidden; }
.dp-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; }
.dp-hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: end; padding-block: 44px 40px; }
.crumb { font-size: 14px; color: var(--fg-3); }
.crumb a { color: var(--fg-3); }
.dp-hero h1 { font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 750; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -.02em; margin: 14px 0 10px; }
.dp-hero__anchor { font-family: var(--mono); font-size: 13px; color: var(--fg-3); margin: 0 0 18px; }
.dp-hero__thesis { font-size: 18px; color: var(--fg-2); margin: 0; max-width: 56ch; }
.dp-hero__thesis strong { color: var(--fg); }
.dp-hero__art svg { display: block; width: 100%; height: auto; }

.strip { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.strip__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.strip__c { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.strip__c:first-child { border-left: 0; padding-left: 0; }
.strip__v { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }

.dp-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-block: 48px 80px; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 88px); align-self: start; font-size: 14.5px; }
.toc h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); margin: 0 0 10px; }
.toc ol, .toc ul { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 4px; }
.toc a { color: var(--fg-2); text-decoration: none; display: block; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-soft); }
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--fg); border-left-color: var(--head); }
.toc .here { display: block; padding: 2px 0 2px 12px; border-left: 2px solid var(--lc); font-weight: 600; }
.toc ul a { border-left-color: transparent; }

.dp-sec { padding-bottom: 52px; margin-bottom: 52px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 96px; }
.dp-sec:last-child { border-bottom: 0; }
.dp-sec h2 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; color: var(--head); margin: 0 0 10px; }
.dp-sec__lede { font-size: 18.5px; color: var(--fg); margin: 0 0 18px; max-width: 62ch; }
.dp-sec p { max-width: 68ch; }
.dp-sec ul { max-width: 66ch; padding-left: 20px; }
.dp-sec li { margin-bottom: 6px; }
.note { border-left: 4px solid var(--lc); background: var(--panel); padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 18px 0; max-width: 68ch; }
.note p { margin: 0; }
.record dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; margin: 0; font-size: 15.5px; }
.record dt { color: var(--fg-3); }
.record dd { margin: 0; }

/* ---------- footer ---------- */
.foot { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: 48px 28px; font-size: 14.5px; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); margin: 0 0 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { color: var(--fg-2); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot__note { color: var(--fg-3); margin: 12px 0 0; max-width: 32ch; }
.foot__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13.5px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .nav[data-open] { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); gap: 12px; }
  .burger { display: block; }
  .laws, .dp-hero__in { grid-template-columns: minmax(0, 1fr); }
  .dp-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; display: none; }
  .strip__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip__c:nth-child(4) { border-left: 0; padding-left: 0; }
  .strip__c:nth-child(n+4) { border-top: 1px solid var(--line); }
  .makers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar--wide { grid-column: auto; }
  .meta__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta__c:nth-child(3) { border-left: 0; padding-left: 0; }
  .meta__c:nth-child(n+3) { border-top: 1px solid var(--line); }
  .strip__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip__c:nth-child(odd) { border-left: 0; padding-left: 0; }
  .strip__c:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tiles { gap: 2px; }
  .tile { font-size: 9px; }
  .record dl { grid-template-columns: 1fr; gap: 2px; }
  .record dd { margin-bottom: 10px; }
  .sec { padding-block: 52px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
