/* v13-transit — Схема маршрутов */
:root {
  --bg: #F5F7F9;
  --plate: #FFFFFF;
  --ink: #16202B;
  --muted: #5B6673;
  --hair: #D9DEE5;
  --field: #B9C1CB;
  --grey: #C8CED6;
  --grey-text: #8A94A0;
  --riga: #1F5BA8;  --riga-t: #174A8A;
  --kyiv: #C3362B;  --kyiv-t: #A52C23;
  --online: #6E3FB0; --online-t: #5A3290;
  --accent: var(--riga);
  --accent-t: var(--riga-t);
  --rail: 28px;
  --gutter: 16px;
  --measure: 66ch;
  --text: "Rubik", system-ui, sans-serif;
  --display: "Unbounded", "Rubik", system-ui, sans-serif;
}
html[data-city="kyiv"] { --accent: var(--kyiv); --accent-t: var(--kyiv-t); }
html[data-city="online"] { --accent: var(--online); --accent-t: var(--online-t); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--text);
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: var(--accent-t); text-decoration-thickness: 1px; text-underline-offset: .18em; }
p { margin: 0 0 1rem; max-width: var(--measure); }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- hero ---------- */
.hero { padding: 1.75rem 0 0; }
.hero__grid { display: grid; gap: 1.5rem; }
h1 {
  font: 600 2.6rem/1.05 var(--display);
  font-size: clamp(2.05rem, 8.4vw, 3.7rem);
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.lede { font-size: 1.2rem; line-height: 1.4; font-weight: 500; max-width: 30ch; }
.support { color: var(--muted); max-width: 48ch; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.25rem 0 1rem; }
.legend__label { color: var(--muted); font-size: .95rem; margin-right: .25rem; }
.legend__item {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 500 .95rem/1 var(--text); color: var(--ink);
  background: var(--plate); border: 1px solid var(--hair); border-radius: 999px;
  padding: .55rem .95rem .55rem .7rem; cursor: pointer;
  transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
.legend__item:hover { border-color: var(--ink); }
.legend__swatch { width: 22px; height: 6px; border-radius: 3px; background: var(--sw); }
.legend__item--riga { --sw: var(--riga); }
.legend__item--kyiv { --sw: var(--kyiv); }
.legend__item--online { --sw: var(--online); }
.legend__item--online .legend__swatch { background: none; height: 0; border-top: 6px dashed var(--sw); border-radius: 0; }
.legend__item[aria-pressed="true"] { border-color: var(--sw); box-shadow: inset 0 0 0 1px var(--sw); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; font-size: .95rem; }
.facts > div { display: contents; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.textlink { font-weight: 500; }

/* diagram */
.map { position: relative; margin: .5rem 0 0; width: 100%; max-width: 520px; }
.map__svg { display: block; width: 100%; height: auto; overflow: visible; }
.line { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .35s ease-out; }
.line--riga { stroke: var(--riga); }
.line--kyiv { stroke: var(--kyiv); }
.line--online { stroke: var(--online); stroke-dasharray: 10 8; }
.line--trunk { stroke: var(--accent); }
.st circle { fill: var(--plate); stroke-width: 3; transition: stroke .35s ease-out; }
.st text { font: 500 12px var(--text); transition: fill .35s ease-out; }
.st--riga circle { stroke: var(--riga); }   .st--riga text { fill: var(--riga-t); }
.st--kyiv circle { stroke: var(--kyiv); }   .st--kyiv text { fill: var(--kyiv-t); }
.st--online circle { stroke: var(--online); } .st--online text { fill: var(--online-t); }
.st--trunk circle { stroke: var(--accent); } .st--trunk text { fill: var(--ink); }
/* the other two lines recede */
html[data-city="riga"] .line--kyiv, html[data-city="riga"] .line--online,
html[data-city="kyiv"] .line--riga, html[data-city="kyiv"] .line--online,
html[data-city="online"] .line--riga, html[data-city="online"] .line--kyiv { stroke: var(--grey); }
html[data-city="riga"] .st--kyiv circle, html[data-city="riga"] .st--online circle,
html[data-city="kyiv"] .st--riga circle, html[data-city="kyiv"] .st--online circle,
html[data-city="online"] .st--riga circle, html[data-city="online"] .st--kyiv circle { stroke: var(--grey); }
html[data-city="riga"] .st--kyiv text, html[data-city="riga"] .st--online text,
html[data-city="kyiv"] .st--riga text, html[data-city="kyiv"] .st--online text,
html[data-city="online"] .st--riga text, html[data-city="online"] .st--kyiv text { fill: var(--grey-text); }

/* the interchange is the action */
.hub {
  position: absolute; left: 7.78%; top: 66.67%;
  transform: translate(-22px, -50%);
  display: inline-flex; align-items: center; gap: .1rem;
  text-decoration: none; color: var(--ink);
  background: var(--plate); border: 2px solid var(--ink); border-radius: 999px;
  padding: .3rem 1rem .3rem .3rem;
  box-shadow: 0 6px 18px rgba(22, 32, 43, .14);
  transition: transform .2s ease-out, box-shadow .2s ease-out, background .2s ease-out, color .2s ease-out;
}
.hub:hover { background: var(--ink); color: #fff; }
.hub:hover .hub__ring-base { stroke: #fff; }
.hub:active { transform: translate(-22px, calc(-50% + 1px)); box-shadow: 0 3px 10px rgba(22, 32, 43, .14); }
.hub__ring { width: 30px; height: 30px; flex: none; }
.hub__ring circle { fill: var(--plate); stroke-width: 3; }
.hub__ring-base { stroke: var(--ink); }
.hub__ring-draw { fill: none !important; stroke: var(--accent); stroke-dasharray: 69.2; stroke-dashoffset: 69.2; transform: rotate(-90deg); transform-origin: 50% 50%; }
.hub__ring-draw.is-drawing { animation: ring-draw .9s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes ring-draw { from { stroke-dashoffset: 69.2; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .hub__ring-draw.is-drawing { animation: none; stroke-dashoffset: 0; } }
.hub__label { font: 600 .92rem/1.25 var(--text); max-width: 13.5rem; padding-left: .35rem; }
@media (min-width: 880px) { .hub__label { white-space: nowrap; max-width: none; } }
.hub__time { font-weight: 700; margin-right: .35rem; }

@media (min-width: 880px) {
  :root { --rail: 40px; --gutter: 32px; }
  .hero { padding-top: 3rem; }
  .hero__grid { grid-template-columns: 520px minmax(0, 1fr); gap: 3.5rem; align-items: start; }
  .map { grid-column: 1; grid-row: 1; margin: 0; }
  .hero__text { grid-column: 2; grid-row: 1; padding-top: .5rem; }
  .legend { margin-top: 1.75rem; }
}

/* ---------- the stops after the interchange ---------- */
.route { position: relative; padding-top: 1rem; padding-bottom: 2rem; }
.route::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(var(--gutter) + var(--rail)); width: 4px;
  background: var(--accent); border-radius: 0 0 2px 2px;
  transition: background .35s ease-out;
}
.stop { position: relative; padding: 2.75rem 0 1.5rem calc(var(--rail) + 32px); }
.stop h2 { font: 700 1.75rem/1.2 var(--text); font-size: clamp(1.5rem, 4.6vw, 2rem); margin: 0 0 1rem; letter-spacing: -0.005em; position: relative; }
.stop h2::before {
  content: ""; position: absolute; left: calc(-32px - 5px); top: .32em;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--plate); border: 3px solid var(--ink);
}
.stop--last { padding-bottom: 3rem; }
.stop--last::after {
  content: ""; position: absolute; left: calc(var(--rail) - 8px); bottom: 0;
  width: 20px; height: 4px; background: var(--accent); border-radius: 2px;
}
@media (min-width: 880px) {
  .stop { padding-left: calc(var(--rail) + 44px); padding-top: 3.5rem; }
  .stop h2::before { left: calc(-44px - 5px); }
}

/* concepts */
.concepts { margin: 1.25rem 0 0; max-width: var(--measure); border-top: 1px solid var(--hair); }
.concepts > div { display: grid; grid-template-columns: 1fr; gap: .15rem; padding: .85rem 0; border-bottom: 1px solid var(--hair); }
.concepts dt { font-weight: 500; color: var(--accent-t); }
.concepts dd { margin: 0; color: var(--muted); }
@media (min-width: 600px) { .concepts > div { grid-template-columns: 12rem 1fr; gap: 1rem; } }

/* steps: the one genuine sequence */
.steps { counter-reset: step; list-style: none; margin: 0 0 1.25rem; padding: 0; max-width: var(--measure); position: relative; }
.steps::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 2px; background: var(--hair); }
.steps li { position: relative; padding: 0 0 .9rem 2.4rem; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .1em;
  width: 24px; height: 24px; border-radius: 50%; background: var(--plate); border: 2px solid var(--accent);
  font: 600 .8rem/20px var(--text); text-align: center; color: var(--accent-t);
}

/* people */
.people { display: grid; gap: 1.25rem; max-width: 46rem; }
.photo {
  width: 100%; max-width: 220px; aspect-ratio: 4 / 5; border: 1px dashed var(--field); border-radius: 8px;
  display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: var(--plate);
}
.people__name { font-weight: 700; font-size: 1.15rem; margin-bottom: .35rem; }
@media (min-width: 640px) { .people { grid-template-columns: 220px 1fr; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1.2 var(--text); color: #fff; background: var(--accent);
  border: 2px solid var(--accent); border-radius: 999px; padding: .85rem 1.5rem; cursor: pointer; text-decoration: none;
  transition: background .2s ease-out, border-color .2s ease-out, transform .15s ease-out;
}
.btn:hover { background: var(--accent-t); border-color: var(--accent-t); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[data-loading] { opacity: .65; cursor: progress; }
.btn[data-loading]::after { content: "…"; }
.btn--line { color: var(--accent-t); background: transparent; }
.btn--line:hover { background: var(--accent); color: #fff; }

/* form */
.note { display: inline-block; font-size: .85rem; color: var(--muted); border: 1px dashed var(--field); border-radius: 6px; padding: .35rem .6rem; }
.form { max-width: 32rem; margin-top: 1.25rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
.form legend, .field label { display: block; font-weight: 500; margin-bottom: .5rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice {
  display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem;
  background: var(--plate); border: 1px solid var(--hair); border-radius: 999px; cursor: pointer; font-size: .95rem;
}
.choice:has(:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin: 0; accent-color: var(--accent); }
.field { margin: 0 0 1.25rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--plate);
  border: 1px solid var(--field); border-radius: 6px; padding: .7rem .8rem;
  caret-color: var(--accent);
}
.field input::placeholder, .field textarea::placeholder { color: #66727E; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field textarea { resize: vertical; min-height: 5.5rem; }
.hint { font-size: .85rem; color: var(--muted); margin: .5rem 0 0; }
.consent { display: flex; gap: .65rem; align-items: flex-start; margin: 0 0 1.25rem; font-size: .95rem; max-width: var(--measure); }
.consent input { margin: .3rem 0 0; accent-color: var(--accent); flex: none; }
.form .btn { margin-bottom: .25rem; }

.done { max-width: 32rem; margin-top: 1rem; background: var(--plate); border: 1px solid var(--hair); border-radius: 10px; padding: 1.25rem 1.5rem; }
.done h3 { margin: 0 0 .75rem; font-size: 1.25rem; color: var(--accent-t); }
.done p:last-child { margin-bottom: 0; }

/* faq */
.faq { margin: 1.5rem 0 0; max-width: var(--measure); border-top: 1px solid var(--hair); }
.faq > div { padding: .8rem 0; border-bottom: 1px solid var(--hair); }
.faq dt { font-weight: 500; }
.faq dd { margin: .15rem 0 0; color: var(--muted); }

/* countdown */
.cd { max-width: var(--measure); }
.cd__row { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin: .25rem 0 1rem; }
.cd__unit { display: flex; flex-direction: column; min-width: 3.5rem; }
.cd__unit b { font: 700 2.6rem/1 var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cd__unit small { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.cd__live, .cd__ended { display: none; font-weight: 500; font-size: 1.25rem; }
.cd[data-state="live"] .cd__before, .cd[data-state="ended"] .cd__before { display: none; }
.cd[data-state="live"] .cd__live { display: block; }
.cd[data-state="ended"] .cd__ended { display: block; }
.cd__date { color: var(--muted); margin: 0; }

/* footer */
.foot { padding: 1.5rem var(--gutter) 3rem; border-top: 1px solid var(--hair); font-size: .95rem; }
.foot p { margin-bottom: .5rem; }
