/* Track Maps (gettrackmaps.com) — site styles
   Palette matches the printed maps: ink #121214, red #c8102e, greys. */
:root {
  --ink: #121214; --bg: #f6f6f7; --muted: #6b6b70;
  --line: #e2e2e6; --red: #c8102e; --chip: #ececef; --card: #ffffff;
  --paper: #ffffff; --soft: #f0f0f2; --shadow: 0 1px 2px rgba(18, 18, 20, .06), 0 8px 24px rgba(18, 18, 20, .08);
  --dot: rgba(18, 18, 20, .10);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececef; --bg: #131315; --muted: #9e9ea3;
    --line: #2a2a2e; --chip: #232327; --card: #1a1a1d;
    --paper: #ffffff; --soft: #1f1f23; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .45);
    --dot: rgba(236, 236, 239, .12);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; font-feature-settings: "tnum"; }
a { color: inherit; }
img, svg { max-width: 100%; }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.01em; margin: .3em 0 .35em; }
h2 { font-size: 20px; margin: 28px 0 10px; letter-spacing: -.005em; }
h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); font-weight: 700; margin: 0 0 8px; }

/* ---------- header / footer ---------- */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #121214; color: #fff; padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 10; border-bottom: 2px solid var(--red); }
.brand { font-weight: 800; letter-spacing: .1em; font-size: 13px; text-decoration: none; color: #fff; white-space: nowrap; }
.brand span { color: var(--red); }
.brand small { font-weight: 500; letter-spacing: .02em; font-size: 11px; color: #9e9ea3; margin-left: 6px; }
.site-footer .brand-line small { font-weight: 500; letter-spacing: .02em; color: #9e9ea3; margin-left: 4px; }
.site-header nav { display: flex; gap: 4px; }
.site-header nav a { color: #c9c9ce; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: #fff; background: rgba(255, 255, 255, .08); }
.site-header nav a.support { color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.site-header nav a.support:hover { border-color: var(--red); background: var(--red); }
.site-header nav a.signin { color: #8a8a90; font-size: 12px; padding: 6px 8px; }
.site-header nav a.signin:hover { color: #fff; }
main { max-width: 1120px; margin: 0 auto; padding: 24px; }
.site-footer { max-width: 1120px; margin: 56px auto 0; padding: 22px 24px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .brand-line { font-weight: 700; letter-spacing: .08em; color: var(--ink); font-size: 12px; }

/* ---------- chips / badges / buttons ---------- */
.badge { display: inline-block; background: var(--chip); border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 0 6px 4px 0; white-space: nowrap; }
.badge-ver { background: transparent; border-color: var(--red); color: var(--red); font-weight: 600; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; border-radius: 10px; padding: 12px 20px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: 15px; box-shadow: 0 6px 18px rgba(200, 16, 46, .28); transition: transform .12s, filter .12s; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 18px; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-primary svg, .btn-ghost svg { width: 18px; height: 18px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; text-decoration: none; background: var(--card); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 2px; font-size: 16px; line-height: 1.25; }
.card p { margin: 2px 0; font-size: 13px; }
.card .chips { margin-top: 6px; }
.sil { height: 140px; display: flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 10px; background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 14px 14px; padding: 10px; transition: color .15s; }
.card:hover .sil { color: var(--red); }
.sil svg { max-width: 100%; max-height: 100%; }
.sil-empty { color: var(--muted); font-size: 12px; border: 1px dashed var(--line); border-radius: 8px; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ---------- browse ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 4px; }
.page-head p { margin: 0 0 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 22px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.filters input, .filters select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 14px; }
.filters input { flex: 1 1 220px; min-width: 160px; }
.filters select { flex: 0 1 auto; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
#f-count { margin-left: auto; font-size: 13px; }
.empty-state { text-align: center; padding: 40px 0; color: var(--muted); }

/* ---------- track / layout pages ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.title-row h1 { margin: 0 0 4px; }
.title-row .sub { margin: 0; }
.title-row .sub a { text-decoration: none; border-bottom: 1px solid var(--line); }
.title-row .sub a:hover { border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.specs { margin: 0; display: flex; flex-wrap: wrap; gap: 0; }
.config-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.config-chips a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; text-decoration: none; background: var(--card); }
.config-chips a:hover { border-color: var(--ink); }
.config-chips a.active { border-color: var(--red); color: var(--red); font-weight: 700; }

.hero-wrap { position: relative; }
.hero { display: block; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.hero img { display: block; width: 100%; height: auto; }
.hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 0; font-size: 13px; color: var(--muted); }
.hero-bar .hint { display: none; }
@media (hover: hover) { .hero-bar .hint { display: inline; } }
.hero-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(18, 18, 20, .6); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; width: 42px; height: 42px; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .7; transition: opacity .15s, background .15s; }
.hero-wrap:hover .hero-btn { opacity: 1; }
.hero-btn:hover { background: var(--red); border-color: var(--red); }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.page-card, .hero { cursor: pointer; }

.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.page-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; font-size: 13px; background: var(--paper); transition: transform .15s, box-shadow .15s, border-color .15s; }
.page-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.page-card img { display: block; width: 100%; height: auto; }
.page-card span { display: block; padding: 8px 10px; background: var(--card); color: var(--ink); }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 14px; }
.panel h2 { margin: 0 0 8px; font-size: 15px; }
.panel ul { margin: 6px 0 0; padding-left: 18px; }
.panel li { margin: 2px 0; }
.panel p { margin: 6px 0; }
details.dl { margin-top: 6px; }
details.dl summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.dl summary::-webkit-details-marker { display: none; }
details.dl summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-left: 2px; }
details.dl[open] summary::before { transform: rotate(45deg); }
.dl-list { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 24px; }
.dl-list li { padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; break-inside: avoid; }
.dl-list a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-list a:hover { text-decoration: underline; }
@media (max-width: 640px) { .dl-list { columns: 1; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; z-index: 100; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 92vw); text-align: center; }
.lightbox figcaption { color: #bfbfc4; font-size: 13px; margin-top: 10px; }
.lb-btn { position: absolute; background: rgba(18, 18, 20, .6); color: #fff; border: 1px solid #4a4a4f; border-radius: 999px; width: 46px; height: 46px; font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: var(--red); border-color: var(--red); }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 18px; right: 18px; }
.lb-scroll { max-width: 92vw; max-height: 84vh; overflow: auto; border-radius: 8px; background: #fff; }
.lightbox .lb-scroll img { display: block; width: auto; max-width: 90vw; max-height: 84vh; border-radius: 0; cursor: zoom-in; }
.lightbox.zoomed .lb-scroll img { width: 250%; max-width: none; max-height: none; cursor: zoom-out; }

/* ---------- home ---------- */
.hero-home { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 32px; align-items: center; padding: 40px 0 24px; }
.hero-home h1 { font-size: clamp(32px, 4.6vw, 46px); letter-spacing: .01em; margin: 0 0 12px; line-height: 1.05; }
.hero-home h1 span { color: var(--red); }
.hero-home .lede { font-size: 18px; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.hero-home .cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stats div { font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 26px; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wall a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s, color .15s; }
.wall a:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.wall svg { width: 100%; height: 100%; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head a { font-size: 14px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--ink); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.how .panel h3 { margin: 6px 0 6px; font-size: 16px; }
.how .panel p { margin: 0; color: var(--muted); font-size: 14px; }
.how .num { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 13px; }
.strip { margin-top: 44px; background: #121214; color: #fff; border-radius: 16px; padding: 28px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.strip h2 { margin: 0 0 4px; font-size: 22px; }
.strip p { margin: 0; color: #bfbfc4; font-size: 14px; max-width: 46em; }
.strip .cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-ghost.light { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost.light:hover { border-color: #fff; }

@media (max-width: 800px) {
  .hero-home { grid-template-columns: 1fr; padding-top: 20px; }
  .wall { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}
@media (max-width: 640px) {
  main { padding: 16px; }
  .site-header { padding: 0 14px; }
  .site-header { gap: 8px; }
  .brand { font-size: 11px; letter-spacing: .06em; }
  .brand small { display: none; }
  .site-header nav { gap: 2px; }
  .site-header nav a { padding: 6px 7px; font-size: 13px; }
  .site-header nav a:nth-child(2), .site-header nav a.signin { display: none; }
  .site-header nav a.support { padding: 5px 9px; }
  .site-footer { padding: 18px 16px 32px; }
  .pages-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .sil { height: 110px; }
  .filters { padding: 10px; }
  .wall { grid-template-columns: repeat(3, 1fr); }
  .hero-btn { width: 36px; height: 36px; font-size: 18px; }
}
