/* gpx.quadrocicle.ru — та же «полевая» бумага с горизонталями, что у track.quadrocicle.ru,
   но свой акцент: янтарный цвет GPS-трека. */

@font-face { font-family: "Russo One"; src: url(../vendor/fonts/russo-one-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "Russo One"; src: url(../vendor/fonts/russo-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 400; src: url(../vendor/fonts/golos-text-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 400; src: url(../vendor/fonts/golos-text-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2212; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 500; src: url(../vendor/fonts/golos-text-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 500; src: url(../vendor/fonts/golos-text-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2212; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 600; src: url(../vendor/fonts/golos-text-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 600; src: url(../vendor/fonts/golos-text-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2212; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 700; src: url(../vendor/fonts/golos-text-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "Golos Text"; font-weight: 700; src: url(../vendor/fonts/golos-text-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2212; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url(../vendor/fonts/jetbrains-mono-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url(../vendor/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+2212; font-display: swap; }

:root {
  --bg: #efedea; --surface: #fbfaf8; --surface-2: #e6e2dd; --ink: #161413; --muted: #635d58;
  --line: #d8d2cc; --accent: #b4530e; --accent-ink: #ffffff; --accent-soft: #f6e0cc;
  --ok: #2f7a3a; --danger: #a3161a; --anon: #7d766f;
  --shadow: 0 1px 0 rgba(20, 30, 20, .06), 0 6px 18px -10px rgba(20, 30, 20, .35);
  --iso-op: .16;
  --f-display: "Russo One", "Arial Black", "Segoe UI", sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px; --r-lg: 16px; --gutter: clamp(16px, 4vw, 32px); --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e10; --surface: #2c3036; --surface-2: #383d44; --ink: #eef0f3; --muted: #aab1ba;
    --line: #3d434b; --accent: #f39a4a; --accent-ink: #1f0d02; --accent-soft: #4a3220;
    --ok: #82d08d; --danger: #ff9188; --anon: #9aa1aa;
    --shadow: 0 1px 0 rgba(0,0,0,.25), 0 8px 22px -12px rgba(0,0,0,.55);
    --iso-op: .26; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e10; --surface: #2c3036; --surface-2: #383d44; --ink: #eef0f3; --muted: #aab1ba;
  --line: #3d434b; --accent: #f39a4a; --accent-ink: #1f0d02; --accent-soft: #4a3220;
  --ok: #82d08d; --danger: #ff9188; --anon: #9aa1aa;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 8px 22px -12px rgba(0,0,0,.55);
  --iso-op: .26; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--f-body); overflow-x: hidden; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 900; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand-name { font-family: var(--f-display); font-size: 19px; }
.brand-dim { color: var(--muted); font-family: var(--f-body); font-weight: 400; font-size: 16px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 640px) { .brand-dim { display: none; } .nav a { padding: 8px 9px; font-size: 14px; } }

/* ---------- кнопки и поля ---------- */
.btn { --b: var(--surface); --c: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--f-body); padding: 10px 14px; border-radius: 9px; cursor: pointer;
  background: var(--b); color: var(--c); border: 1px solid var(--line); text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background .15s ease, border-color .15s ease; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { --b: var(--accent); --c: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 20px; font-size: 16px; border-radius: 11px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .linkish:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="search"], select { width: 100%; font: 400 15px/1.4 var(--f-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
select { width: auto; padding: 6px 8px; font-size: 13px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ---------- первый экран ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--accent); opacity: calc(var(--iso-op) * 1.1);
  -webkit-mask: url("../img/isolines.svg") -200px -120px / 960px 640px repeat; mask: url("../img/isolines.svg") -200px -120px / 960px 640px repeat; }
.hero-in { max-width: var(--max); margin: 0 auto; padding: clamp(36px, 7vw, 84px) var(--gutter) clamp(30px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; }
.kicker { margin: 0 0 12px; font: 500 13px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font: 400 clamp(32px, 5.4vw, 60px)/1.05 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.lead { margin: 18px 0 0; font-size: clamp(16px, 1.6vw, 18px); max-width: 60ch; color: var(--muted); }
.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 26px; }
.hero-note { font-size: 14px; color: var(--muted); }
.hero-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hero-facts li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: baseline;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; }
.hero-facts b { font: 400 20px var(--f-display); color: var(--accent); }
.hero-facts span { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .hero-in { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* ---------- инструмент ---------- */
.tool { padding: clamp(22px, 4vw, 40px) 0; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.tool-map { display: grid; gap: 8px; min-width: 0; position: sticky; top: 76px; }
.mapbox { height: min(76vh, 760px); min-height: 380px; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; background: var(--surface-2); }
.map-hint { margin: 0; font-size: 13px; color: var(--muted); }
.tool-side { display: grid; gap: 14px; min-width: 0; }
@media (max-width: 1000px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-map { position: static; }
  .mapbox { height: 60vh; min-height: 320px; }
}

.panel { position: relative; isolation: isolate; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.panel::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; background: var(--accent); opacity: calc(var(--iso-op) * .55);
  -webkit-mask: url("../img/isolines.svg") -620px -400px / 960px 640px repeat; mask: url("../img/isolines.svg") -620px -400px / 960px 640px repeat; }
.panel-h { display: flex; align-items: center; gap: 9px; font: 700 15px var(--f-body); margin: 16px 0 10px; }
.panel-h:first-child { margin-top: 0; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 12px var(--f-body); }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }
.search-res { list-style: none; margin: 8px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-height: 220px; overflow: auto; }
.search-res button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 7px; font: 400 13px/1.35 var(--f-body); color: var(--ink); cursor: pointer; }
.search-res button:hover, .search-res button:focus-visible { background: var(--accent-soft); outline: none; }
.coords-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.coords { font: 400 13px var(--f-mono); color: var(--muted); overflow-wrap: anywhere; }
.coords.set { color: var(--ink); }

.radius { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.radius input { width: 100%; accent-color: var(--accent); }
.radius output { font: 400 18px var(--f-display); text-align: right; }

.progress { margin-top: 12px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.progress-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.msg { margin: 10px 0 0; font-size: 14px; min-height: 0; }
.msg:empty { display: none; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-head .panel-h { margin: 0; }
.res-stats { font-size: 13px; color: var(--muted); }
.bulk { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.res-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.check-all { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.check-all input, .tr-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.trace-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 70vh; overflow: auto; padding-right: 2px; }
@media (max-width: 1000px) { .trace-list { max-height: none; } }
.tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 10px 10px 8px; border: 1px solid var(--line);
  border-left: 4px solid var(--c); border-radius: 11px; background: var(--surface); transition: background .15s ease, box-shadow .15s ease; }
.tr.hot { box-shadow: 0 0 0 2px var(--c); }
.tr-check { padding-top: 2px; }
.tr-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; cursor: pointer; }
.tr-title:hover { color: var(--accent); }
.tr-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.tr-meta .mono { font-family: var(--f-mono); }
.tr-desc { grid-column: 2; margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 13px; }
.tr-acts a, .tr-acts button { color: var(--accent); }
.tr-acts .busy { opacity: .5; pointer-events: none; }

/* ---------- как это работает ---------- */
.how { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.sec-h { font: 400 clamp(26px, 3.4vw, 36px)/1.1 var(--f-display); margin-bottom: 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { position: relative; isolation: isolate; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; background: var(--accent); opacity: var(--iso-op);
  -webkit-mask: url("../img/isolines.svg") var(--iso-pos, 0 0) / 960px 640px repeat; mask: url("../img/isolines.svg") var(--iso-pos, 0 0) / 960px 640px repeat; }
.card:nth-child(2) { --iso-pos: -310px -170px; }
.card:nth-child(3) { --iso-pos: -150px -455px; }
.num { font: 400 34px/1 var(--f-display); color: var(--accent); }
.card h3 { font: 700 18px var(--f-body); margin: 10px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.usecases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.uc { font-size: 14px; color: var(--muted); padding: 2px 0 0 14px; border-left: 3px solid var(--accent); }
.uc b { color: var(--ink); }
@media (max-width: 760px) { .steps, .usecases { grid-template-columns: minmax(0, 1fr); } }

/* ---------- вопросы ---------- */
.faq { padding: 0 0 clamp(40px, 6vw, 72px); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 20px/1 var(--f-display); color: var(--accent); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); max-width: 70ch; }

/* ---------- подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: 13px; color: var(--muted); text-align: center; }
.footer a { color: var(--muted); }
.footer-studio { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; }
.footer-brand, .footer-studio a { display: inline-flex; align-items: center; gap: 6px; }
.footer-studio a { text-decoration: none; }
.footer-studio a:hover { color: var(--accent); }

/* ---------- карта ---------- */
.leaflet-container { font: 400 13px var(--f-body); background: var(--surface-2); }
.leaflet-control-layers, .leaflet-bar a, .leaflet-control-attribution { color: #222; }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.4; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }
.center-pin { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
