/* =========================================================
   BRS Transit Map — v5
   A metro-map design: sections are stations on coloured lines.
   Plain CSS, built on variables. Day / night service themes.
   ========================================================= */

:root {
  --bg: #f4f1ea;
  --bg-alt: #ebe6db;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5d6170;
  --rule: #d8d2c4;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px -12px rgba(27,29,34,.25);
  --board-bg: #14161b;
  --board-ink: #ffcc33;
  --board-dim: #8a8f9c;

  --red: #dc241f;
  --blue: #0e6fc4;
  --green: #00843d;
  --orange: #ee7c0e;
  --purple: #7b3f98;
  --pink: #d9569a;

  --line: 10px;
  --radius: 14px;
  --font: "Overpass", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Overpass Mono", ui-monospace, "Cascadia Code", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101218; --bg-alt: #161922; --surface: #1c2029; --ink: #eef0f4; --muted: #9aa1b2;
    --rule: #2c313d; --shadow: 0 10px 30px -14px rgba(0,0,0,.7); --board-bg: #07080b;
    --red: #ff4b45; --blue: #3d9bff; --green: #1fbf66; --orange: #ff9a3a; --purple: #b072d6; --pink: #ff7ab8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101218; --bg-alt: #161922; --surface: #1c2029; --ink: #eef0f4; --muted: #9aa1b2;
  --rule: #2c313d; --shadow: 0 10px 30px -14px rgba(0,0,0,.7); --board-bg: #07080b;
  --red: #ff4b45; --blue: #3d9bff; --green: #1fbf66; --orange: #ff9a3a; --purple: #b072d6; --pink: #ff7ab8;
  color-scheme: dark;
}

/* Line colour helpers: any element with c-* gets --c */
.c-red { --c: var(--red); } .c-blue { --c: var(--blue); } .c-green { --c: var(--green); }
.c-orange { --c: var(--orange); } .c-purple { --c: var(--purple); } .c-pink { --c: var(--pink); }
.s-red { --c: var(--red); } .s-blue { --c: var(--blue); } .s-green { --c: var(--green); }
.s-orange { --c: var(--orange); } .s-purple { --c: var(--purple); } .s-pink { --c: var(--pink); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--font); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt-8 { margin-top: 2rem; }
.line-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hp { position: absolute; left: -9999px; }
.kicker { font: 600 .78rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--ink)); display: inline-block; flex: none; }

/* ---------- Signage pieces ---------- */
.roundel { width: 44px; height: 44px; border-radius: 50%; border: 8px solid var(--red); display: grid; place-items: center; position: relative; flex: none; }
.roundel span { position: absolute; left: -10px; right: -10px; background: var(--blue); color: #fff; font: 900 .7rem/1 var(--font); letter-spacing: .06em; text-align: center; padding: 4px 0 3px; border-radius: 2px; }
.roundel.sm { width: 34px; height: 34px; border-width: 6px; }
.roundel.sm span { font-size: .55rem; left: -8px; right: -8px; padding: 3px 0 2px; }
.line-badge { width: 52px; height: 52px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 900 1.4rem/1 var(--font); flex: none; box-shadow: 0 0 0 4px var(--bg); }
.line-badge.sm { width: 32px; height: 32px; font-size: .85rem; box-shadow: none; }
.stop { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--c, var(--ink)); display: inline-block; flex: none; }
.stop.big { width: 22px; height: 22px; border-width: 5px; }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 800; text-decoration: none; border: 2px solid transparent; transition: transform .15s, background .15s, color .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--rule); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; text-decoration: none; transition: border-color .15s, transform .15s; }
.icon-btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.chip { display: inline-flex; align-items: center; padding: .4rem .9rem; border-radius: 999px; border: 2px solid var(--rule); background: var(--surface); color: var(--ink); font-size: .88rem; font-weight: 600; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--rule); }

/* ---------- Header with a line of stations ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand-text { font-weight: 900; font-size: 1.15rem; line-height: 1; }
.brand-text small { display: block; font: 400 .7rem/1.3 var(--mono); color: var(--muted); margin-top: 3px; }
.line-nav { flex: 1; }
.line-nav ol { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; }
.line-nav li { position: relative; flex: 0 1 110px; }
.line-nav li::before { content: ""; position: absolute; top: 15px; left: 0; right: 0; height: 6px; background: var(--c); }
.line-nav li:first-child::before { left: 50%; }
.line-nav li:last-child::before { right: 50%; }
.line-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-size: .78rem; font-weight: 700; padding: 8px 4px; }
.line-nav .stop { width: 18px; height: 18px; transition: transform .2s, background .2s; }
.line-nav a:hover .stop, .line-nav li.is-here .stop { transform: scale(1.3); background: var(--c); }
.line-nav li.is-here .lbl { color: var(--c); }
.topbar-tools { display: flex; gap: .5rem; }
.menu-btn { display: none; }
.ride-progress { height: 4px; background: transparent; }
.ride-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--blue), var(--green), var(--orange), var(--purple), var(--pink)); }

/* ---------- Sections ---------- */
.sec { padding: clamp(4rem, 9vw, 7rem) 0; }
.sec-alt { background: var(--bg-alt); }
.page-top { padding-top: 3rem; }
.sec-head { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 2.5rem; }
.sec-title { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 900; }
.sec-sub { color: var(--muted); margin: .6rem 0 0; max-width: 60ch; }
.sub-head { margin: 3.5rem 0 1.2rem; font-size: 1.3rem; display: flex; gap: .6rem; align-items: center; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; }
.hero-grid > *, .origin-grid > *, .contact-grid > * { min-width: 0; }
.sign { display: inline-flex; align-items: center; gap: .7rem; background: var(--board-bg); color: #fff; padding: .45rem 1rem .45rem .5rem; border-radius: 999px; font: 600 .85rem/1 var(--mono); margin-bottom: 1.3rem; }
.hero-title { font-size: clamp(3rem, 8.5vw, 6.2rem); font-weight: 900; letter-spacing: -.035em; line-height: .95; margin-bottom: 1.3rem; }
.hero-roles { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: 1.2rem; font-weight: 700; }
.role { display: inline-flex; align-items: center; gap: .45rem; }
.hero-intro { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 2.2rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0; }
.hero-stats div { border-left: 6px solid var(--ink); padding-left: .8rem; }
.hero-stats div:nth-child(1) { border-color: var(--red); }
.hero-stats div:nth-child(2) { border-color: var(--green); }
.hero-stats div:nth-child(3) { border-color: var(--orange); }
.hero-stats dt { font: 400 .75rem/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hero-stats dd { margin: .2rem 0 0; font-size: 2rem; font-weight: 900; }

.network { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; padding: 1rem; box-shadow: var(--shadow);
  background-image: radial-gradient(var(--rule) 1px, transparent 1px); background-size: 22px 22px; }
.network svg { width: 100%; height: auto; overflow: visible; }
.network .ln { fill: none; stroke: var(--c); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(.6,.1,.2,1) forwards; }
.network .ln:nth-child(2) { animation-delay: .12s; } .network .ln:nth-child(3) { animation-delay: .24s; }
.network .ln:nth-child(4) { animation-delay: .36s; } .network .ln:nth-child(5) { animation-delay: .48s; } .network .ln:nth-child(6) { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.term { cursor: pointer; }
.term-dot { fill: var(--surface); stroke: var(--c); stroke-width: 6; transition: r .2s, fill .2s; }
.term text { font: 800 17px var(--font); fill: var(--ink); }
.term:hover .term-dot, .term:focus .term-dot { fill: var(--c); r: 14; }
.term:hover text { text-decoration: underline; }
.central rect { fill: var(--surface); stroke: var(--ink); stroke-width: 5; }
.central text { font: 900 18px var(--font); fill: var(--ink); }
.central-lbl { font: 600 13px var(--mono); fill: var(--muted); }
.network figcaption { text-align: center; margin-top: .4rem; }
@keyframes pop { to { opacity: 1; } }

/* ---------- Origin ---------- */
.origin-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; align-items: start; }
.origin-photo { margin: 0; background: var(--surface); padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow); border-top: var(--line) solid var(--red); }
.origin-photo img { aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; width: 100%; }
.origin-photo figcaption { display: flex; align-items: center; gap: .7rem; padding: .8rem .3rem .2rem; font-weight: 700; font-size: .9rem; }
.lead { font-size: 1.15rem; }
.notice { margin: 1.5rem 0 0; background: #ffd200; color: #1b1d22; padding: 1.2rem 1.4rem; border-radius: 8px; font-weight: 700; font-size: 1.05rem; }
.notice-tag { display: block; font: 600 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; margin-bottom: .5rem; }
.traits { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.trait { padding: 1.3rem; }
.trait h3 { font-size: 1.05rem; margin: .9rem 0 .4rem; }
.trait p { font-size: .92rem; margin: 0; }
.trait-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }

/* ---------- Route (journey) ---------- */
.legend { display: flex; gap: 1.5rem; margin: -1.2rem 0 2.5rem; font-weight: 700; font-size: .9rem; }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.route { list-style: none; margin: 0; padding: 0; position: relative; --x: 50%; }
.route::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--x) - var(--line) / 2); width: var(--line); border-radius: 99px;
  background: linear-gradient(var(--blue), var(--red) 25%, var(--green) 45%, var(--red) 55%, var(--green) 70%, var(--blue) 95%, var(--rule)); }
.route-stop { position: relative; width: 50%; padding: 0 2.8rem 2.2rem 0; }
.route-stop:nth-child(odd) { margin-left: 50%; padding: 0 0 2.2rem 2.8rem; }
.route-dot { position: absolute; top: 18px; right: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 6px solid var(--c, var(--muted)); z-index: 2; }
.route-stop:nth-child(odd) .route-dot { right: auto; left: -13px; }
.route-card { padding: 1.2rem 1.4rem; border-top: 6px solid var(--c, var(--rule)); }
.route-card h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.route-card p:last-child { margin: 0; }
.route-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.year { font: 900 1.5rem/1 var(--font); }
.tag { font: 600 .75rem/1 var(--mono); color: var(--c); text-transform: uppercase; letter-spacing: .06em; }
.route-next .route-card { border-top-style: dashed; background: transparent; box-shadow: none; }
.route-next .route-dot { border-style: dashed; }
.train { position: absolute; left: calc(var(--x) - 22px); top: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; z-index: 3; transition: top .15s linear; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5); }

/* ---------- Travel line ---------- */
.strip { list-style: none; margin: 0; padding: 0; columns: 4 220px; column-gap: 2rem; }
.strip li { break-inside: avoid; position: relative; padding: .45rem 0 .45rem 2.2rem; border-left: var(--line) solid var(--green); margin-left: 8px; }
.strip li::before { content: ""; position: absolute; left: -15px; top: .7rem; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 5px solid var(--green); }
.strip li.has-vlog::before { border-color: var(--ink); width: 22px; height: 22px; left: -16px; }
.strip a { text-decoration: none; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.strip a:hover .stn { text-decoration: underline; }
.stn { font-weight: 700; line-height: 1.3; }
.strip small { display: block; font-size: .72rem; }
.vlog-tag { font: 600 .68rem/1 var(--mono); background: var(--red); color: #fff; padding: 3px 6px; border-radius: 4px; text-transform: uppercase; }
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.screen { overflow: hidden; }
.yt-lite { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; border: 0; background: #000; }
.yt-lite img { width: 100%; height: 100%; object-fit: cover; opacity: .88; transition: opacity .2s; }
.yt-lite:hover img { opacity: 1; }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.3rem; }
.platform { position: absolute; top: 10px; left: 10px; background: var(--board-bg); color: var(--board-ink); padding: 4px 8px; border-radius: 4px; font-size: .75rem; }
.screen-body { padding: 1.1rem 1.3rem; }
.screen-body h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.screen-body p { margin: 0; font-size: .92rem; }

/* ---------- Skill lines ---------- */
.skill-lines { display: grid; gap: 1.2rem; }
.skill-line { padding: 1.3rem 1.5rem 1.5rem; }
.skill-line header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.3rem; }
.skill-line h3 { font-size: 1.1rem; flex: 1; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; row-gap: 1.2rem; }
.stops li { position: relative; flex: 1 0 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem; font-weight: 600; font-size: .9rem; }
.stops li::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 8px; background: var(--c); }
.stops li:first-child::before { left: 50%; border-radius: 0; }
.stops li:last-child::before { right: 50%; }
.stops .stop { position: relative; transition: transform .2s; }
.stops li:hover .stop { transform: scale(1.35); background: var(--c); }

/* ---------- Departures board ---------- */
.board { background: var(--board-bg); color: var(--board-ink); border-radius: var(--radius); padding: .6rem 0; font-family: var(--mono); box-shadow: var(--shadow); overflow: hidden; }
.board-head, .board-row { display: grid; grid-template-columns: 90px 1fr 190px 150px; gap: 1rem; padding: .85rem 1.4rem; align-items: center; }
.board-head { color: var(--board-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid #2a2e38; }
.board-row { text-decoration: none; border-bottom: 1px dashed #2a2e38; transition: background .15s; }
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: #1f232c; }
.board-row[hidden] { display: none; }
.flap { background: #24282f; border-radius: 4px; text-align: center; padding: .25rem 0; font-weight: 600; font-size: .85rem; }
.dest { color: #fff; font-family: var(--font); font-weight: 700; line-height: 1.35; }
.plat { color: var(--board-dim); font-size: .8rem; }
.status { color: #59e08c; font-size: .8rem; }
.board-row:hover .status::after { content: " →"; }

/* ---------- Post cards & filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.4rem; }
.post-grid > div[hidden] { display: none; }
.post-card { display: flex; flex-direction: column; height: 100%; text-decoration: none; overflow: hidden; border-top: 6px solid var(--purple); transition: transform .2s; }
.post-card:hover { transform: translateY(-4px); }
.post-img { margin: 0; aspect-ratio: 16/9; overflow: hidden; }
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-img img { transform: scale(1.05); }
.post-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-body h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.post-body .kicker { --c: var(--purple); }
.read-more { margin-top: auto; font-weight: 800; color: var(--purple); }

/* ---------- Contact ticket ---------- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: start; }
.ticket { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--rule); position: relative; overflow: hidden;
  -webkit-mask: radial-gradient(circle 14px at 0 96px, transparent 98%, #000) , radial-gradient(circle 14px at 100% 96px, transparent 98%, #000);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.ticket-head { display: flex; align-items: center; gap: .9rem; padding: 1.2rem 1.5rem; background: var(--pink); color: #fff; height: 96px; border-bottom: 3px dashed var(--surface); }
.ticket-head b { display: block; font-size: 1.15rem; }
.ticket-head small { font: 400 .78rem/1.3 var(--mono); opacity: .9; }
.ticket-head .roundel { border-color: #fff; }
.ticket-no { margin-left: auto; font-size: .8rem; }
.ticket-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .35rem; font: 600 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field b { color: var(--red); margin-left: 2px; }
.field-full { grid-column: 1 / -1; }
.field input, .field textarea { font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--bg); border: 2px solid var(--rule); border-radius: 8px; padding: .7rem .8rem; text-transform: none; letter-spacing: 0; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pink); }
.ticket-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 0 1.5rem 1.5rem; }
.alert { margin: 1rem 1.5rem 0; padding: .8rem 1rem; border-radius: 8px; font-weight: 600; }
.alert-ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.alert-error { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.connections .kicker { margin-bottom: 1.3rem; }
.conn-group { display: flex; gap: 1rem; margin-bottom: 1.6rem; }
.conn-group h3 { font-size: 1rem; margin: .3rem 0 .7rem; }
.conn-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.conn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; background: var(--surface); border: 3px solid var(--c); color: var(--ink); transition: background .15s, color .15s, transform .15s; }
.conn:hover { background: var(--c); color: #fff; transform: translateY(-2px); }

/* ---------- Footer ---------- */
.endline { border-top: var(--line) solid var(--ink); padding: 1.6rem 0; font-size: .9rem; }
.endline-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.terminus { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; }
.terminus .stop { --c: var(--ink); }

/* ---------- Article ---------- */
.story-head { max-width: 820px; padding-top: 1rem; }
.crumbs { display: flex; align-items: center; gap: .6rem; font-size: .85rem; font-weight: 700; margin-bottom: 1.5rem; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumb-line { width: 28px; height: 5px; border-radius: 3px; background: var(--purple); }
.story-head .kicker { --c: var(--purple); }
.story-title { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 900; margin-bottom: 1rem; }
.story-dek { font-size: 1.2rem; color: var(--muted); }
.story-meta { font-size: .85rem; color: var(--muted); border-left: 6px solid var(--purple); padding-left: .8rem; }
.story-cover { margin: 2rem auto; }
.story-cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); }
.story-body, .story-foot { width: min(720px, 100% - 32px); margin-inline: auto; }
.prose { font-size: 1.08rem; }
.prose h2 { font-size: 1.7rem; margin: 2.5rem 0 1rem; padding-left: 1rem; border-left: 8px solid var(--purple); }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 .8rem; }
.prose a { color: var(--blue); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose blockquote { margin: 1.5rem 0; background: #ffd200; color: #1b1d22; padding: 1rem 1.3rem; border-radius: 8px; font-weight: 600; }
.prose code { font-family: var(--mono); background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--board-bg); color: #e9e9e9; padding: 1rem; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.story-foot { padding: 2rem 0 4rem; border-top: 1px solid var(--rule); margin-top: 3rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.share .kicker { margin: 0 .5rem 0 0; }

/* ---------- Resume, 404 ---------- */
.paper-sheet { background: var(--surface); padding: clamp(1.5rem, 5vw, 3rem); border-radius: var(--radius); box-shadow: var(--shadow); border-top: var(--line) solid var(--blue); }
.resume-head { margin-bottom: 1.5rem; }
.resume-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.resume-h { font-size: 1.2rem; margin: 2rem 0 .8rem; padding-bottom: .4rem; border-bottom: 4px solid var(--red); display: inline-block; }
.resume-skills { display: grid; grid-template-columns: 200px 1fr; gap: .5rem 1rem; }
.resume-skills dt { font-weight: 800; }
.resume-skills dd { margin: 0; color: var(--muted); }
.err-sign { display: inline-flex; align-items: center; gap: 1rem; font: 900 4rem/1 var(--font); margin-bottom: 1rem; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .traits { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid, .origin-grid, .contact-grid { grid-template-columns: 1fr; }
  .origin-photo { max-width: 360px; }
  .menu-btn { display: inline-grid; }
  .topbar-inner { justify-content: space-between; }
  .line-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--rule); padding: 1rem 16px 1.2rem; display: none; }
  .line-nav.is-open { display: block; }
  .line-nav ol { flex-direction: column; }
  .line-nav li { flex: none; }
  .line-nav li::before { top: 0; bottom: 0; left: 15px; right: auto; width: 6px; height: auto; }
  .line-nav li:first-child::before { left: 15px; top: 50%; }
  .line-nav li:last-child::before { right: auto; bottom: 50%; }
  .line-nav a { flex-direction: row; gap: 1rem; padding: .7rem 0 .7rem 9px; font-size: 1rem; }
  .route { --x: 13px; }
  .route-stop, .route-stop:nth-child(odd) { width: 100%; margin-left: 0; padding: 0 0 1.8rem 2.6rem; }
  .route-dot, .route-stop:nth-child(odd) .route-dot { left: 0; right: auto; }
  .board-head, .board-row { grid-template-columns: 74px 1fr; padding: .8rem 1rem; }
  .hide-sm { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .traits { grid-template-columns: 1fr 1fr; }
  .ticket-fields { grid-template-columns: 1fr; }
  .sec-head { flex-direction: column; gap: .8rem; }
  .line-badge { width: 42px; height: 42px; font-size: 1.1rem; }
  .brand-text small { display: none; }
  .resume-skills { grid-template-columns: 1fr; }
  .stops li { flex-basis: 33%; }
  .hero-stats { gap: 1.2rem; }
  .hero-stats dd { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .topbar, .endline, #contact, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .paper-sheet { box-shadow: none; border: 0; }
}
