/* Вариант 1 — «Окно». Референс: mymind — огромный круг-окно, мягкое цветное поле вокруг,
   крупная антиква с плотной сборкой, дружелюбный округлый гротеск и цветные «таблетки» с обводкой. */

:root {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, sans-serif;
  --gutter: clamp(16px, 4.2vw, 64px);
  --swap-out: 380ms;
}

body { font-family: var(--sans); }

/* ——— поле и окно ——— */
.field .ph { filter: blur(54px) saturate(1.9) brightness(1.9); transform: scale(1.35); }
.field .ph img.is-ready { animation: none !important; }
.field::after { content: ""; position: absolute; inset: 0; background: rgba(255, 236, 228, .34); }

.window {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: min(120vh, 82vw); aspect-ratio: 1; border-radius: 50%;
  overflow: hidden; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(255, 247, 239, .22), 0 40px 120px -20px rgba(40, 8, 20, .45);
  transition: transform 2.4s var(--ease-film), width 1s var(--ease), height 1s var(--ease);
}
.window-photo { position: absolute; inset: 0; }
body.is-opening .window { transform: translate(-50%, -50%) scale(1.035); }

@media (max-aspect-ratio: 4/5) {
  .window { width: calc(100vw - 2 * var(--gutter) + 8px); height: calc(100svh - 128px - var(--sat) - var(--sab)); aspect-ratio: auto; border-radius: 999px; top: calc(50% + (var(--sat) - var(--sab)) / 2 + 2px); }
}

/* ——— верхняя строка ——— */
.top {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--sat)) calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal));
  height: calc(64px + var(--sat));
}
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 22px/1 var(--sans); letter-spacing: -.01em; color: var(--milk); }
.logo svg { width: 26px; height: 26px; }
.logo sup { font-size: .5em; font-weight: 700; margin-left: 1px; position: relative; top: -.15em; }
.top-nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: clamp(22px, 2.6vw, 44px); white-space: nowrap; }
.top-nav button { font: 500 19px/1 var(--sans); color: rgba(255, 247, 239, .78); transition: color .25s; }
.top-nav button:hover { color: var(--milk); }
.top-nav i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 10px; vertical-align: .16em; }
.top-right { display: flex; align-items: center; gap: 16px; }
.counter { font: 600 15px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .02em; opacity: .78; }

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 17px 30px 18px; border-radius: 999px;
  background: var(--cta); color: #fff;
  font: 650 20px/1 var(--sans); letter-spacing: -.005em;
  box-shadow: 0 14px 38px -14px var(--cta);
  transition: transform .25s var(--ease), background .3s, box-shadow .3s;
}
.cta:hover { transform: translateY(-1px); }
.cta:active { transform: scale(.98); }
.cta--small { padding: 12px 20px 13px; font-size: 17px; }

/* ——— экраны ——— */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(84px + var(--sat)) calc(var(--gutter) + var(--sar)) calc(128px + var(--sab)) calc(var(--gutter) + var(--sal));
}
.copy { position: relative; display: flex; flex-direction: column; gap: clamp(14px, 2vh, 22px); width: 100%; max-width: 1560px; }
.copy::before {
  content: ""; position: absolute; z-index: -1; inset: -18% -12%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(12, 6, 12, .42), rgba(12, 6, 12, 0));
}
.copy--center { align-items: center; text-align: center; margin: 0 auto; }

.headline {
  margin: 0; width: 100%;
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(36px, 8vw, 150px); line-height: .94; letter-spacing: -.037em;
  color: var(--milk); text-shadow: 0 2px 36px rgba(0, 0, 0, .28);
  overflow-wrap: normal; hyphens: manual;
}
.headline [data-fit-line] { display: block; white-space: nowrap; overflow: hidden; }
.h-lead { display: block; }
.h-title { display: inline; }

.kicker { margin: 0; font: 500 clamp(16px, 1.5vw, 21px)/1.3 var(--sans); color: rgba(255, 247, 239, .9); }
.sub { margin: 0; font: 500 clamp(16px, 1.5vw, 21px)/2 var(--sans); color: rgba(255, 247, 239, .92); max-width: 46ch; }
.note { margin: 0; font: 500 clamp(16px, 1.45vw, 20px)/1.45 var(--sans); color: rgba(255, 247, 239, .92); max-width: 36ch; text-wrap: pretty; }

.pill {
  display: inline-block; margin: 0 2px; padding: 4px 15px 6px; border-radius: 999px;
  border: 1.5px solid var(--pc, var(--c1)); color: var(--pc, var(--c1));
  font: 600 .92em/1.25 var(--sans); white-space: nowrap;
  background: rgba(14, 8, 14, .16);
  transition: background .25s, color .9s, border-color .9s;
}
button.pill:hover { background: rgba(255, 247, 239, .1); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; line-height: 1.3; }
.tags .phrase { margin-right: 6px; }

.intro .headline { margin: 6px 0 4px; }
.intro .sub { margin-bottom: 14px; }
.headline--finale { max-width: 15em; text-wrap: balance; }
.finale .cta { margin-top: 18px; }

/* положение текста в сцене */
.scene { justify-content: flex-end; }
body[data-ty="top"] .scene { justify-content: flex-start; padding-top: calc(110px + var(--sat)); }
body[data-ty="middle"] .scene { justify-content: center; }
body[data-tx="left"] .scene .copy { align-items: flex-start; text-align: left; margin-right: auto; }
body[data-tx="center"] .scene .copy { align-items: center; text-align: center; margin: 0 auto; }
body[data-tx="center"] .scene .tags { justify-content: center; }
body[data-tx="right"] .scene .copy { align-items: flex-end; text-align: right; margin-left: auto; }
body[data-tx="right"] .scene .tags { justify-content: flex-end; }
.scene .copy { max-width: min(1560px, 100%); }

[data-swap].is-out { filter: blur(7px); transform: translateY(10px); }
body[data-dir="prev"] [data-swap].is-out { transform: translateY(-10px); }

/* ——— подпись автора снимка (обязательна по лицензии) ——— */
.credit {
  position: fixed; z-index: 20; left: calc(var(--gutter) + var(--sal)); right: calc(var(--gutter) + var(--sar)); bottom: calc(84px + var(--sab));
  margin: 0; text-align: center; pointer-events: none;
}
.credit button { pointer-events: auto; font: 500 11.5px/1.3 var(--sans); color: rgba(255, 247, 239, .58); letter-spacing: .01em; }
body[data-mode="intro"] .credit { bottom: calc(22px + var(--sab)); }

/* ——— таймлайн: цветные точки, как меню у mymind ——— */
.tl { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(10px + var(--sab)); padding: 0 calc(58px + var(--sar)) 0 calc(58px + var(--sal)); }
.tl-line { display: none; }
.tl-track { gap: 30px; padding: 4px 8px 6px; }
.tl-track::before, .tl-track::after { content: ""; flex: 1 0 0px; }
.tl-dot { display: flex; flex-direction: column-reverse; align-items: center; gap: 9px; min-height: 52px; justify-content: flex-end; padding: 0 2px; color: rgba(255, 247, 239, .62); transition: color .3s; }
.tl-dot::before { content: ""; position: absolute; left: -16px; right: -16px; bottom: 6px; height: 1px; background: rgba(255, 247, 239, .26); }
.tl-pin { position: relative; z-index: 1; width: 9px; height: 9px; margin: 2px 0 2px; border-radius: 50%; background: var(--dot, var(--milk)); transition: transform .4s var(--ease), box-shadow .4s; }
.tl-label { font: 600 14px/1.1 var(--sans); white-space: nowrap; }
.tl-date { display: none; }
.tl-dot:hover { color: var(--milk); }
.tl-dot.is-active { color: var(--milk); }
.tl-dot.is-active .tl-pin { transform: scale(1.35); box-shadow: 0 0 0 3px rgba(20, 10, 16, .35), 0 0 0 5px var(--dot); }
.tl-dot.is-active .tl-date:not(:empty) { display: inline; margin-right: 6px; opacity: .7; font-weight: 500; }
.tl.is-past .tl-dot { color: rgba(255, 247, 239, .5); }
.tl-arrow { position: absolute; bottom: 2px; width: 44px; height: 44px; border-radius: 50%; font: 600 18px/1 var(--sans); color: rgba(255, 247, 239, .78); transition: background .25s, opacity .25s; }
.tl-arrow:hover { background: rgba(255, 247, 239, .1); }
.tl-arrow--prev { left: calc(10px + var(--sal)); }
.tl-arrow--next { right: calc(10px + var(--sar)); }
body[data-mode="finale"] .tl-arrow--next { opacity: .25; pointer-events: none; }

/* ——— панели: белые карточки mymind ——— */
.panel {
  left: 10px; right: 10px; bottom: calc(10px + var(--sab));
  max-height: calc(100svh - 90px - var(--sat)); overflow: auto; overscroll-behavior: contain;
  padding: 22px 22px 20px; border-radius: 30px;
  background: #fffaf6; color: #2b2327;
  font: 500 15px/1.45 var(--sans);
  box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .55);
}
.panel-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font: 400 26px/1 var(--sans); color: #6d6266; }
.panel-close:hover { background: #f2e9e4; }
.panel-kicker { margin: 0 44px 6px 0; font: 700 12px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #8a7d82; display: flex; align-items: center; gap: 8px; }
.panel-kicker i { width: 8px; height: 8px; border-radius: 50%; }
.panel-title { margin: 0 44px 8px 0; font: 500 28px/1.04 var(--serif); letter-spacing: -.025em; color: #1d1619; }
.panel-lead { margin: 0 0 4px; font-weight: 700; }
.panel-small { margin: 0 0 12px; color: #6f6368; font-size: 14px; }
.panel-list { display: grid; grid-template-columns: 112px 1fr; gap: 7px 12px; margin: 12px 0 14px; font-size: 14px; }
.panel-list dt { color: #8f8287; }
.panel-list dd { margin: 0; color: #2b2327; }
.panel-link { display: inline-block; font-weight: 700; color: #b8452a; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel--where { text-align: center; }
.panel--where .panel-title { margin: 10px 0 4px; }
.panel--where canvas { width: min(230px, 62vw); margin: 4px auto 6px; --globe-bg: #1d1520; --globe-ink: rgba(255, 247, 239, .92); --globe-line: rgba(255, 247, 239, .16); --globe-accent: #ff8a6a; }
.panel-coords { font-size: 12.5px; margin-bottom: 0; }

@media (min-width: 760px) {
  .panel { left: auto; right: calc(var(--gutter) + var(--sar)); bottom: calc(96px + var(--sab)); width: 420px; }
  .panel--where { width: 340px; }
}

/* ——— ширина ——— */
.only-narrow { display: none !important; }
@media (max-width: 899px) {
  .only-wide { display: none !important; }
  .only-narrow { display: inline-block !important; }
}

@media (max-width: 560px) {
  .logo { font-size: 20px; }
  .cta { font-size: 18px; padding: 15px 26px 16px; }
  .cta--small { font-size: 15px; padding: 10px 16px 11px; }
  .counter { font-size: 13px; }
  .top-right { gap: 10px; }
  .tags { gap: 8px 6px; }
  .pill { font-size: 14px; padding: 4px 12px 5px; }
  .tags .phrase { flex-basis: 100%; margin: 0 0 2px; }
  .tl-track { gap: 24px; }
  .tl-dot::before { left: -13px; right: -13px; }
  .tl { padding: 0 calc(46px + var(--sar)) 0 calc(46px + var(--sal)); }
  .tl-arrow--prev { left: calc(2px + var(--sal)); }
  .tl-arrow--next { right: calc(2px + var(--sar)); }
  .screen { padding-bottom: calc(118px + var(--sab)); }
}

/* низкий экран: телефон боком */
@media (max-height: 520px) {
  .top { height: calc(52px + var(--sat)); padding-top: calc(8px + var(--sat)); }
  .screen { padding-top: calc(56px + var(--sat)); padding-bottom: calc(86px + var(--sab)); }
  .copy { gap: 8px; }
  .note { font-size: 14px; max-width: 52ch; }
  .sub { font-size: 14px; line-height: 1.8; }
  .pill { font-size: 13px; padding: 3px 11px 4px; }
  .tl-dot { min-height: 40px; }
  .tl-label { font-size: 12.5px; }
  .credit { bottom: calc(56px + var(--sab)); }
  .cta { font-size: 16px; padding: 12px 22px 13px; }
}
