/*
  Final product polish.
  Motion uses transform and opacity so the interface stays responsive on mobile.
*/
:root{
  --motion-snappy:180ms;
  --motion-screen:320ms;
  --ease-product:cubic-bezier(.22,.8,.24,1);
}

html.intro-was-seen .oek-intro{display:none!important}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img{image-rendering:auto}
html{scroll-padding-top:16px}
h1,h2,h3{scroll-margin-top:16px}

.topbar{
  position:fixed;
  top:0;
  left:50%;
  width:min(100%,720px);
  min-height:0;
  padding:calc(10px + env(safe-area-inset-top,0px)) 18px 10px;
  border:0;
  background:transparent;
  box-shadow:none;
  transform:translate3d(-50%,0,0);
  opacity:1;
  pointer-events:none;
  transition:opacity var(--motion-snappy) ease,transform 240ms var(--ease-product);
  will-change:opacity,transform;
}
.topbar.is-hidden{
  opacity:0;
  transform:translate3d(-50%,-12px,0);
  pointer-events:none;
}
body.story-is-playing .topbar{
  opacity:0;
  transform:translate3d(-50%,-12px,0);
  pointer-events:none;
}
.brand{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  min-height:44px;
  gap:9px;
  align-items:center;
  pointer-events:auto;
  text-decoration:none;
  filter:drop-shadow(0 2px 8px rgba(0,0,0,.58));
}
.topbar.is-hidden .brand,
body.route-is-open .topbar .brand{
  pointer-events:none;
}
.brand-mark-official{
  display:block;
  width:38px;
  height:38px;
  flex:0 0 auto;
}
.brand-wordmark{
  display:flex;
  min-width:0;
  align-items:baseline;
  gap:.34em;
  color:#d8dddd;
  font:800 clamp(10px,2.7vw,14px)/1 var(--font-display);
  letter-spacing:-.018em;
  text-transform:uppercase;
  white-space:nowrap;
  text-shadow:0 2px 7px rgba(0,0,0,.82);
}
.brand-wordmark strong{
  color:#ef7f1a;
  font:inherit;
}
.catalog-controls{position:relative;top:auto}
.novel-topbar{top:0}

.hero-content,
.story-hero-copy{
  padding-top:max(86px,calc(72px + env(safe-area-inset-top,0px)));
}
.route-hero,
#screen-passport .passport-head{
  padding-top:max(92px,calc(78px + env(safe-area-inset-top,0px)));
}
.screen.is-active{animation:none}
.screen.is-active.screen-enter-forward{animation:screen-forward var(--motion-screen) var(--ease-product) both}
.screen.is-active.screen-enter-back{animation:screen-back var(--motion-screen) var(--ease-product) both}
@keyframes screen-forward{
  from{opacity:.18;transform:translate3d(12px,0,0)}
  to{opacity:1;transform:none}
}
@keyframes screen-back{
  from{opacity:.18;transform:translate3d(-10px,0,0)}
  to{opacity:1;transform:none}
}

.brand-logo{aspect-ratio:736/120;object-fit:contain;object-position:left center}
.hero{background-position:center 46%}
.hero-shade{background:
  linear-gradient(90deg,rgba(4,8,10,.92) 0,rgba(4,8,10,.7) 54%,rgba(4,8,10,.24) 100%),
  linear-gradient(180deg,rgba(3,7,8,.08) 0,rgba(3,7,8,.22) 48%,rgba(6,9,10,.985) 94%)}
.intro-complete #screen-home.is-active .hero-content>h1,
.intro-complete #screen-home.is-active .hero-content>.hero-copy,
.intro-complete #screen-home.is-active .hero-content>.lighting-card,
.intro-complete #screen-home.is-active .hero-content>.primary-action,
.intro-complete #screen-home.is-active .hero-content>.hero-secondary,
.intro-complete #screen-home.is-active .hero-content>.hero-note{
  animation:hero-content-in 280ms var(--ease-product) both;
}
.intro-complete #screen-home.is-active .hero-content>.hero-copy{animation-delay:35ms}
.intro-complete #screen-home.is-active .hero-content>.lighting-card{animation-delay:65ms}
.intro-complete #screen-home.is-active .hero-content>.primary-action{animation-delay:95ms}
.intro-complete #screen-home.is-active .hero-content>.hero-secondary{animation-delay:125ms}
.intro-complete #screen-home.is-active .hero-content>.hero-note{animation-delay:150ms}
@keyframes hero-content-in{
  from{opacity:0;transform:translate3d(0,10px,0)}
  to{opacity:1;transform:none}
}

.lighting-card-head small{font-size:12px}
.lighting-card>p,.lighting-card .weather-shift{font-size:12px}
.lighting-source-note{font-size:12px}
.lighting-dot{animation:none;box-shadow:0 0 12px rgba(211,129,37,.35)}

.route-filters{
  padding-right:36px;
  scroll-padding-inline:14px 36px;
  scroll-snap-type:x proximity;
  overscroll-behavior-inline:contain;
}
.route-filters>.filter-btn{scroll-snap-align:center}
.catalog-controls{box-shadow:0 12px 22px rgba(0,0,0,.14)}
.route-grid.is-refreshing .catalog-card{animation:catalog-card-in 300ms var(--ease-product) both}
.route-grid.is-refreshing .catalog-card:nth-child(2){animation-delay:28ms}
.route-grid.is-refreshing .catalog-card:nth-child(3){animation-delay:56ms}
.route-grid.is-refreshing .catalog-card:nth-child(4){animation-delay:84ms}
@keyframes catalog-card-in{
  from{opacity:.1;transform:translate3d(0,8px,0)}
  to{opacity:1;transform:none}
}
.catalog-card{transform:none}
.catalog-card img,.home-route-card img{
  filter:saturate(.9) contrast(1.05);
  backface-visibility:hidden;
}
@media(hover:hover) and (pointer:fine){
  .catalog-card:hover img,.catalog-card:focus-within img,.home-route-card:hover img,.home-route-card:focus-visible img{transform:scale(1.018)}
}
.catalog-card img,.home-route-card img{transition:transform 520ms var(--ease-product),filter 220ms ease}

.route-detail:not([hidden]){animation:route-detail-in 220ms var(--ease-product) both}
@keyframes route-detail-in{
  from{opacity:.25;transform:translate3d(0,12px,0)}
  to{opacity:1;transform:none}
}
.detail-image{
  object-position:center 48%;
  filter:saturate(.92) contrast(1.045);
  backface-visibility:hidden;
  animation:none;
}
@keyframes detail-image-in{
  from{opacity:.5;transform:scale(1.025)}
  to{opacity:1;transform:none}
}

.route-map-marker{transition:filter var(--motion-snappy) ease}
.route-map-marker.is-active{z-index:900!important;filter:drop-shadow(0 0 8px rgba(241,184,111,.78))}
.route-map-marker.is-active span{transform:scale(1.12)}
.route-map .leaflet-marker-pane{isolation:isolate}

.district-labels text{font-size:11px!important;letter-spacing:.02em;paint-order:stroke;stroke:#091013;stroke-width:2.2px;stroke-linejoin:round}

@media(max-width:430px){
  .district-labels text{font-size:14px!important}
  .light-map-labels text{font-size:11px!important}
}

.nav-item:before{
  width:10px;
  border-radius:999px;
  opacity:0;
  transform:translateX(-50%) scaleX(.4);
  transition:width var(--motion-base) var(--ease-product),opacity var(--motion-fast) ease,transform var(--motion-base) var(--ease-product),box-shadow var(--motion-base) ease;
}
.nav-item span{transition:transform var(--motion-base) var(--ease-product),color var(--motion-fast) ease}
.nav-item.is-active:before{width:30px;opacity:1;transform:translateX(-50%) scaleX(1)}
.nav-item.is-active span{transform:translateY(-1px) scale(1.06)}

.primary-action{box-shadow:0 10px 24px rgba(211,129,37,.16)}
.primary-action:active{box-shadow:0 4px 12px rgba(211,129,37,.12)}

.story-frame-ghost{
  position:absolute!important;
  z-index:1!important;
  inset:-2%!important;
  width:auto!important;
  height:auto!important;
  pointer-events:none;
  will-change:opacity,transform;
}
.story-frame-ghost.is-leaving{animation:story-frame-out 380ms var(--ease-product) both}
@keyframes story-frame-out{
  from{opacity:1;transform:scale(1.02)}
  to{opacity:0;transform:scale(1.035)}
}

.decision-review{
  margin-top:22px;
  border-block:1px solid var(--color-border);
}
.decision-review summary{
  position:relative;
  min-height:66px;
  padding:13px 42px 13px 0;
  display:grid;
  align-content:center;
  gap:4px;
  color:var(--paper);
  cursor:pointer;
  list-style:none;
}
.decision-review summary::-webkit-details-marker{display:none}
.decision-review summary:after{
  content:"+";
  position:absolute;
  right:4px;
  top:50%;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border:1px solid var(--color-border-strong);
  color:var(--light-warm);
  transform:translateY(-50%);
  transition:transform var(--motion-base) var(--ease-product),background-color var(--motion-fast) ease;
}
.decision-review[open] summary:after{transform:translateY(-50%) rotate(45deg);background:var(--color-surface)}
.decision-review summary span{font:700 22px/1.1 var(--font-display)}
.decision-review summary small{color:var(--color-text-muted);font-size:12px}
.decision-review[open]>div{animation:review-open 240ms var(--ease-product) both}
@keyframes review-open{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.ending-copy>.result-actions{margin:22px 0 4px}

@media (hover:hover){
  .primary-action:hover{box-shadow:0 14px 30px rgba(211,129,37,.24);transform:translateY(-1px)}
}

@media (max-width:370px){
  .topbar{padding-left:14px;padding-right:14px}
  .brand{gap:7px}
  .brand-mark-official{width:34px;height:34px}
  .brand-wordmark{font-size:11px;gap:.26em}
  .district-labels text{font-size:15px!important}
  .route-filters{padding-right:30px}
}

/* Читаемость служебных подписей и предсказуемая прокрутка заданий */
#journeyPanel{scroll-margin-top:12px}
.light-stage-strip span{font-size:12px!important}
.light-disclaimer{font-size:12px!important;color:#aebabc!important}
.lights-weather,.lights-on label{font-size:12px!important}
.passport-code,.passport-identity p,.passport-share-card>span{font-size:12px!important}
.passport-identity>div>small,.passport-stats span{font-size:12px!important;line-height:1.35}
.passport-seal small,#screen-passport .badge:after{font-size:10px!important}
.passport-share-card>small{font-size:11px!important;line-height:1.35}

@media (min-width:620px){
  .topbar{top:24px}
  .catalog-controls{position:relative;top:auto}
  .novel-topbar{top:24px}
}

@media (prefers-reduced-motion:reduce){
  .screen.is-active.screen-enter-forward,.screen.is-active.screen-enter-back,
  .hero-content>h1,.hero-content>.hero-copy,.hero-content>.lighting-card,.hero-content>.primary-action,.hero-content>.hero-secondary,.hero-content>.hero-note,
  .lighting-dot,.route-grid.is-refreshing .catalog-card,.route-detail:not([hidden]),.detail-image,
  .story-frame-ghost.is-leaving,.decision-review[open]>div{
    animation:none!important;
  }
  .topbar,.catalog-card img,.home-route-card img,.nav-item:before,.nav-item span,.decision-review summary:after{transition:none!important}
}
/* Карточка с текстом выбранной точки маршрута */
.stop-list li .stop-text{min-height:44px;padding:0 10px;border:1px solid rgba(241,184,111,.28);border-radius:999px;background:rgba(241,184,111,.04);color:var(--light-warm);font-family:var(--font-data);font-size:12px;display:inline-flex;align-items:center;gap:6px;cursor:pointer;transition:background-color var(--motion-fast),border-color var(--motion-fast),color var(--motion-fast)}
.stop-list li .stop-text:hover,.stop-list li .stop-text:focus-visible{border-color:var(--light-warm);background:rgba(241,184,111,.12);color:#fff}
.stop-text svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.stop-text-dialog{width:min(calc(100% - 28px),640px);max-width:none;max-height:min(92dvh,760px);padding:0;border:1px solid rgba(241,184,111,.34);border-radius:18px;background:#091114;color:#f4f1e9;overflow:hidden;box-shadow:0 28px 90px rgba(0,0,0,.68)}
.stop-text-dialog::backdrop{background:rgba(2,7,9,.78);backdrop-filter:blur(7px)}
.stop-text-card{display:flex;flex-direction:column;max-height:calc(min(92dvh,760px) - 2px);margin:0;overflow:hidden;background:linear-gradient(180deg,#0d171a,#081013)}
.stop-text-visual{position:relative;flex-shrink:0;height:clamp(170px,32dvh,230px);overflow:hidden;background:#172124}
.stop-text-visual::before{content:"";position:absolute;inset:0;background:linear-gradient(110deg,#111b1e 20%,#243033 38%,#111b1e 58%);background-size:220% 100%;opacity:0;transition:opacity .16s ease}
.stop-text-visual.is-loading::before{opacity:1;animation:stop-image-loading 1.15s linear infinite}
.stop-text-visual::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(3,8,10,.12) 20%,rgba(3,8,10,.88) 100%);pointer-events:none}
.stop-text-visual img{display:block;width:100%;height:100%;object-fit:cover}
@keyframes stop-image-loading{to{background-position:-220% 0}}
.stop-text-heading{position:absolute;z-index:1;left:clamp(20px,5vw,34px);right:72px;bottom:24px}
.stop-text-heading .eyebrow{margin:0 0 8px;color:#f1b86f;font-size:11px;line-height:1.35}
.stop-text-heading h2{margin:0;color:#fff;font-size:clamp(25px,6vw,38px);line-height:1.02;text-wrap:balance}
.stop-text-close{position:absolute;z-index:2;top:14px;right:14px;width:44px;height:44px;padding:0;border:1px solid rgba(255,255,255,.45);border-radius:50%;background:rgba(4,10,12,.68);color:#fff;font-size:28px;line-height:1;cursor:pointer;backdrop-filter:blur(8px)}
.stop-text-close:hover,.stop-text-close:focus-visible{border-color:var(--light-warm);color:var(--light-warm)}
.stop-text-copy{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:clamp(18px,4vw,28px)}
.stop-text-copy .eyebrow{margin:0 0 10px;color:var(--light-warm);font-size:11px}
.stop-text-body{max-width:58ch;margin:0;color:#e4e8e7;font-size:clamp(15.5px,3.6vw,17px);line-height:1.5;white-space:pre-line}
@media(max-width:560px){.stop-list li{grid-template-columns:minmax(0,1fr);gap:7px}.stop-actions{width:100%;justify-self:stretch}.stop-list li .stop-map{margin-left:auto}.stop-text-dialog{width:calc(100% - 18px);max-height:92dvh;border-radius:14px}.stop-text-card{max-height:92dvh}.stop-text-visual{height:clamp(160px,30dvh,205px)}.stop-text-heading{left:20px;right:62px;bottom:18px}.stop-text-heading h2{font-size:clamp(23px,7vw,32px)}.stop-text-copy{padding:18px 20px 22px}}
@media(max-height:720px){.stop-text-visual{height:150px}.stop-text-heading{bottom:14px}.stop-text-heading .eyebrow{margin-bottom:4px}.stop-text-copy{padding:14px 18px 18px}.stop-text-copy .eyebrow{margin-bottom:6px}.stop-text-body{font-size:15px;line-height:1.44}}
@media(prefers-reduced-motion:reduce){.stop-text-dialog::backdrop{backdrop-filter:none}.stop-text-visual::before{animation:none}}

/* Единая геометрия фотографий: кадрируем, но никогда не растягиваем исходник. */
.catalog-card{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
}
.catalog-card img{
  width:100%;
  height:auto!important;
  aspect-ratio:16/9!important;
  object-fit:cover;
  object-position:50% 50%;
  flex:0 0 auto;
}
.catalog-card-body{display:block;width:100%;flex:1 1 auto}
.detail-image{
  width:100%;
  height:auto!important;
  aspect-ratio:16/9;
  max-height:430px;
  object-fit:cover;
}
.stop-text-dialog{width:min(calc(100% - 28px),720px)}
.stop-text-visual{
  height:auto;
  aspect-ratio:16/9;
  max-height:330px;
}
.stop-text-visual img{object-fit:cover;object-position:50% 50%}
@media(max-width:560px){
  .stop-text-visual{height:auto;aspect-ratio:16/9;max-height:205px}
}
@media(max-height:720px){
  .stop-text-visual{height:150px;aspect-ratio:auto}
}
.stop-text-card{max-height:calc(min(92dvh,760px) - 2px)}
.stop-text-visual.is-image-unavailable{height:auto;min-height:100px;max-height:none;aspect-ratio:auto;background:linear-gradient(135deg,#202822,#101b1e)}
.stop-text-visual.is-image-unavailable .stop-text-heading{position:relative;left:auto;right:auto;bottom:auto;padding:24px 68px 22px 22px}
.stop-text-visual img[hidden]{display:none}
@media(max-height:460px){.stop-text-visual{height:112px}.stop-text-heading h2{font-size:24px}.stop-text-heading .eyebrow{font-size:10px}}
.detail-meta .detail-start{flex-basis:100%}
.route-info-disclosure{width:100%;color:var(--text-muted,#aab5b7)}
.route-info-disclosure summary{width:fit-content;min-height:44px;display:list-item;align-content:center;cursor:pointer;color:var(--light-warm,#f0a34d)}
.route-info-disclosure p{margin:0 0 8px;font-size:12px;line-height:1.45}
.route-info-disclosure .detail-duration-note{margin:0 0 8px}
.screen h1[tabindex="-1"]:focus,.screen h2[tabindex="-1"]:focus{outline:none}
