/* Chapter 01 — History page specific styles */

/* Hero art */
.hx-hero { color: var(--ink); }
.hx-hero .yr { fill: var(--muted); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; }
.hx-hero .yr-acc { fill: var(--accent); }

/* ---------- Timeline ---------- */
.tl-filters { margin-bottom: 18px; }
.tl-track {
  display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 14px; margin: 0 -4px;
  scroll-snap-type: x proximity; scrollbar-width: thin; position: relative;
}
.tl-item {
  flex: 0 0 auto; width: 148px; scroll-snap-align: start; text-align: left;
  border: 1px solid var(--line); border-top: 4px solid var(--era, var(--accent));
  background: var(--surface-2); border-radius: 12px; padding: 10px 12px 12px;
  transition: transform .18s ease, background .2s, border-color .2s;
}
.tl-item:hover { transform: translateY(-2px); border-color: var(--line-2); border-top-color: var(--era, var(--accent)); }
.tl-item .y { display: block; font-family: var(--mono); font-weight: 600; font-size: .95rem; color: var(--ink); }
.tl-item .t { display: block; font-size: .82rem; line-height: 1.4; color: var(--ink-2); margin-top: 2px; }
.tl-item[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); border-top-color: var(--era, var(--accent)); }
.tl-item[aria-pressed="true"] .y, .tl-item[aria-pressed="true"] .t { color: var(--bg); }
.tl-item[hidden] { display: none; }
.tl-detail {
  margin-top: 8px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--line); padding: clamp(18px, 3vw, 26px);
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; align-items: start;
}
.tl-detail .big-year { font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1; color: var(--accent); letter-spacing: -0.04em; }
.tl-detail h4 { font-size: 1.15rem; margin: 6px 0 8px; }
.tl-detail p { margin: 0; color: var(--ink-2); }
.tl-controls { display: flex; gap: 8px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.tl-count { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-left: auto; }
@media (max-width: 560px) { .tl-detail { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Evolution slider ---------- */
/* All eight machines share one viewBox in millimetres, so sizes compare truthfully. */
.evo-stage {
  position: relative; width: 100%; aspect-ratio: 2400 / 1700; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.evo-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.evo-bg { pointer-events: none; }
.evo-grid { stroke: var(--line); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 3 5; }
.evo-groundline { stroke: var(--line-2); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.evo-tick { stroke: var(--muted); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.evo-gl { position: absolute; right: 8px; margin-top: 3px; padding: 1px 4px; border-radius: 4px; background: color-mix(in srgb, var(--surface-2) 82%, transparent); z-index: 1; font-family: var(--mono); font-size: .68rem; line-height: 1; color: var(--muted); pointer-events: none; }
.evo-gl-bar { right: auto; margin: 0 0 0 6px; transform: translateY(-50%); }
.evo-bike { opacity: 0; transform: translateX(3%) scale(.985); transform-origin: 50% 92%; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.evo-bike.past { transform: translateX(-3%) scale(.985); }
.evo-bike.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .evo-bike, .evo-bike.past { transform: none; transition: opacity .01ms; } }
.evo-year-badge { position: absolute; left: 14px; top: 10px; font-family: var(--serif); font-weight: 800; font-size: clamp(1.4rem, 4vw, 2.2rem); color: var(--accent); z-index: 2; letter-spacing: -0.03em; }
.evo-ref { margin: 8px 2px 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }

/* Bicycle palette: materials (wood, wrought iron, steel, nickel/chrome, rubber, leather, carbon). */
.evo-bike {
  --ev-wood: #b98552; --ev-wood-dk: #7c5028; --ev-iron: #34322e; --ev-fe: #85817a; --ev-chrome: #c4c1ba;
  --ev-rubber: #252320; --ev-leather: #8a4b24; --ev-cu: #c27a3e; --ev-dark: #2b2925; --ev-comp: #57534c;
  --ev-alloy: #b3afa7; --ev-metal: #8f8b84; --ev-carbon: #232220; --ev-spoke: #8f8b84; --ev-cord: #9c8661;
  --ev-gum: #a8723a; --ev-tape: #e9e3d6; --ev-cable: #e9e3d6; --ev-lug: #efe2bd; --ev-fender: #3a3833;
  --ev-wall: #b9925e; --ev-horn: #3d2c21; --ev-bat: color-mix(in srgb, var(--ev-paint, #345) 70%, #000); --ev-motor: #3b3934;
  --ev-hi: color-mix(in srgb, #fff 58%, transparent); --ev-lo: rgba(0,0,0,.2); --ev-shadow: rgba(22,20,15,.12);
}
.evo-road { --ev-paint: var(--red); }
.evo-mtb { --ev-paint: var(--teal); }
.evo-ebike { --ev-paint: var(--blue); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .evo-bike {
    --ev-wood: #b98a5c; --ev-wood-dk: #6f4a28; --ev-iron: #4d4a44; --ev-fe: #9a958c; --ev-chrome: #b4afa5;
    --ev-rubber: #48443e; --ev-leather: #a0592d; --ev-dark: #44413b; --ev-comp: #6f6a60; --ev-alloy: #a39d93;
    --ev-metal: #8c877d; --ev-carbon: #3d3b36; --ev-spoke: #8c877d; --ev-fender: #4d4a44; --ev-motor: #4d4a44;
    --ev-tape: #cfc8ba; --ev-cable: #cfc8ba; --ev-hi: rgba(255,255,255,.22); --ev-lo: rgba(0,0,0,.28); --ev-shadow: rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] .evo-bike {
  --ev-wood: #b98a5c; --ev-wood-dk: #6f4a28; --ev-iron: #4d4a44; --ev-fe: #9a958c; --ev-chrome: #b4afa5;
  --ev-rubber: #48443e; --ev-leather: #a0592d; --ev-dark: #44413b; --ev-comp: #6f6a60; --ev-alloy: #a39d93;
  --ev-metal: #8c877d; --ev-carbon: #3d3b36; --ev-spoke: #8c877d; --ev-fender: #4d4a44; --ev-motor: #4d4a44;
  --ev-tape: #cfc8ba; --ev-cable: #cfc8ba; --ev-hi: rgba(255,255,255,.22); --ev-lo: rgba(0,0,0,.28); --ev-shadow: rgba(0,0,0,.35);
}
.evo-bike .f { fill: var(--c); }
.evo-bike .s { stroke: var(--c); fill: none; }
.evo-bike .ev-hi { stroke: var(--ev-hi); fill: none; }
.evo-bike .ev-lo { stroke: var(--ev-lo); fill: none; }
.evo-bike .ev-far { opacity: .5; }
.evo-bike .ev-shadow { fill: var(--ev-shadow); }
.evo-bike .m-wd { --c: var(--ev-wood); } .evo-bike .m-wdk { --c: var(--ev-wood-dk); }
.evo-bike .m-ir { --c: var(--ev-iron); } .evo-bike .m-fe { --c: var(--ev-fe); }
.evo-bike .m-ch { --c: var(--ev-chrome); } .evo-bike .m-ru { --c: var(--ev-rubber); }
.evo-bike .m-le { --c: var(--ev-leather); } .evo-bike .m-cu { --c: var(--ev-cu); }
.evo-bike .m-dk { --c: var(--ev-dark); } .evo-bike .m-cp { --c: var(--ev-comp); }
.evo-bike .m-al { --c: var(--ev-alloy); } .evo-bike .m-mt { --c: var(--ev-metal); }
.evo-bike .m-cf { --c: var(--ev-carbon); } .evo-bike .m-sp { --c: var(--ev-spoke); }
.evo-bike .m-rm { --c: var(--ev-alloy); } .evo-bike .m-cord { --c: var(--ev-cord); }
.evo-bike .m-hn { --c: var(--ev-horn); } .evo-bike .m-pt { --c: var(--ev-paint); }
.evo-bike .m-gum { --c: var(--ev-gum); } .evo-bike .m-tape { --c: var(--ev-tape); }
.evo-bike .m-cab { --c: var(--ev-cable); } .evo-bike .m-lug { --c: var(--ev-lug); }
.evo-bike .m-fen { --c: var(--ev-fender); } .evo-bike .m-wall { --c: var(--ev-wall); }
.evo-bike .m-bat { --c: var(--ev-bat); } .evo-bike .m-mot { --c: var(--ev-motor); }
.evo-bike .m-acc { --c: var(--accent); } .evo-bike .m-bg { --c: var(--surface-2); }
.evo-bike .m-scr { --c: var(--teal); } .evo-bike .m-lamp { --c: #f6e7a6; } .evo-bike .m-lamp-r { --c: var(--red); }
.evo-range { margin: 20px 0 6px; }
.evo-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.evo-jumps { margin: 14px 0 18px; }
.evo-jumps .chip { font-size: .8rem; padding: 6px 11px; }
.evo-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.evo-meta div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.evo-meta small { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.evo-meta strong { font-size: 1rem; line-height: 1.35; display: block; margin-top: 2px; }
.evo-desc { margin: 14px 0 0; color: var(--ink-2); }
@media (max-width: 560px) { .evo-meta { grid-template-columns: 1fr; } }

/* ---------- Weight infographic ---------- */
.hx-bars .bar-row { grid-template-columns: 170px 1fr 78px; }
.hx-bars .bar-row span:first-child { line-height: 1.3; }
.hx-bars .bar-row small { display: block; color: var(--muted); font-size: .75rem; }
@media (max-width: 640px) { .hx-bars .bar-row { grid-template-columns: 104px 1fr 58px; } }
.hx-stats { margin-top: 36px; }
.hx-stats .stat-value { font-size: clamp(2rem, 4vw, 2.8rem); }

/* ---------- Innovation grid ---------- */
.inno-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.inno {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; position: relative; transition: transform .2s ease, border-color .2s;
}
.inno:hover, .inno:focus-within { transform: translateY(-3px); border-color: var(--line-2); }
.inno svg { width: 42px; height: 42px; margin-bottom: 10px; }
.inno .yr { font-family: var(--mono); font-size: .78rem; font-weight: 600; color: var(--accent-ink); }
.inno h4 { margin: 2px 0 4px; font-size: 1rem; }
.inno p { margin: 0; font-size: .84rem; line-height: 1.55; color: var(--muted); }

/* ---------- Quiz ---------- */
.quiz-progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.quiz-q { font-weight: 700; font-size: 1.12rem; margin: 0 0 14px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  display: block; width: 100%; text-align: left; padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; transition: border-color .2s, background .2s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--ink); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct { background: var(--green-soft); border-color: var(--green); color: var(--ink); }
.quiz-opt.wrong { background: var(--red-soft); border-color: var(--red); color: var(--ink); }
.quiz-feedback { margin-top: 14px; min-height: 1.5em; color: var(--ink-2); }
.quiz-feedback strong.ok { color: var(--green); }
.quiz-feedback strong.no { color: var(--red); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.quiz-score { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.quiz-result { text-align: center; padding: 10px 0; }
.quiz-result .big { font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 800; color: var(--accent); line-height: 1; }

/* Material table accent */
.hx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Keep hero text above the decorative art; soften art where it would overlap text */
.page-hero .container { position: relative; z-index: 1; }
@media (min-width: 861px) and (max-width: 1280px) { .hx-hero { opacity: .22; } }
