/* Вариант 5 — «Ночь». Референс: Mount Media — почти чёрная страница, снимок в скруглённой карточке
   под узкой верхней строкой с логотипом по центру, тёмно-оранжевый градиент сверху, уходящий в черноту,
   белый заголовок по центру, в котором чередуются тонкая антиква и тонкий гротеск. */

:root {
  --serif: "Spectral", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --ink: #111111;
  --frame: clamp(6px, .9vw, 14px);
  --bar: calc(54px + var(--sat));
  --below: calc(72px + var(--sab));
  --swap-out: 380ms;
}
html, body { background: var(--ink); }
body { font-family: var(--sans); }

/* ——— верхняя строка ——— */
.bar {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: var(--sat) calc(var(--frame) + 14px + var(--sar)) 0 calc(var(--frame) + 14px + var(--sal));
}
.wordmark { display: inline-flex; align-items: baseline; gap: 6px; color: #fff; }
.wordmark b { font: 900 clamp(22px, 2.2vw, 30px)/1 "Golos Text", var(--sans); letter-spacing: -.045em; transform: skewX(-9deg); display: inline-block; }
.wordmark span { font: 300 clamp(20px, 2vw, 28px)/1 var(--sans); letter-spacing: -.03em; }
.bar-side { font: 400 14px/1 var(--sans); color: rgba(255, 255, 255, .72); }
.bar-side--l { justify-self: start; }
.bar-side--r { justify-self: end; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.bar-side--l:hover { color: #fff; }
body.is-sky .bar .wordmark { opacity: .5 !important; visibility: visible !important; }

/* ——— карточка со снимком ——— */
.card {
  position: fixed; z-index: 1; overflow: hidden; isolation: isolate;
  top: var(--bar); left: calc(var(--frame) + var(--sal)); right: calc(var(--frame) + var(--sar)); bottom: var(--below);
  border-radius: clamp(16px, 1.6vw, 26px);
  background: #160e0b;
  transition: bottom .7s var(--ease), top .7s var(--ease);
}
body.is-sky .card { top: calc(var(--frame) + var(--sat)); bottom: calc(var(--frame) + var(--sab)); }
.glow {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #3b1408 0%, #200b06 16%, #7a2410 30%, #d9411e 48%, #ec6c3b 62%, #f2a265 80%, #e0592d 100%);
  mix-blend-mode: overlay; opacity: .95;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .85) 30%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .85) 30%, transparent 72%);
  transition: opacity .7s var(--ease);
}
.fade {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(17, 17, 17, .25) 0%, rgba(17, 17, 17, 0) 26%, rgba(17, 17, 17, 0) 52%, rgba(17, 17, 17, .72) 84%, rgba(17, 17, 17, .94) 100%);
  transition: opacity .7s var(--ease);
}
body.is-sky .glow, body.is-sky .fade { opacity: 0; }

/* ——— экраны ——— */
.screen {
  position: fixed; z-index: 10; top: var(--bar); left: calc(var(--frame) + var(--sal)); right: calc(var(--frame) + var(--sar)); bottom: var(--below);
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: clamp(40px, 13vh, 150px) clamp(18px, 6vw, 120px) clamp(28px, 5vh, 60px);
}
.copy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(12px, 1.8vh, 20px); width: 100%; max-width: 1240px; margin: 0 auto; }
.mix {
  margin: 0; width: 100%; color: #fff; font-size: clamp(36px, 5.6vw, 100px); line-height: 1.02; letter-spacing: -.025em;
  text-wrap: balance; text-shadow: 0 2px 40px rgba(0, 0, 0, .25);
}
.mix .serif { font-family: var(--serif); font-weight: 300; letter-spacing: -.02em; }
.mix .sans { font-family: var(--sans); font-weight: 300; letter-spacing: -.045em; }
.eyebrow { margin: 0; font: 500 12.5px/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 236, 222, .82); }
.note { margin: 0; max-width: 38ch; font: 300 clamp(16px, 1.4vw, 21px)/1.5 var(--sans); color: rgba(255, 255, 255, .88); text-wrap: pretty; }
.note--dim { color: rgba(255, 255, 255, .66); }
.meta { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font: 400 14px/1.4 var(--sans); color: rgba(255, 255, 255, .62); }
.meta button { color: rgba(255, 226, 205, .95); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .25); }
.cta {
  margin-top: 8px; min-height: 52px; padding: 0 30px; border-radius: 999px;
  font: 400 17px/1 var(--sans); color: #fff; letter-spacing: -.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
  transition: background .25s, color .25s;
}
.cta:hover { background: #fff; color: var(--ink); }

/* положение текста */
body[data-ty="middle"] .scene { justify-content: center; }
body[data-ty="bottom"] .scene { justify-content: flex-end; }
body[data-tx="left"] .scene .copy { align-items: flex-start; text-align: left; margin-left: 0; }
body[data-tx="left"] .scene .meta { justify-content: flex-start; }
body[data-tx="right"] .scene .copy { align-items: flex-end; text-align: right; margin-right: 0; }
body[data-tx="right"] .scene .meta { justify-content: flex-end; }

[data-swap].is-out { filter: blur(10px); transform: scale(.985); }

/* ——— полоса под карточкой ——— */
.below {
  position: fixed; z-index: 20; left: calc(var(--frame) + var(--sal)); right: calc(var(--frame) + var(--sar)); bottom: var(--sab); height: 72px;
  display: flex; align-items: center; gap: 6px;
}
.below-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; font: 300 20px/1 var(--sans); color: rgba(255, 255, 255, .7); }
.below-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.below-sky { flex: none; margin-left: 10px; height: 38px; padding: 0 16px; border-radius: 999px; font: 400 13.5px/1 var(--sans); color: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.below-sky:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
body[data-mode="intro"] .below-btn { visibility: hidden; }
.tl { flex: 1; min-width: 0; }
.tl-line { display: none; }
.tl-track { gap: 0; }
.tl-track::before, .tl-track::after { content: ""; flex: 1 0 0px; }
.tl-dot { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: clamp(96px, 11vw, 170px); min-height: 50px; padding: 4px 6px 0; color: rgba(255, 255, 255, .5); }
.tl-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 1px; background: rgba(255, 255, 255, .18); }
.tl-pin { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: rgba(255, 255, 255, .7); transition: transform .35s var(--ease), background .35s, box-shadow .35s; }
.tl-label { display: flex; flex-direction: column; align-items: center; gap: 1px; font: 400 12.5px/1.15 var(--sans); white-space: nowrap; }
.tl-date { font-size: 11px; opacity: .7; }
.tl-date:empty { display: none; }
.tl-dot.is-active { color: #fff; }
.tl-dot.is-active .tl-pin { background: #f08a4b; transform: scale(1.5); box-shadow: 0 0 14px 2px rgba(240, 120, 60, .6); }
.tl-dot:hover { color: #fff; }

.credit { position: fixed; z-index: 20; right: calc(var(--frame) + 22px + var(--sar)); bottom: calc(var(--below) + 14px); margin: 0; }
.credit button { font: 400 11px/1.2 var(--sans); color: rgba(255, 255, 255, .55); }

/* ——— панели ——— */
.panel {
  left: 8px; right: 8px; bottom: calc(8px + var(--sab));
  max-height: calc(100svh - 80px - var(--sat)); overflow: auto; overscroll-behavior: contain;
  padding: 22px 22px 20px; border-radius: 22px;
  background: #1b1716; color: #fff; font: 300 15px/1.5 var(--sans);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.panel-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font: 200 28px/1 var(--sans); color: rgba(255, 255, 255, .8); }
.panel-close:hover { background: rgba(255, 255, 255, .08); }
.panel .eyebrow { margin: 0 44px 10px 0; }
.panel-title { margin: 0 44px 10px 0; font: 300 30px/1.05 var(--serif); letter-spacing: -.02em; }
.panel-lead { margin: 0 0 4px; font-weight: 400; }
.panel-small { margin: 0 0 12px; color: rgba(255, 255, 255, .62); font-size: 14px; }
.panel-list { display: grid; grid-template-columns: 112px 1fr; gap: 7px 12px; margin: 12px 0 16px; font-size: 14px; }
.panel-list dt { color: rgba(255, 255, 255, .5); }
.panel-list dd { margin: 0; }
.panel-link { color: #f6a777; text-decoration: none; font-weight: 400; }
.panel-link:hover { text-decoration: underline; }
.panel--where { text-align: center; }
.panel--where canvas { width: min(240px, 64vw); margin: 4px auto 10px; --globe-bg: #0d0b0b; --globe-ink: rgba(255, 245, 235, .92); --globe-line: rgba(255, 245, 235, .14); --globe-accent: #f08a4b; }
.panel--where .panel-title { margin: 8px 0 4px; }
.panel-coords { font-size: 12.5px; margin-bottom: 0; }
@media (min-width: 760px) {
  .panel { left: auto; right: calc(var(--frame) + 18px + var(--sar)); top: calc(var(--bar) + 18px); bottom: auto; width: 420px; }
  .panel--where { width: 340px; }
}

@media (max-width: 640px) {
  .bar-side { font-size: 13px; }
  .screen { padding: clamp(36px, 9vh, 90px) 18px 26px; }
  .below-sky { display: none; }
  .tl-dot { min-width: 104px; }
  .credit { left: calc(var(--frame) + 18px); right: calc(var(--frame) + 18px); text-align: center; bottom: calc(var(--below) + 10px); }
}
.bar-sky { display: none; font: inherit; color: inherit; }
@media (max-width: 640px) {
  /* на телефоне справа вверху вместо счётчика — «Только небо» */
  .bar-side--r { display: block; }
  .bar-count { display: none; }
  .bar-sky { display: inline; }
}
@media (max-height: 520px) {
  :root { --bar: calc(44px + var(--sat)); --below: calc(56px + var(--sab)); }
  .below { height: 56px; }
  .screen { padding-top: 26px; padding-bottom: 16px; }
  .note { font-size: 14px; }
  .tl-dot { min-height: 40px; }
  .tl-date { display: none; }
  .cta { min-height: 42px; font-size: 15px; }
}
