/* Bicycle Manual: fine-print editorial system */
:root {
  --paper: #F2ECDD;
  --paper-deep: #E8DFCB;
  --ink: #1C1B17;
  --ink-soft: #4A463D;
  --muted: #5C574C;
  --rule: #C9BFA9;
  --green: #1F4A36;
  --green-ink: #173A2A;
  --warn-bg: #EDE3CC;
  --focus: #1F4A36;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ui: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --measure: 36rem;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1A16; --paper-deep: #24221D; --ink: #EDE6D6; --ink-soft: #CFC7B5;
    --muted: #B3AB99; --rule: #4A463C; --green: #8CC0A2; --green-ink: #A6D3B8; --warn-bg: #2A2720; --focus: #8CC0A2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1A16; --paper-deep: #24221D; --ink: #EDE6D6; --ink-soft: #CFC7B5;
  --muted: #B3AB99; --rule: #4A463C; --green: #8CC0A2; --green-ink: #A6D3B8; --warn-bg: #2A2720; --focus: #8CC0A2;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 1.125rem; line-height: 1.6;
  font-variation-settings: "opsz" 14, "SOFT" 0, "WONK" 0;
  font-feature-settings: "onum" 1, "kern" 1;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; font-family: var(--ui); z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }

/* Masthead: centered nameplate between hairlines */
.masthead { padding-top: 22px; text-align: center; }
.masthead .rule { border: 0; border-top: 1px solid var(--ink); margin: 0; }
.masthead .rule.double { border-top: 3px double var(--ink); }
.nameplate { display: block; padding: 18px 0 6px; text-decoration: none; color: var(--ink); }
.nameplate .name {
  font-family: var(--display); font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
}
.nameplate .dek { display: block; margin-top: 8px; font-style: italic; font-size: 1rem; color: var(--ink-soft); font-variation-settings: "opsz" 12; }
.nameplate:hover .name { color: var(--green-ink); }
.nameplate-row { padding-bottom: 14px; }
.topnav { font-family: var(--ui); font-size: 0.98rem; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.topnav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 28px; }
.topnav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.topnav a:hover, .topnav a[aria-current="page"] { border-bottom-color: var(--green); color: var(--green-ink); }
.menu-btn { display: none; }
@media (max-width: 640px) {
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 auto; font: 600 1rem var(--ui);
    background: transparent; color: var(--ink); border: 1px solid var(--rule); padding: 8px 16px; cursor: pointer; min-height: 44px;
  }
  .topnav .nav-list[hidden] { display: none; }
  .topnav .nav-list:not([hidden]) { display: flex; flex-direction: column; gap: 0; padding-top: 10px; }
  .topnav .nav-list:not([hidden]) li { border-top: 1px solid var(--rule); }
  .topnav .nav-list:not([hidden]) a { display: block; padding: 12px 0; }
}
@media (min-width: 641px) { .topnav .nav-list[hidden] { display: flex; } }

/* Home hero */
.hero { text-align: center; padding-top: 36px; padding-bottom: 18px; }
.hero figure { margin: 0 auto; max-width: 60rem; }
.exploded { display: block; width: 100%; height: auto; }
.exploded .ink { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linejoin: round; }
.exploded .fine { fill: none; stroke: var(--ink); stroke-width: 0.6; }
.exploded .lead { stroke: var(--ink-soft); stroke-width: 0.5; }
.exploded .axis { stroke: var(--green); stroke-width: 0.7; stroke-dasharray: 6 4; }
.exploded .idx { font-family: var(--display); font-style: italic; font-size: 15px; fill: var(--green); }
.hero figcaption { font-family: var(--ui); font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.hero h1 {
  font-family: var(--display); font-weight: 350; font-size: clamp(2rem, 5.2vw, 3.5rem); line-height: 1.08;
  letter-spacing: -0.015em; max-width: 20ch; margin: 26px auto 14px;
  font-variation-settings: "opsz" 120, "SOFT" 0, "WONK" 0;
}
.hero .lede { max-width: 34rem; margin: 0 auto; font-size: 1.2rem; color: var(--ink-soft); }

/* Finder + groupset table */
.finder { max-width: 56rem; margin: 40px auto 0; }
.finder label { display: block; text-align: center; font-family: var(--ui); font-size: 1rem; margin-bottom: 8px; }
.finder input {
  display: block; width: 100%; max-width: 30rem; margin: 0 auto; font: 1.15rem var(--ui); padding: 12px 14px;
  background: transparent; color: var(--ink); border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; text-align: center;
}
.finder input::placeholder { color: var(--muted); }
.finder .status { text-align: center; font-family: var(--ui); font-size: 0.92rem; color: var(--muted); min-height: 1.4em; margin: 10px 0 0; }
.groupsets { width: 100%; border-collapse: collapse; margin-top: 22px; font-family: var(--ui); }
.groupsets caption { caption-side: top; text-align: center; font-family: var(--display); font-style: italic; font-size: 1.05rem; color: var(--ink-soft); padding-bottom: 10px; }
.groupsets th, .groupsets td { text-align: left; vertical-align: top; padding: 14px 14px; border-top: 1px solid var(--rule); }
.groupsets thead th { font-family: var(--display); font-weight: 500; font-size: 1.2rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.groupsets tbody th { font-family: var(--display); font-style: italic; font-weight: 400; color: var(--ink-soft); width: 8.5rem; }
.groupsets td a { display: block; text-decoration: none; color: var(--ink); padding: 2px 0; }
.groupsets td a .code { display: block; font-size: 0.86rem; color: var(--muted); }
.groupsets td a:hover .mname { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.groupsets td a.dim { opacity: 0.28; }
.groupsets tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }
.groupsets .none { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 720px) {
  .groupsets thead { display: none; }
  .groupsets, .groupsets tbody, .groupsets tr, .groupsets th, .groupsets td { display: block; width: 100%; }
  .groupsets tbody th { padding: 18px 0 4px; border-top: 1px solid var(--ink); width: auto; }
  .groupsets td { border-top: 0; padding: 4px 0; }
  .groupsets td::before { content: attr(data-col); display: block; font-family: var(--display); font-size: 1rem; color: var(--ink); margin-top: 6px; }
  .groupsets tbody tr:last-child > * { border-bottom: 0; }
}

/* Sections */
.section { padding-top: 64px; padding-bottom: 8px; }
.section > h2, .center-h { text-align: center; font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.15; margin: 0 auto 10px; max-width: 26ch; font-variation-settings: "opsz" 72; }
.section > .intro { text-align: center; max-width: 34rem; margin: 0 auto 28px; color: var(--ink-soft); }
.ornament { display: block; text-align: center; color: var(--green); font-size: 1.1rem; margin: 56px 0 0; letter-spacing: 0.6em; }

.index-list { list-style: none; margin: 0 auto; padding: 0; max-width: 52rem; columns: 2 22rem; column-gap: 48px; }
.index-list li { break-inside: avoid; padding: 14px 0; border-top: 1px solid var(--rule); }
.index-list a { font-family: var(--display); font-size: 1.22rem; text-decoration: none; color: var(--ink); }
.index-list a:hover { color: var(--green); text-decoration: underline; }
.index-list p { margin: 4px 0 0; font-size: 1rem; color: var(--ink-soft); }
.index-list .codes { font-family: var(--ui); font-size: 0.88rem; color: var(--muted); margin-top: 2px; }

.request { max-width: 34rem; margin: 0 auto; text-align: center; }
.request p { color: var(--ink-soft); }
.btn-line { display: inline-block; font: 600 1rem var(--ui); color: var(--paper); background: var(--green); padding: 12px 22px; text-decoration: none; border-radius: 1px; }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* Colophon */
.colophon { margin-top: 88px; padding: 34px 0 44px; border-top: 3px double var(--ink); text-align: center; font-size: 0.98rem; color: var(--ink-soft); }
.colophon .cname { font-family: var(--display); font-size: 1.4rem; color: var(--ink); margin: 0 0 6px; }
.colophon p { max-width: 36rem; margin: 6px auto; }
.colophon nav { font-family: var(--ui); margin-top: 14px; }
.colophon nav a { color: var(--ink); margin: 0 10px; white-space: nowrap; }

/* Article (guide) */
.crumbs { font-family: var(--ui); font-size: 0.9rem; color: var(--muted); padding-top: 18px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule); }
.crumbs a { color: var(--muted); }
.article-head { text-align: center; padding-top: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.article-head h1 { font-family: var(--display); font-weight: 350; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 auto 14px; max-width: 22ch; font-variation-settings: "opsz" 120; }
.article-head .standfirst { max-width: 36rem; margin: 0 auto; font-size: 1.2rem; font-style: italic; color: var(--ink-soft); }
.article-head .codes { font-family: var(--ui); font-size: 0.95rem; color: var(--muted); margin-top: 14px; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr); padding-top: 34px; padding-bottom: 0; }
.article > * { grid-column: 2; }
.article > .wide { grid-column: 1 / -1; max-width: 50rem; justify-self: center; width: 100%; }
.article h2 { font-family: var(--display); font-weight: 450; font-size: 1.75rem; line-height: 1.2; margin: 52px 0 12px; font-variation-settings: "opsz" 48; }
.article h3 { font-family: var(--display); font-weight: 500; font-size: 1.28rem; margin: 34px 0 8px; }
.article p, .article li { hyphens: manual; }
.article ul { padding-left: 1.2em; }
.contents { font-family: var(--ui); font-size: 0.98rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 14px 0; margin: 0 0 8px; }
.contents p { margin: 0 0 6px; font-family: var(--display); font-style: italic; font-size: 1.05rem; }
.contents ol { margin: 0; padding-left: 1.4em; columns: 2 14rem; }
.contents li { margin: 3px 0; }

/* Steps: numbers hang in the margin */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 18px 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid var(--rule); }
ol.steps > li:last-child { border-bottom: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: -3.4rem; top: -0.12em; width: 2.6rem; text-align: right;
  font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--green); font-variation-settings: "opsz" 72; font-feature-settings: "lnum" 1;
}
@media (max-width: 760px) {
  ol.steps > li { padding-left: 2.6rem; }
  ol.steps > li::before { left: 0; width: 1.9rem; text-align: left; font-size: 1.45rem; }
}
.step-source { display: block; font-family: var(--ui); font-size: 0.86rem; color: var(--muted); margin-top: 4px; }

.safety { border-left: 3px solid var(--green); background: var(--warn-bg); padding: 12px 16px; margin: 18px 0; font-family: var(--ui); font-size: 1rem; }
.safety strong { font-weight: 700; }
.note { font-family: var(--ui); font-size: 0.98rem; color: var(--ink-soft); }

table.spec { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-family: var(--ui); font-size: 0.98rem; font-feature-settings: "tnum" 1; }
table.spec caption { caption-side: top; text-align: left; font-family: var(--display); font-style: italic; font-size: 1.05rem; color: var(--ink-soft); padding-bottom: 6px; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); }
table.spec thead th { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-weight: 600; }
table.spec tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }
table.spec td.num { white-space: nowrap; }
table.spec .src { font-size: 0.85rem; color: var(--muted); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

dl.symptoms { margin: 12px 0; }
dl.symptoms dt { font-family: var(--display); font-weight: 500; font-size: 1.15rem; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--rule); }
dl.symptoms dd { margin: 4px 0 0; }

.official { font-family: var(--ui); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 14px 0; margin: 40px 0 0; }
.official ul { margin: 6px 0 0; padding-left: 1.1em; }
.related { font-family: var(--ui); }

.prose { max-width: calc(var(--measure) + 32px); margin: 0 auto; padding-top: 30px; }
.prose h2 { font-family: var(--display); font-weight: 450; font-size: 1.6rem; margin: 40px 0 10px; }

@media (prefers-reduced-motion: no-preference) {
  .exploded .part { transition: transform .6s ease; }
}
@media print {
  .masthead nav, .colophon nav, .menu-btn, .finder { display: none; }
  body { background: #fff; color: #000; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 720px) { .groupsets caption { display: block; width: 100%; } }
