/* =====================================================================
   petin.pro · подход «Путь»
   Система: бумага топокарты, зеленоватые горизонтали, чернильные подписи,
   красная тропа. Ночью - глубокая сине-зеленая карта со светящимися линиями.
   ===================================================================== */

:root {
  --serif: "Alegreya", "PT Serif", Georgia, serif;
  --sans: "Alegreya Sans", "PT Sans", "Segoe UI", sans-serif;
  --caps: "IBM Plex Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif;

  --paper: #f4f0e6;
  --paper-2: #ece6d5;
  --paper-3: #e4dcc7;
  --card: #fbf9f3;
  --land: #f4f0e6;
  --sea: #d8e6e2;
  --sea-line: #9dbfbb;
  --veg: #e0e8cd;
  --vegdot: #b7c79d;
  --contour: #b3c4a3;
  --contour-i: #86a078;
  --coast: #5b8789;
  --stream: #5a92a6;
  --ink: #1e3a5f;
  --ink-2: #3a5575;
  --text: #22292d;
  --muted: #566068;
  --rule: #d6ceb9;
  --rule-2: #bfb49b;
  --trail: #b53a20;
  --trail-2: #cf5a3c;
  --trail-soft: rgba(181, 58, 32, .1);
  --amber: #b8741f;
  --focus: #1e3a5f;
  --on-ink: #f7f3ea;
  --mark-bg: rgba(181, 58, 32, .14);
  --hill: #dde7c1;
  --tree: #eef2dd;
  --door: #e2b25c;
  --road: #a39679;
  --city: #fffdf7;
  --dark-land: #d3cabb;
  --dark-peak: #e2dbcd;
  --dark-ink: #3f3d3a;
  --smoke: #6f6c66;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 6px;
  --ease: cubic-bezier(.22, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .25, 1);

  --fs-body: clamp(1.0625rem, 1rem + .2vw, 1.1875rem);
  --fs-lead: clamp(1.18rem, 1.05rem + .55vw, 1.45rem);
  --fs-h1: clamp(2.7rem, 1.7rem + 3.6vw, 4.8rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
  --fs-h3: clamp(1.35rem, 1.2rem + .6vw, 1.7rem);
  --fs-caps: .78rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0b1d20;
  --paper-2: #0f262a;
  --paper-3: #143036;
  --card: #112a2e;
  --land: #0d2326;
  --sea: #06151a;
  --sea-line: #1f4d54;
  --veg: #0f2d2b;
  --vegdot: #1d4842;
  --contour: #22524a;
  --contour-i: #3b9282;
  --coast: #4fae9f;
  --stream: #3f94a8;
  --ink: #d9ece5;
  --ink-2: #b3cdc5;
  --text: #dbe8e3;
  --muted: #9ab2ab;
  --rule: #214147;
  --rule-2: #2f5a5e;
  --trail: #ff8a66;
  --trail-2: #ffab8e;
  --trail-soft: rgba(255, 138, 102, .12);
  --amber: #f0aa4c;
  --focus: #ffc98a;
  --on-ink: #0b1d20;
  --mark-bg: rgba(255, 138, 102, .2);
  --hill: #16392f;
  --tree: #10302b;
  --door: #8a6a34;
  --road: #3f625d;
  --city: #e9f3ee;
  --dark-land: #02090b;
  --dark-peak: #081416;
  --dark-ink: #7e9b95;
  --smoke: #93aaa4;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0b1d20; --paper-2: #0f262a; --paper-3: #143036; --card: #112a2e; --land: #0d2326;
    --sea: #06151a; --sea-line: #1f4d54; --veg: #0f2d2b; --vegdot: #1d4842; --contour: #22524a;
    --contour-i: #3b9282; --coast: #4fae9f; --stream: #3f94a8; --ink: #d9ece5; --ink-2: #b3cdc5;
    --text: #dbe8e3; --muted: #9ab2ab; --rule: #214147; --rule-2: #2f5a5e; --trail: #ff8a66;
    --trail-2: #ffab8e; --trail-soft: rgba(255, 138, 102, .12); --amber: #f0aa4c; --focus: #ffc98a;
    --on-ink: #0b1d20; --mark-bg: rgba(255, 138, 102, .2);
    --hill: #16392f; --tree: #10302b; --door: #8a6a34; --road: #3f625d; --city: #e9f3ee; --dark-land: #02090b; --dark-peak: #081416; --dark-ink: #7e9b95; --smoke: #93aaa4; color-scheme: dark;
  }
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
/* смена темы: снимки страницы «до» и «после» плавно накладываются за те же полсекунды (app.js, setTheme) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22, .7, .2, 1); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
dl, dd { margin: 0; }
b, strong { font-weight: 700; }
[hidden] { display: none !important; }
::selection { background: var(--mark-bg); color: var(--ink); }

:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
/* копии карты - готовые картинки (art.js): заполняют рамку, как svg с preserveAspectRatio slice, и не мешают нажатиям */
.art-img { object-fit: cover; }
.art-img, .hd-art, .hc-art, .fp-art, .marks-bg { pointer-events: none; user-select: none; -webkit-user-drag: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--radius); text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.sym {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.18em; overflow: visible;
}
.sym-trail { color: var(--trail); }
.sym-trail .sym-dash, .sym .sym-dash { stroke-dasharray: 3.2 3.6; }
.sym-fire .sym-flame, .sym .sym-flame { stroke: var(--trail); }

.caps, .caps-h, .kicker {
  font-family: var(--caps);
  font-size: var(--fs-caps);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.caps-h { color: var(--ink-2); font-weight: 600; }
.kicker { display: inline-flex; align-items: center; gap: .6em; color: var(--ink-2); }
.kicker .sym { width: 1.5em; height: 1.5em; }

.stub { font-style: italic; color: var(--muted); }

/* ---------- кнопки ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: .55em 1.15em;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  font-family: var(--sans); font-size: 1.02rem; font-weight: 500; line-height: 1.1;
  color: var(--ink); background: transparent; text-decoration: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
}
.btn .sym { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease); }
.btn:hover .sym { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-ghost:hover { background: var(--trail-soft); }
.btn-link { border-color: transparent; padding-inline: .3em; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: .3em; text-decoration-thickness: 1px; }
.btn-link:hover { color: var(--trail); }

/* ---------- комнаты и переходы ---------- */
main { display: block; outline: none; }
.room { min-height: 100vh; }
/* вход в раздел. backwards, а не both: по окончании у комнаты не остается застывшего сдвига, из-за которого она оставалась бы отдельным слоем */
.room.is-entering { animation: roomIn .75s var(--ease) backwards; }
/* пока комната проявляется, кольцо у точки «Сейчас» ждет: иначе Firefox на каждом кадре заново собирает всю проявляющуюся комнату */
.room.is-entering .pulse::before { animation-play-state: paused; }
/* раздел, куда ведет приближение карты: пока идет переход, он разложен невидимо поверх (app.js, prepRoom) */
.room.is-prep { position: fixed; left: 0; top: 0; width: calc(100% - var(--sbw, 0px)); visibility: hidden; pointer-events: none; }
/* пока раздел готовится, его анимации стоят на месте и начнутся с начала, когда он появится */
.room.is-prep, .room.is-prep *, .room.is-prep *::before, .room.is-prep *::after { animation-play-state: paused !important; }
@keyframes roomIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- шапка комнаты: заголовок и вводный текст (шапки сайта нет) ---------- */
.room-head { padding-block: clamp(44px, 7vw, 104px) clamp(28px, 4vw, 48px); }
.room-head-text { display: grid; gap: 18px; max-width: 50rem; }
.room-title { font-family: var(--serif); font-size: var(--fs-h1); line-height: .98; font-weight: 500; letter-spacing: -.01em; }
.lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--text); max-width: 38em; }
.room-head .actions { margin-top: 6px; }

.sec-title { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.05; }

/* =====================================================================
   НАВИГАЦИЯ В РАЗДЕЛАХ - медальон «вы здесь» справа внизу (here.js).
   Капсула: круг с кусочком карты + «вы здесь / раздел». При прокрутке вниз
   сворачивается в круг (только transform и opacity). Наведение, фокус или нажатие
   раскрывают вверх карточку с мини-картой. У подвала медальон уходит в панель с картой.
   ===================================================================== */
:root { --hd: 62px; --hd-x: 22px; --hd-y: 22px; }
@media screen and (max-width: 760px) { :root { --hd: 56px; --hd-x: 14px; --hd-y: 14px; } }

.here { position: fixed; right: var(--hd-x); bottom: var(--hd-y); z-index: 60; width: var(--hd); height: var(--hd); --w: 200px; --spring: cubic-bezier(.34, 1.56, .64, 1); }
body.on-home .here { display: none !important; }

.here-dock {
  position: absolute; right: 0; bottom: 0; width: var(--w); height: var(--hd);
  transform-origin: calc(100% - var(--hd) / 2) 50%;
  transition: opacity .3s var(--ease), transform .5s var(--ease), visibility 0s;
}
/* backwards, а не both: застывший конец анимации перебил бы плавный уход медальона в подвал */
.here.is-entering .here-dock { animation: hereIn .8s var(--ease) .25s backwards; }
@keyframes hereIn { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }

/* одна форма: левый край едет вместе с кругом, середина сжимается к правому краю */
.hd-shape {
  position: absolute; inset: 0; pointer-events: none;
  filter: drop-shadow(0 0 .7px color-mix(in srgb, var(--ink-2) 80%, transparent)) drop-shadow(0 8px 20px rgba(20, 30, 40, .17));
}
.hd-cap, .hd-lcap, .hd-mid { position: absolute; top: 0; height: 100%; background: var(--card); }
.hd-cap, .hd-lcap { width: var(--hd); border-radius: 50%; }
.hd-cap { right: 0; }
.hd-lcap { left: 0; }
.hd-mid { left: calc(var(--hd) / 2); right: calc(var(--hd) / 2); transform-origin: 100% 50%; }
.hd-lcap, .hd-mid, .hd-disc { transition: transform .52s var(--ease-io); }

.hd-disc { position: absolute; left: 0; top: 0; width: var(--hd); height: var(--hd); border-radius: 50%; pointer-events: none; }
.hd-disc::before {
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  background: repeating-conic-gradient(var(--ink-2) 0 1.4deg, transparent 1.4deg 10deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  opacity: .5; animation: locTurn 90s linear infinite;
}
@keyframes locTurn { to { transform: rotate(360deg); } }
.hd-clip { position: absolute; inset: 6px; overflow: hidden; border-radius: 50%; background: var(--sea); }
.hd-clip::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-2); transition: box-shadow .3s var(--ease); }
.hd-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.hd-sign {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--land); border: 2px solid var(--trail); color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--land) 45%, transparent), 0 2px 6px rgba(20, 30, 40, .22);
}
.hd-sign .sym { width: 16px; height: 16px; stroke-width: 2.3; }

.hd-text {
  position: absolute; left: calc(var(--hd) + 2px); top: 0; height: 100%; padding-right: 22px;
  display: grid; align-content: center; justify-items: start; white-space: nowrap; line-height: 1.05; pointer-events: none;
  transition: opacity .3s var(--ease) .14s, transform .52s var(--ease-io);
}
.hd-k { font-family: var(--caps); font-size: .64rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hd-nm { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.36rem; line-height: 1.12; color: var(--ink); transition: color .25s var(--ease); }

.here-btn { position: absolute; top: 0; right: 0; width: var(--w); height: 100%; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.here-btn:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.here-dock:hover .hd-nm, .here.is-open .hd-nm { color: var(--trail); }
.here-dock:hover .hd-clip::after, .here.is-open .hd-clip::after { box-shadow: inset 0 0 0 2px var(--trail); }

/* свернутый медальон - один круг */
.here.is-mini .hd-mid { transform: scaleX(0); }
.here.is-mini .hd-lcap, .here.is-mini .hd-disc { transform: translateX(calc(var(--w) - var(--hd))); }
.here.is-mini .hd-text { opacity: 0; transform: translateX(calc((var(--w) - var(--hd)) * .55)); transition: opacity .18s var(--ease), transform .52s var(--ease-io); }
.here.is-mini .here-btn { width: var(--hd); }

/* у подвала медальон уходит в панель */
.here.is-docked .here-dock { opacity: 0; transform: scale(1.35); visibility: hidden; transition: opacity .3s var(--ease), transform .6s var(--ease), visibility 0s linear .3s; }

/* карточка-меню */
.here-card {
  position: absolute; right: 0; bottom: calc(100% + 12px); width: min(344px, calc(100vw - var(--hd-x) * 2));
  padding: 8px; background: var(--card); border-radius: 18px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 26%, transparent), 0 20px 50px rgba(20, 30, 40, .22);
  transform-origin: calc(100% - var(--hd) / 2) 100%;
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.92);
  transition: opacity .2s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
}
.here-card::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.here.is-open .here-card { opacity: 1; visibility: visible; transform: none; transition: opacity .22s var(--ease), transform .5s cubic-bezier(.3, 1.3, .6, 1), visibility 0s; }
.hc-map { position: relative; aspect-ratio: 720 / 760; }
.hc-map::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 35%, transparent); pointer-events: none; }
.hc-art, .hc-lines, .hc-ink { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.hc-art { border-radius: 12px; overflow: hidden; background: var(--sea); }

/* дорожки от текущего места прорисовываются при раскрытии (холст, here.js); как они нарисованы - index.html #map-paint */
.here-sign circle { fill: var(--land); stroke: var(--trail); stroke-width: calc(2.4px * var(--k, 1)); }
.here-sign .m-sym { stroke-width: 2.3; }
.here-pulse { fill: var(--trail); opacity: .35; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .45; } 80%, 100% { transform: scale(3); opacity: 0; } }

/* места-ссылки на мини-карте */
.hc-list { position: absolute; inset: 0; }
.hc-pt { position: absolute; width: 0; height: 0; color: var(--ink); text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent; }
.here.is-open .hc-pt { animation: herePt .5s var(--spring) both; animation-delay: var(--delay, .45s); }
@keyframes herePt { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.hc-ico {
  position: absolute; left: -18px; top: -18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--land); border: 2px solid var(--ink-2); color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--land) 55%, transparent), 0 4px 10px rgba(20, 30, 40, .16);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .35s var(--spring);
}
.hc-ico .sym { width: 21px; height: 21px; stroke-width: 2; }
.hc-txt {
  position: absolute; display: grid; justify-items: center; padding: 1px 9px 3px; border-radius: 8px; white-space: nowrap;
  background: color-mix(in srgb, var(--land) 92%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 22%, transparent), 0 3px 10px rgba(20, 30, 40, .08);
  transition: box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.side-below .hc-txt { left: 0; top: 24px; translate: -50% 0; }
.side-above .hc-txt { left: 0; bottom: 24px; translate: -50% 0; }
.side-right .hc-txt { left: 25px; top: 0; translate: 0 -50%; justify-items: start; }
.side-left .hc-txt { right: 25px; top: 0; translate: 0 -50%; justify-items: end; }
.hc-nm { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.05rem; line-height: 1.15; color: var(--ink); transition: color .25s var(--ease); }
.hc-sub { font-family: var(--caps); font-size: .58rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; line-height: 1.2; color: var(--muted); }
.hc-pt:not([aria-current]) .hc-you { display: none; }
.hc-pt[aria-current] .hc-ico { border-color: var(--trail); color: var(--trail); }
.hc-pt[aria-current] .hc-you { color: var(--trail); font-weight: 600; }
.hc-pt:hover .hc-ico, .hc-pt:focus-visible .hc-ico { background: var(--trail); border-color: var(--trail); color: var(--on-ink); transform: scale(1.08); }
.hc-pt:hover .hc-txt, .hc-pt:focus-visible .hc-txt { background: var(--card); box-shadow: 0 0 0 1.5px var(--ink), 3px 3px 0 var(--trail-soft); }
.hc-pt:hover .hc-nm, .hc-pt:focus-visible .hc-nm { color: var(--trail); }
.hc-pt:focus-visible .hc-ico { outline: 2.5px solid var(--focus); outline-offset: 4px; }

/* День / Ночь - тонкий переключатель (в карточке, в подвале) */
.theme-switch { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--paper-2) 80%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rule-2) 70%, transparent); }
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 28px; padding: 0 14px; border-radius: 999px;
  font-family: var(--caps); font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.theme-switch .sym { width: 14px; height: 14px; stroke-width: 2.1; }
.theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 35%, transparent), 0 1px 3px rgba(20, 30, 40, .12); }
.theme-switch button[aria-pressed="false"]:hover { color: var(--trail); }
.theme-switch button:focus-visible { outline-offset: 1px; border-radius: 999px; }
.hc-home {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 14px;
  border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none;
  font: 600 .84rem/1 var(--sans); letter-spacing: .01em;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rule-2) 85%, transparent);
  transition: color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.hc-home-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; color: var(--trail); }
.hc-home-ico .sym { width: 13px; height: 13px; stroke-width: 2.1; }
.hc-home-sub { margin-left: auto; font-weight: 400; font-size: .74rem; color: var(--ink-2); letter-spacing: .04em; text-transform: lowercase; }
.hc-home:hover, .hc-home:focus-visible { color: var(--trail); box-shadow: inset 0 0 0 1.5px var(--trail); }
.hc-home:active { transform: translateY(1px); }
.hc-home:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .hc-home { transition: none; } }
.hc-theme { display: grid; margin-top: 8px; }
@media screen and (max-width: 760px) { .here-card { width: calc(100vw - var(--hd-x) * 2); } }

@media print { .here { display: none !important; } }

/* ---------- контакты ---------- */
.contacts {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; align-items: start;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--rule-2);
}
.contacts-text { display: grid; gap: 12px; }
.contacts-text h2 { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.05; }
.contacts-text p:last-child { color: var(--muted); max-width: 30em; }
.contacts-links { display: grid; gap: 18px; }
.c-mail {
  display: inline-flex; align-items: center; gap: .4em; width: fit-content; max-width: 100%;
  font-family: var(--serif); font-size: clamp(1.7rem, 1.1rem + 2.4vw, 3rem); font-weight: 500; line-height: 1.1;
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--trail), var(--trail)) 0 100% / 0 2px no-repeat;
  transition: background-size .5s var(--ease), color .3s var(--ease); padding-bottom: 4px;
}
.c-mail .sym { width: .8em; height: .8em; color: var(--trail); stroke-width: 1.8; }
.c-mail:hover { background-size: 100% 2px; }
/* Плитки контактов: по три в ряд при любом их числе (рассчитано на 3-5); ровно четыре - по две в ряд */
.c-list { display: flex; flex-wrap: wrap; gap: 10px; }
.c-list li { flex: 1 1 calc((100% - 20px) / 3); min-width: 0; }
.c-list li:first-child:nth-last-child(4), .c-list li:first-child:nth-last-child(4) ~ li { flex-basis: calc((100% - 10px) / 2); }
.c-list a, .c-list button {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; width: 100%; height: 100%;
  padding: 14px 14px; text-align: left; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--rule-2); border-radius: var(--radius); background: var(--card);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.c-list .sym { grid-row: span 2; width: 1.4em; height: 1.4em; color: var(--ink-2); }
.c-list span { font-weight: 500; line-height: 1.25; }
.c-list .c-handle { font-weight: 400; font-size: .9rem; color: var(--muted); }
.c-list a:hover, .c-list button:hover { border-color: var(--ink); transform: translateY(-2px); }
@media screen and (max-width: 860px) {
  .contacts { grid-template-columns: 1fr; }
}
@media screen and (max-width: 560px) {
  .c-list li, .c-list li:first-child:nth-last-child(4), .c-list li:first-child:nth-last-child(4) ~ li { flex-basis: 100%; }
}

/* ---------- подвал разделов: широкая панель с картой, крупная кнопка «На карту», под ней три раздела ---------- */
.site-foot {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: 1fr auto; min-height: clamp(320px, 28vw, 420px);
  border-top: 1px solid var(--rule-2); background: var(--paper-2);
}
.fp-reveal { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.site-foot.is-closed .fp-reveal { visibility: hidden; }
.fp-box { position: absolute; inset: 0; }
.fp-art, .fp-mark, .fp-ink { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.fp-art { opacity: .55; }
[data-theme="dark"] .fp-art { opacity: .7; }
.fp-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--paper-2) 0, color-mix(in srgb, var(--paper-2) 82%, transparent) 30%, color-mix(in srgb, var(--paper-2) 0%, transparent) 64%),
    linear-gradient(0deg, color-mix(in srgb, var(--paper-2) 90%, transparent) 0, color-mix(in srgb, var(--paper-2) 0%, transparent) 34%);
}
.fp-mark .here-sign circle { fill: var(--land); }
.fp-mark .m-sym { stroke-width: 2.2; }

.fp-inner { position: relative; display: grid; align-content: center; justify-items: start; gap: 16px; padding-block: clamp(44px, 6vw, 80px) 16px; }
.fp-you .fp-dot { --pd: 7px; --p0: .2593; }
.fp-go {
  display: inline-flex; align-items: center; gap: .45em; min-height: 66px; padding: .2em 1.05em .28em .85em;
  border-radius: 999px; background: var(--ink); color: var(--on-ink); text-decoration: none;
  font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(1.7rem, 1.3rem + 1.1vw, 2.3rem); line-height: 1;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--paper-2) 70%, transparent), 0 12px 28px rgba(20, 30, 40, .2);
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.fp-go .sym { width: .82em; height: .82em; stroke-width: 2; }
.fp-arrow { transition: transform .3s var(--ease); }
.fp-go:hover { background: var(--trail); }
.fp-go:hover .fp-arrow { transform: translateX(5px); }
.fp-go:active { transform: translateY(1px) scale(.99); }
.fp-go:focus-visible { outline-offset: 6px; border-radius: 999px; }

/* три раздела: спокойные капсулы со значками мест с карты, та же семья, что места на главной и карточка медальона */
.fp-secs { display: flex; flex-wrap: wrap; gap: 10px; }
.fp-secs > li { display: flex; }
.fp-sec {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative; flex: 1; display: inline-flex; align-items: center; gap: 11px;
  min-height: 54px; padding: 6px 20px 6px 7px; border-radius: 999px;
  color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 30%, transparent), 0 4px 14px rgba(20, 30, 40, .08);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .35s var(--spring);
}
.fp-ico {
  position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--land); border: 2px solid var(--ink-2); color: var(--ink);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.fp-ico .sym { width: 24px; height: 24px; stroke-width: 1.9; }
.fp-ico::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px dashed var(--trail); opacity: 0; transform: scale(.75);
  transition: opacity .25s var(--ease), transform .4s var(--ease);
}
.fp-txt { display: grid; justify-items: start; }
.fp-nm { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.3rem; line-height: 1.1; color: var(--ink); white-space: nowrap; transition: color .25s var(--ease); }
.fp-you { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-family: var(--caps); font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.2; color: var(--trail); white-space: nowrap; }

/* текущий раздел - отметка «вы здесь»: пунктирная рамка, как тропа, без подложки-кнопки */
.fp-sec.is-here { background: color-mix(in srgb, var(--paper-2) 60%, transparent); box-shadow: none; }
.fp-sec.is-here::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1.5px dashed color-mix(in srgb, var(--trail) 60%, transparent); pointer-events: none; }
.fp-sec.is-here .fp-ico { border-color: var(--trail); color: var(--trail); }

a.fp-sec:hover, a.fp-sec:focus-visible { background: var(--card); box-shadow: 0 0 0 1.5px var(--ink), 3px 3px 0 var(--trail-soft), 0 10px 22px rgba(20, 30, 40, .14); transform: translateY(-3px); }
a.fp-sec:hover .fp-ico, a.fp-sec:focus-visible .fp-ico { --cloth-fill: none; --cloth-stroke: currentColor; background: var(--trail); border-color: var(--trail); color: var(--on-ink); }
a.fp-sec:hover .fp-ico::after, a.fp-sec:focus-visible .fp-ico::after { opacity: 1; transform: none; animation: ringSpin 10s linear infinite; }
a.fp-sec:hover .fp-nm, a.fp-sec:focus-visible .fp-nm { color: var(--trail); }
a.fp-sec:active { transform: translateY(-1px) scale(.98); transition-duration: .12s; }
a.fp-sec:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 4px; border-radius: 999px; }
a.fp-sec.is-here:hover::before, a.fp-sec.is-here:focus-visible::before { opacity: 0; }

/* на карте-заднике: пунктир по тропе от текущего места в сторону раздела и его значок */
.fp-route { opacity: 0; transition: opacity .3s var(--ease); }
.fp-route.is-on { opacity: 1; transition-duration: .12s; }
/* сам пунктир прорисовывается на холсте (here.js, draw.js) с той же плавностью; как он нарисован - index.html #map-paint */
.fp-tg { --cloth-fill: none; --cloth-stroke: var(--on-ink); }
.fp-tg circle { fill: var(--trail); stroke: var(--land); stroke-width: calc(2.5px * var(--k, 1)); }
.fp-tg .m-sym { stroke: var(--on-ink); stroke-width: 2.3; }
.fp-tg .fp-tg-ring { fill: none; stroke: var(--trail); stroke-width: calc(1.6px * var(--k, 1)); stroke-dasharray: calc(4px * var(--k, 1)) calc(4px * var(--k, 1)); }
.fp-tg-in { transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(.4); transition: opacity .15s var(--ease), transform .2s var(--ease); }
.fp-route.is-on .fp-tg-in { opacity: 1; transform: none; transition: opacity .2s var(--ease) var(--tgd, .4s), transform .5s cubic-bezier(.34, 1.56, .64, 1) var(--tgd, .4s); }
.site-foot.is-pointing .fp-mark .here-sign circle { stroke-width: calc(3.2px * var(--k, 1)); }

.foot-row { position: relative; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: flex-end; padding-block: 14px 20px; }
.foot-row > .foot-caps:first-child { margin-right: auto; }
.foot-caps { font-family: var(--caps); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* День / Ночь в подвале - скромно, но зона нажатия не меньше 44 px */
.fp-theme button { position: relative; min-height: 30px; }
.fp-theme button::after { content: ""; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }

@media screen and (max-width: 760px) {
  .site-foot { min-height: 400px; }
  .fp-shade {
    background:
      linear-gradient(180deg, var(--paper-2) 0, color-mix(in srgb, var(--paper-2) 86%, transparent) 42%, color-mix(in srgb, var(--paper-2) 0%, transparent) 78%),
      linear-gradient(0deg, color-mix(in srgb, var(--paper-2) 88%, transparent) 0, color-mix(in srgb, var(--paper-2) 0%, transparent) 26%);
  }
  .fp-inner { align-content: start; padding-top: 40px; }
  .fp-go { min-height: 60px; }
}
@media screen and (max-width: 560px) {
  .site-foot { min-height: 560px; }
  .fp-inner { justify-items: stretch; gap: 12px; padding-top: 32px; }
  .fp-go { justify-content: center; }
  .fp-secs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fp-sec { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 4px 9px; border-radius: 18px; text-align: center; }
  .fp-sec.is-here::before { border-radius: 18px; }
  a.fp-sec:focus-visible { border-radius: 18px; }
  .fp-txt { justify-items: center; }
  .fp-nm { font-size: 1.12rem; }
  .fp-you { font-size: .56rem; gap: 5px; letter-spacing: .12em; }
  .foot-coord { display: none; }
  .foot-row { justify-content: space-between; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--radius);
  background: var(--ink); color: var(--on-ink); font-weight: 500;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.print-only { display: none; }

/* =====================================================================
   КАРТА (общая графика в спрайте)
   Рисовка самой карты (вода, суша, горизонтали, знаки, тропа) - в index.html, <style id="map-paint">:
   те же правила art.js кладет в картинки-копии карты. Здесь - подписи, значки и анимации.
   ===================================================================== */
.m-flag { fill: var(--trail); stroke: var(--trail); stroke-width: 3; stroke-linejoin: round; }
.m-symbg { fill: var(--land); stroke: var(--ink-2); stroke-width: 1.5; }
.m-sym { fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.m-sym .sym-flame { stroke: var(--trail); }
.m-sym .sym-dash { stroke-dasharray: 3.2 3.6; }
.m-sym-tiny { stroke: var(--ink-2); stroke-width: 2.4; }
.m-name {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 27px;
  fill: var(--ink); text-anchor: middle;
  paint-order: stroke; stroke: var(--land); stroke-width: 7px; stroke-linejoin: round;
}
.m-caps {
  font-family: var(--caps); font-weight: 500; font-size: calc(13px * var(--k, 1)); letter-spacing: .16em; text-transform: uppercase;
  fill: var(--ink-2);
  paint-order: stroke; stroke: var(--land); stroke-width: calc(5px * var(--k, 1)); stroke-linejoin: round;
}
.m-sub { text-anchor: middle; }
.m-name-left, .m-sub-left { text-anchor: start; }
.m-year { fill: var(--trail); font-weight: 600; }
.m-caps-sea { stroke: var(--sea); font-size: calc(11.5px * var(--k, 1)); fill: var(--coast); }
.m-tiny { font-size: 10.5px; letter-spacing: .12em; }
.m-sym .sym-cloth { stroke: var(--trail); }
.m-sheet { font-size: 11px; stroke: var(--sea); fill: var(--coast); }


/* ---------- рисованные знаки старинной карты ---------- */
.js .m-smoke path { animation: smoke 7.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -2.5s); }
@keyframes smoke {
  0% { opacity: 0; transform: translateY(5px) scale(.85, .7); }
  25% { opacity: .62; }
  70% { opacity: .34; }
  100% { opacity: 0; transform: translateY(-14px) scale(1.1, 1.15); }
}
.js .wf-fall { animation: fall 1.1s linear infinite; }
@keyframes fall { to { stroke-dashoffset: -7; } }
.sym .sym-sign, .m-sym .sym-sign { fill: var(--cloth-fill, color-mix(in srgb, var(--amber) 22%, transparent)); }


/* =====================================================================
   ГЛАВНАЯ - только карта: подпись на море, три места, компас, день/ночь
   ===================================================================== */
/* цвет флажка задан переменными: правила вида «.lm:hover .sym-cloth» не проходят внутрь <use> */
.sym-cloth { fill: var(--cloth-fill, color-mix(in srgb, var(--trail) 22%, transparent)); stroke: var(--cloth-stroke, var(--trail)); }
.sym-flagged { color: var(--ink); }

body.on-home .skip, body.on-home .site-foot { display: none !important; }

.room-home { min-height: 0; }
.map-stage {
  position: relative; overflow: hidden; isolation: isolate;
  height: 100vh; height: 100svh;
  min-height: 520px;
  background: var(--sea);
}
.map-zoom { position: absolute; inset: 0; transform-origin: 0 0; }
.map-zoom.is-anim { transition: transform .85s var(--ease-io); will-change: transform; }
/* слой карты на 16 px шире сцены с каждой стороны (PAR_PAD в app.js): при сдвиге параллакса у края не открывается пустая полоса */
.ml-par { position: absolute; inset: -16px; pointer-events: none; }
.ml-par.is-par { will-change: transform; }
.ml { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; overflow: visible; }
/* Firefox (и Zen) рисует векторные слои на процессоре: графику за краем слоя обрезаем, иначе при параллаксе и приближении
   он заново растрирует карту втрое больше окна. Chrome так не делает, а обрезка заставила бы его перед приближением
   перерисовать слои в крупном масштабе (пауза перед стартом), поэтому только для Firefox (класс gecko ставит скрипт в head) */
.gecko .ml { overflow: hidden; }
.ml-trail { pointer-events: none; }
.land-gap { display: none; }
.map-stage.is-zooming .cartouche,
.map-stage.is-zooming .greet,
.map-stage.is-zooming .now,
.map-stage.is-zooming .compass,
.map-stage.is-zooming .map-theme,
.map-stage.is-zooming .map-coords,
.map-stage.is-zooming .plaque { opacity: 0 !important; transition: opacity .35s var(--ease); }

/* вода и горизонтали едва заметно дышат */
.js .ml-depth { animation: breatheWater 6.5s ease-in-out infinite alternate; }
.js .ml-relief { animation: breatheRelief 9s ease-in-out infinite alternate; }
.map-stage.is-moving .ml-depth, .map-stage.is-moving .ml-relief { animation-play-state: paused; }
@keyframes breatheWater { from { opacity: .55; } to { opacity: 1; } }
@keyframes breatheRelief { from { opacity: .7; } to { opacity: 1; } }

/* тропа прорисовывается при первом показе */
.ht-mask { fill: none; stroke: #fff; stroke-width: 44; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.map-stage.is-intro .ht-mask { animation: trailDraw 2.2s var(--ease-io) .2s both; }
/* свечение тропы ночью: две полупрозрачные обводки шире линии вместо drop-shadow. На вид то же размытие,
   но Firefox не пересчитывает фильтр на каждом кадре прорисовки тропы */
.ht-glow { display: none; }
[data-theme="dark"] .ht-glow {
  display: inline; fill: none; stroke: rgba(255, 138, 102, .2); stroke-width: calc(3.8px * var(--k, 1) + 3.6px);
  stroke-dasharray: calc(11px * var(--k, 1)) calc(8px * var(--k, 1)); stroke-linecap: round;
}
[data-theme="dark"] .ht-glow-2 { stroke: rgba(255, 138, 102, .07); stroke-width: calc(3.8px * var(--k, 1) + 8.4px); }
@keyframes trailDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.m-stops circle { transform-box: fill-box; transform-origin: center; }
.map-stage.is-intro .m-stops circle { animation: stopIn .5s var(--ease) both; animation-delay: calc(.3s + var(--i, 0) * .42s); }
.map-stage.is-intro .ht-year { animation: fadeIn .6s var(--ease) .3s both; }
@keyframes stopIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.map-stage.is-intro .ml-marks { animation: fadeIn 1.1s var(--ease) both; }

/* пасхалка: не навигация, только мышью */
.egg { cursor: pointer; pointer-events: auto; }
.egg-area { fill: transparent; }
.egg .m-caps { stroke-width: 4px; }
.hit-ring {
  fill: none; stroke: var(--trail); stroke-width: 2; stroke-dasharray: 3 3;
  opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6);
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.egg:hover .hit-ring, .egg.is-hot .hit-ring { opacity: 1; transform: scale(1); }

/* места - единственная навигация главной */
.lm-layer { position: absolute; inset: 0; pointer-events: none; }
.lm {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  position: absolute; left: 0; top: 0; z-index: 1;
  display: block; translate: -50% -27px;
  pointer-events: auto; text-decoration: none; color: var(--ink); cursor: pointer;
  border-radius: 14px; outline: none;
  -webkit-tap-highlight-color: transparent;
}
.lm:hover, .lm:focus-visible, .lm.is-hot { z-index: 2; }
.lm-body { display: flex; flex-direction: column; align-items: center; gap: 5px; transition: transform .45s var(--spring); }
.lm-ico {
  position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--land); border: 2px solid var(--ink-2); color: var(--ink);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--land) 65%, transparent), 0 5px 12px rgba(20, 30, 40, .14);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.lm-ico .sym { width: 32px; height: 32px; stroke-width: 1.9; }
.lm-ico::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px dashed var(--trail); opacity: 0; transform: scale(.75);
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.lm-cv .lm-ico { border-color: var(--trail); }
.lm-label {
  display: grid; justify-items: center; gap: 0; padding: 3px 12px 6px; border-radius: 9px;
  background: color-mix(in srgb, var(--land) 90%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 24%, transparent), 0 4px 12px rgba(20, 30, 40, .08);
  white-space: nowrap; translate: var(--shift, 0px) 0;
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.lm-name { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.55rem; line-height: 1.12; color: var(--ink); transition: color .3s var(--ease); }
.lm-hint { font-size: .92rem; line-height: 1.2; color: var(--muted); }
.lm-compact .lm-hint { display: none; }

.lm:hover .lm-body, .lm:focus-visible .lm-body, .lm.is-hot .lm-body { transform: translateY(-6px); }
.lm:hover .lm-ico, .lm:focus-visible .lm-ico, .lm.is-hot .lm-ico {
  --cloth-fill: none; --cloth-stroke: currentColor;
  background: var(--trail); border-color: var(--trail); color: var(--on-ink);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--land) 65%, transparent), 0 10px 22px rgba(20, 30, 40, .22);
}
.lm:hover .lm-ico .sym-cloth, .lm:focus-visible .lm-ico .sym-cloth, .lm.is-hot .lm-ico .sym-cloth { stroke: currentColor; fill: none; }
.lm:hover .lm-ico::after, .lm:focus-visible .lm-ico::after, .lm.is-hot .lm-ico::after { opacity: 1; transform: none; animation: ringSpin 10s linear infinite; }
.lm:hover .lm-label, .lm:focus-visible .lm-label, .lm.is-hot .lm-label {
  background: var(--card); box-shadow: 0 0 0 1.5px var(--ink), 4px 4px 0 var(--trail-soft), 0 10px 22px rgba(20, 30, 40, .14);
}
.lm:hover .lm-name, .lm:focus-visible .lm-name, .lm.is-hot .lm-name { color: var(--trail); }
.lm:active .lm-body { transform: translateY(-2px) scale(.97); transition-duration: .12s; }
.lm:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
@keyframes ringSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* подпись сбоку от значка (высокая карта) */
.lm.lm-right { translate: -27px -50%; }
.lm-right .lm-body { flex-direction: row; gap: 8px; }
.lm-right .lm-label { justify-items: start; translate: none; }

/* места выпрыгивают по очереди, пока тропа до них дорисовывается */
.map-stage.is-intro .lm { animation: lmIn .9s both; animation-delay: calc(.75s + var(--k, 0) * .6s); }
@keyframes lmIn {
  0% { opacity: 0; transform: translateY(16px) scale(.55); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  55% { opacity: 1; transform: translateY(-4px) scale(1.07); animation-timing-function: ease-in-out; }
  78% { transform: translateY(1px) scale(.985); }
  100% { opacity: 1; transform: none; }
}
.map-stage.is-intro .lm-ico::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--trail);
  opacity: 0; animation: lmRipple 1.3s var(--ease) both; animation-delay: calc(1.6s + var(--k, 0) * .6s);
}
@keyframes lmRipple { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }

/* ---------- подпись: приветствие и «Сейчас» на море ---------- */
.cartouche {
  position: absolute; z-index: 3; left: var(--panel-l, var(--gutter)); top: clamp(16px, 4vh, 44px);
  width: var(--panel-w, 420px); max-height: calc(100% - 32px);
  display: grid; gap: 18px; align-content: start;
  container-type: inline-size;
}
.js .map-stage.is-intro .cartouche { animation: fadeUp .9s var(--ease) both; }
.js .map-stage.is-intro .compass { animation: fadeIn .8s var(--ease) .3s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* картуш в рамке, как на старинной карте */
.cartouche {
  padding: 24px 26px 20px;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  border: 1.5px solid var(--ink-2);
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--rule-2), 0 12px 32px rgba(20, 30, 40, .08);
  border-radius: 2px;
}
.cartouche::before,
.cartouche::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--ink-2); background: var(--sea);
  top: -8px; left: -8px; transform: rotate(45deg); pointer-events: none;
}
.cartouche::after { top: auto; left: auto; right: -8px; bottom: -8px; }

.greet { position: relative; display: grid; }
.greet-old, .greet-new { grid-area: 1 / 1; }
.greet-new { display: grid; gap: 12px; align-content: start; }
.hello { font-family: var(--serif); font-size: min(3.3rem, 10.6cqi); line-height: 1; font-weight: 500; }
.hello-text { font-size: clamp(1.08rem, .98rem + .32vw, 1.3rem); line-height: 1.42; color: var(--text); }
.greet-old {
  align-self: start; padding-right: 2.5em;
  font-family: var(--sans); font-size: clamp(1.2rem, 1rem + .6vw, 1.5rem); line-height: 1.45; color: var(--ink-2);
  opacity: 0; visibility: hidden;
}
.greet-old .w { background: linear-gradient(var(--trail), var(--trail)) no-repeat 0 60% / 0 2.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.greet-skip {
  position: absolute; right: -10px; top: -14px; z-index: 1;
  min-height: 36px; padding: 6px 10px;
  font-family: var(--caps); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  text-decoration: underline dashed 1px; text-underline-offset: .3em; border-radius: 4px;
}
.greet-skip:hover { color: var(--trail); }

.greet.is-playing .greet-old { visibility: visible; opacity: 1; animation: oldOut .45s var(--ease) 1.65s both; }
.greet.is-playing .greet-old .w { animation: strike .2s linear both; animation-delay: calc(.55s + var(--i) * .15s); }
.greet.is-playing .ch { opacity: 0; animation: chIn var(--d, .22s) linear both; animation-delay: calc(var(--t0) + var(--i) * var(--dt)); }
@keyframes strike { to { background-size: 100% 2.5px; } }
@keyframes oldOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); visibility: hidden; } }
@keyframes chIn { from { opacity: 0; } to { opacity: 1; } }

.now { display: grid; gap: 4px; padding-top: 14px; border-top: 1px dashed var(--rule-2); }
.now-title { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; margin-bottom: 2px; }
.now-title .pulse { order: 1; }
.now-title .caps { order: 2; margin-left: auto; font-size: .7rem; }
.now-list { display: grid; }
.now-list > div { display: grid; grid-template-columns: 7.4em 1fr; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--rule); }
.now-list > div:first-child { border-top: 0; }
.now-list dt { font-family: var(--caps); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); padding-top: .35em; }
.now-list dd { font-size: 1.04rem; line-height: 1.32; color: var(--ink); }

/* компас прижат к левому нижнему углу, на воде: при загрузке ищет север, потом чуть покачивается */
.compass { position: absolute; z-index: 2; left: var(--compass-l, 22px); bottom: 40px; width: 84px; height: 84px; overflow: visible; pointer-events: none; }
.c-ring { fill: color-mix(in srgb, var(--sea) 70%, transparent); stroke: var(--coast); stroke-width: 1.4; }
.c-ring2 { fill: none; stroke: var(--coast); stroke-width: 1; stroke-dasharray: 1.5 3.5; }
.c-tick { stroke: var(--coast); stroke-width: 1.6; }
.c-needle { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linejoin: round; }
.c-north { fill: var(--trail); }
.c-pin { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.2; }
.c-n { font-family: var(--caps); font-weight: 600; font-size: 13px; fill: var(--ink-2); }
.c-needle-g, .c-needle-in { transform-origin: 0 0; }
.js .c-needle-in { animation: needleSway 4.6s ease-in-out 3s infinite alternate; }
.map-stage.is-intro .c-needle-g { animation: findNorth 2.9s both; }
@keyframes findNorth {
  0% { transform: rotate(150deg); animation-timing-function: cubic-bezier(.3, 0, .5, 1); }
  34% { transform: rotate(-38deg); animation-timing-function: ease-in-out; }
  54% { transform: rotate(21deg); animation-timing-function: ease-in-out; }
  71% { transform: rotate(-9deg); animation-timing-function: ease-in-out; }
  86% { transform: rotate(3.5deg); animation-timing-function: ease-in-out; }
  100% { transform: rotate(0); }
}
@keyframes needleSway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

.map-coords { position: absolute; z-index: 2; left: calc(var(--compass-l, 22px) + 94px); bottom: 70px; white-space: nowrap; font-family: var(--caps); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); pointer-events: none; }

/* день/ночь - маленький круглый медальон в правом верхнем углу карты, как навигация в разделах */
.map-theme {
  position: absolute; z-index: 4; top: 18px; right: 18px;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  color: var(--ink); background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-2) 45%, transparent), 0 8px 20px rgba(20, 30, 40, .17);
  -webkit-tap-highlight-color: transparent;
}
.map-theme::before {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(var(--ink-2) 0 1.4deg, transparent 1.4deg 10deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  opacity: .5;
}
.map-theme-ico {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--land); box-shadow: inset 0 0 0 1.5px var(--ink-2);
  transition: transform .45s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease);
}
.map-theme .sym { width: 21px; height: 21px; }
.map-theme:hover .map-theme-ico { transform: rotate(-20deg); box-shadow: inset 0 0 0 2px var(--trail); color: var(--trail); }
[data-theme="light"] .map-theme .sym-day, [data-theme="dark"] .map-theme .sym-night { display: none; }

/* табличка при наведении: название, одна строка, иногда короткая фраза */
.plaque {
  position: absolute; z-index: 5; left: 0; top: 0; width: max-content; min-width: 220px; max-width: 300px; pointer-events: none;
  opacity: 0; transform: translate3d(var(--px, 0), var(--py, 0), 0) translateY(8px);
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.plaque.is-on { opacity: 1; transform: translate3d(var(--px, 0), var(--py, 0), 0); }
.plaque-inner {
  position: relative; display: grid; gap: 3px; padding: 10px 15px 11px;
  background: var(--card); color: var(--text);
  border: 1.5px solid var(--ink); border-radius: 3px;
  box-shadow: 4px 4px 0 var(--trail-soft), 0 12px 28px rgba(20, 30, 40, .14);
}
.plaque-inner::after {
  content: ""; position: absolute; left: var(--tail, 50%); width: 12px; height: 12px; background: var(--card);
  border: 1.5px solid var(--ink); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); bottom: -7.5px;
}
.plaque.is-below .plaque-inner::after { bottom: auto; top: -7.5px; transform: translateX(-50%) rotate(225deg); }
.pl-name { display: flex; align-items: center; gap: .4em; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.28rem; line-height: 1.15; color: var(--ink); }
.pl-name .sym { width: 1.05em; height: 1.05em; color: var(--ink-2); }
.pl-line { font-size: .98rem; line-height: 1.35; color: var(--text); }
.pl-say { margin-top: 5px; padding-top: 6px; border-top: 1px dashed var(--rule-2); font-family: var(--serif); font-style: italic; font-size: .9rem; line-height: 1.35; color: var(--muted); }

@media screen and (max-width: 1180px) and (min-width: 1025px) {
  .cartouche { padding: 20px 22px 16px; gap: 14px; }
  .now-list > div { grid-template-columns: 1fr; gap: 0; padding: 6px 0; }
  .now-list dt { padding-top: 0; }
}
@media screen and (max-height: 780px) and (min-width: 1025px) {
  .hello { font-size: min(2.6rem, 10.6cqi); }
  .greet-new { gap: 8px; }
  .hello-text { font-size: 1.06rem; }
  .now-title { font-size: 1.35rem; }
  .now-list > div { padding: 5px 0; }
  .now-list dd { font-size: .98rem; }
  .cartouche { gap: 12px; padding-block: 18px 14px; }
  .lm-name { font-size: 1.4rem; }
  .compass { width: 70px; height: 70px; bottom: 34px; }
  .map-coords { left: calc(var(--compass-l, 22px) + 80px); bottom: 58px; }
}

/* телефон и планшет: та же земля вертикально - вода сверху (приветствие), путь сверху вниз, вода снизу («Сейчас») */
@media screen and (max-width: 1024px) {
  .map-stage { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .cartouche { display: contents; }
  .cartouche::before, .cartouche::after { display: none; }
  .greet { order: 1; position: relative; z-index: 3; margin: 16px var(--gutter) 12px; }
  .land-gap { display: block; order: 2; flex: none; height: var(--land-h, 680px); }
  .now { order: 3; position: relative; z-index: 3; margin: 6px var(--gutter) 84px; }
  .js .map-stage.is-intro .greet, .js .map-stage.is-intro .now { animation: fadeUp .9s var(--ease) both; }
  .map-stage .greet,
  .map-stage .now {
    padding: 16px 18px 14px;
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    border: 1.5px solid var(--ink-2);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--rule-2), 0 10px 26px rgba(20, 30, 40, .08);
    border-radius: 2px;
  }
  .map-stage .now { padding-top: 14px; }
  .hello { font-size: clamp(1.95rem, 1.3rem + 2.6vw, 2.6rem); }
  .greet-new { gap: 6px; }
  .hello-text { font-size: 1.04rem; line-height: 1.4; }
  .greet-old { font-size: 1.06rem; line-height: 1.4; }
  .greet-skip { right: -4px; top: -10px; }
  .now-list > div { grid-template-columns: 7.2em 1fr; }
  .compass { left: 14px; bottom: 14px; width: 60px; height: 60px; }
  .map-theme { top: calc(var(--gap-top, 200px) + 10px); right: 10px; width: 46px; height: 46px; }
  .map-theme-ico { width: 33px; height: 33px; }
  .map-theme .sym { width: 19px; height: 19px; }
  .map-coords, .plaque { display: none; }
  .lm-ico { width: 48px; height: 48px; }
  .lm-ico .sym { width: 29px; height: 29px; }
  .lm { translate: -50% -24px; }
  .lm.lm-right { translate: -24px -50%; }
  .lm-name { font-size: 1.3rem; }
  .lm-hint { font-size: .82rem; }
  .lm-label { padding: 2px 10px 5px; }
}

/* =====================================================================
   РЕЗЮМЕ
   ===================================================================== */
/* первый экран: имя и коротко слева, медальон с фото справа */
.cv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(32px, 5vw, 88px); align-items: center; }
.cv-intro { display: contents; }
.medal { justify-self: end; position: relative; margin: 0; width: clamp(230px, 24vw, 340px); aspect-ratio: 1; max-width: 100%; }
.medal-photo { position: absolute; inset: 14%; overflow: hidden; border-radius: 50%; background: var(--paper-3); }
.medal-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 0 0; transform: scale(1.2); }
.medal-ring { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.mr-outer { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 1 1; }
.mr-ticks { fill: none; stroke: var(--ink-2); stroke-width: 4; stroke-dasharray: .7 7.415; opacity: .55; }
.mr-ticks-big { fill: none; stroke: var(--ink-2); stroke-width: 8; stroke-dasharray: 1.2 71.84; opacity: .8; }
.mr-inner { fill: none; stroke: var(--ink-2); stroke-width: .8; stroke-dasharray: 1.6 2.6; opacity: .7; }
.mr-edge { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.mr-north { fill: var(--trail); stroke: var(--paper); stroke-width: 1.6; paint-order: stroke; }
.mr-text { font-family: var(--caps); font-size: 8.4px; font-weight: 500; letter-spacing: 1.35px; text-transform: uppercase; fill: var(--ink-2); text-anchor: middle; }
.js .mr-outer { animation: medalDraw 1.8s var(--ease-io) .15s both; }
.js .mr-ticks, .js .mr-ticks-big, .js .mr-inner, .js .mr-text, .js .mr-north { animation: fadeIn 1s var(--ease) .7s both; }
.js .medal-photo { animation: medalIn 1s var(--ease) both; }
@keyframes medalDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes medalIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@media screen and (max-width: 760px) {
  .cv-head { grid-template-columns: minmax(0, 1fr); }
  .medal { order: -1; justify-self: start; width: 184px; margin-bottom: 22px; }
}


.cv-name { font-size: clamp(2.8rem, 1.6rem + 4vw, 5.2rem); }
.cv-role { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); line-height: 1.15; color: var(--ink-2); margin-top: -4px; }
.now-line { display: flex; gap: 12px; align-items: baseline; font-size: 1.08rem; color: var(--ink); padding: 10px 14px; background: var(--trail-soft); border-left: 3px solid var(--trail); width: fit-content; max-width: 100%; }
/* по базовой линии строки ставится нижний край коробки, а она на 10 px ниже точки: сдвигаем обратно; верхнее поле -20 px,
   чтобы строка не стала выше */
.now-line .now-dot { margin: -20px -10px 0; transform: translateY(9px); }
/* точка «Сейчас» с расходящимся кольцом (главная, Резюме, опыт по годам, Полка, подвал). Раньше кольцо было тенью (box-shadow),
   и страница перерисовывалась на каждом кадре. Теперь кольцо - отдельный кружок под точкой: он только растет и тает
   (transform и opacity), это браузер ведет сам. Размер и прозрачность те же: тень расходилась на 10 px от края точки.
   Коробка точки на 10 px шире с каждой стороны (и настолько же отрицательные поля - место в строке прежнее) и обрезает
   все, что за ней: Chrome тогда знает, что растущее кольцо не выйдет за эти 30 px, и не выносит соседний текст в отдельные слои */
.pulse { --pd: 10px; --p0: .3333; position: relative; flex: none; width: calc(var(--pd) + 20px); height: calc(var(--pd) + 20px); margin: -10px; overflow: hidden; overflow: clip; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.pulse::before { background: rgba(181, 58, 32, .45); opacity: 0; animation: nowRing 2.4s var(--ease) infinite; }
.pulse::after { inset: 10px; background: var(--trail); }
@keyframes nowRing { 0% { transform: scale(var(--p0)); opacity: 1; } 80%, 100% { transform: scale(1); opacity: 0; } }

/* отметки высот */
.marks { position: relative; overflow: hidden; border-block: 1px solid var(--rule-2); background: var(--paper-2); padding-block: 30px 36px; }
.marks-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; pointer-events: none; }
.marks-bg { -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.marks .wrap { position: relative; }
/* Главное в цифрах. Плиток может быть сколько угодно (рассчитано на 3-8): строка гибкая,
   доли те же, что были у сетки - первая плитка 1.35 доли, остальные по одной */
.marks-list { display: grid; grid-auto-flow: column; grid-template-columns: 1.35fr; grid-auto-columns: 1fr; margin-top: 18px; }
.mark { position: relative; display: grid; align-content: start; gap: 8px; padding: 6px var(--mark-pad, 22px); border-left: 1px dashed var(--rule-2); }
.mark:first-child { padding-left: 0; border-left: 0; }
.mark-tri { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid var(--trail); }
.mark-num {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: calc(clamp(2.5rem, 1.6rem + 2.6vw, 4.2rem) * var(--mark-k, 1)); line-height: .95; letter-spacing: -.01em;
  font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; white-space: nowrap;
}
.mark-num small { font-size: .5em; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.mark-lead .mark-num { font-size: calc(clamp(3rem, 1.8rem + 3.6vw, 5.4rem) * var(--mark-k, 1)); color: var(--trail); }
.mark-lead .mark-num small { color: var(--trail); }
.mark-label { font-size: 1rem; line-height: 1.35; color: var(--text); max-width: 16em; }
.marks-list .mark:nth-child(2) { transition-delay: .08s; }
.marks-list .mark:nth-child(3) { transition-delay: .16s; }
.marks-list .mark:nth-child(4) { transition-delay: .24s; }
.marks-list .mark:nth-child(5) { transition-delay: .32s; }
/* шестая и все следующие плитки появляются вместе - дальше тянуть очередь незачем */
.marks-list .mark:nth-child(n+6) { transition-delay: .4s; }
/* когда плиток шесть и больше, каждой достается меньше места:
   уменьшаем число и поля, иначе цифры не влезают */
@media screen and (min-width: 1201px) {
  .marks-list .mark:nth-last-child(n+6), .marks-list .mark:nth-last-child(n+6) ~ .mark { --mark-k: .78; --mark-pad: 16px; }
  .marks-list .mark:nth-last-child(n+8), .marks-list .mark:nth-last-child(n+8) ~ .mark { --mark-k: .64; --mark-pad: 12px; }
}

@media screen and (max-width: 1100px) {
  /* по две плитки в ряд, первая - на всю ширину; начало ряда (2-я, 4-я, 6-я...) без левой черты */
  .marks-list { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-auto-columns: auto; gap: 22px 0; }
  .mark { padding: 4px 16px; }
  .marks-list .mark:first-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  .mark:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* маршрут */
.route { padding-block: clamp(48px, 6vw, 80px) 40px; }
.route-intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 64px; align-items: end; margin-bottom: clamp(28px, 3vw, 40px); }
.route-intro p { font-size: var(--fs-lead); line-height: 1.45; max-width: 32em; }
.route-key { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--caps); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.route-key li { display: inline-flex; align-items: center; gap: 8px; }
.route-key i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--rule-2); }
.route-key .k-did { border-top-color: var(--ink-2); }
.route-key .k-res { border-top: 3px solid var(--trail); }

/* весь опыт по годам: участки тропы на профиле */
.jobs { margin: 0 0 clamp(48px, 6vw, 80px); padding: 22px 24px 18px; background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 4px; position: relative; overflow-x: clip; }
.jobs::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-radial-gradient(ellipse at 78% 120%, transparent 0 22px, color-mix(in srgb, var(--contour) 55%, transparent) 22px 23px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 40%, #000 85%, transparent);
}
.jobs-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; }
.jobs-note { font-size: .95rem; color: var(--muted); }
.jobs-chart { --bar-h: 44px; --tier: 30px; position: relative; height: calc(var(--bar-h) + var(--tier) * 2 + 30px + 14px); margin-top: 6px; }
.jobs-list { position: absolute; left: 0; right: 0; top: 0; bottom: 30px; }
.jobs-list li { position: absolute; top: 0; bottom: 0; left: calc(var(--s) / var(--T) * 100%); width: calc(var(--d) / var(--T) * 100%); }
.job { position: absolute; inset: 0 2px 0 0; display: block; text-align: left; color: var(--ink); border-radius: 4px; }
.job-track { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h); }
.job-bar {
  position: absolute; top: 0; bottom: 0; left: var(--bl, 0); width: var(--bw, 100%);
  background: var(--card); border: 1.5px solid var(--rule-2); border-top: 3px solid var(--ink-2); border-radius: 2px 2px 3px 3px;
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--contour) 35%, transparent) 7px 8px);
  transform-origin: 50% 100%;
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.job-bar::before { content: ""; position: absolute; left: -6px; top: -8px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink-2); transition: background-color .3s var(--ease), border-color .3s var(--ease); }
.job-label {
  position: absolute; left: 0; bottom: var(--bar-h);
  display: flex; align-items: baseline; gap: .45em; white-space: nowrap;
  padding: 0 0 calc(8px + var(--t) * var(--tier)) 9px; border-left: 1px dashed var(--rule-2);
  line-height: 1.1; transition: color .3s var(--ease);
}
.jobs-list li:nth-child(odd) { z-index: 2; }
.jobs-list li:nth-child(odd) .job-label { background: linear-gradient(var(--paper-2), var(--paper-2)) 0 0 / calc(100% + 6px) calc(100% - 8px) no-repeat; }
.jobs-list li:hover, .jobs-list li:focus-within { z-index: 3; }
.job-year { font-family: var(--serif); font-size: 1.36rem; font-weight: 700; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.job-name { font-family: var(--caps); font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.is-now .job-bar { background-color: var(--trail-soft); border-color: color-mix(in srgb, var(--trail) 45%, var(--rule-2)); border-top-color: var(--trail); background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--trail) 22%, transparent) 7px 8px); }
.is-now .job-bar::before { border-color: var(--trail); background: var(--trail); }
.job-pulse { position: absolute; right: -2px; top: 50%; margin: -14.5px 0 0; --pd: 9px; --p0: .3103; }
.is-now .job-label { left: auto; right: 0; flex-direction: row-reverse; border-left: 0; border-right: 1px dashed var(--trail); padding: 0 9px calc(8px + var(--t) * var(--tier)) 0; }
.is-now .job-year, .is-now .job-name { color: var(--trail); }
.job:hover .job-bar, .job:focus-visible .job-bar, .job.is-hot .job-bar { transform: translateY(-4px); border-top-color: var(--trail); background-color: var(--trail-soft); box-shadow: 0 8px 16px rgba(20, 30, 40, .12); }
.job:hover .job-bar::before, .job:focus-visible .job-bar::before, .job.is-hot .job-bar::before { border-color: var(--trail); background: var(--trail); }
.job:hover .job-year, .job:hover .job-name, .job:focus-visible .job-year, .job:focus-visible .job-name { color: var(--trail); }
.job:hover .job-label, .job:focus-visible .job-label { border-color: var(--trail); }
.job:focus-visible { outline: none; }
.job:focus-visible .job-bar { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.job:active .job-bar { transform: translateY(-1px) scale(.99); transition-duration: .1s; }

.jobs-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-top: 1px solid var(--ink-2); font-family: var(--caps); font-size: .7rem; letter-spacing: .08em; color: var(--muted); }
.jt { position: absolute; top: 0; left: calc(var(--m) / var(--T) * 100%); padding-top: 9px; translate: -50% 0; font-variant-numeric: tabular-nums; }
.jt::before { content: ""; position: absolute; left: 50%; top: 0; height: 6px; border-left: 1px solid var(--ink-2); }
.jt-now { position: absolute; right: 0; top: 0; padding-top: 9px; color: var(--trail); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.jt:nth-last-child(2) { display: none; }

.jobs.is-in .job-bar { animation: barGrow .8s var(--ease) backwards; animation-delay: calc(.15s + var(--s) * 7ms); }
.jobs.is-in .job-label { animation: fadeIn .6s var(--ease) backwards; animation-delay: calc(.35s + var(--s) * 7ms); }
@keyframes barGrow { from { transform: scaleX(0); transform-origin: 0 50%; } to { transform: scaleX(1); transform-origin: 0 50%; } }

/* подсказка */
.jobs-tip {
  position: absolute; left: 0; top: 0; z-index: 4; width: max-content; max-width: min(320px, 90vw); pointer-events: none;
  display: grid; gap: 2px; padding: 10px 13px 11px;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 3px;
  box-shadow: 4px 4px 0 var(--trail-soft), 0 10px 24px rgba(20, 30, 40, .14);
  opacity: 0; transform: translate3d(var(--tx, 0), var(--ty, 0), 0) translateY(6px);
  transition: opacity .2s var(--ease), transform .3s var(--ease);
}
.jobs-tip.is-on { opacity: 1; transform: translate3d(var(--tx, 0), var(--ty, 0), 0); }
.jt-dates { font-family: var(--caps); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--trail); }
.jt-org { font-family: var(--serif); font-size: 1.15rem; line-height: 1.15; font-weight: 600; color: var(--ink); }
.jt-role { font-size: .95rem; line-height: 1.35; color: var(--text); }
.jt-go { font-size: .82rem; color: var(--muted); margin-top: 3px; }

/* подсветка места в опыте после нажатия */
.stop-card { position: relative; isolation: isolate; }
.stop-card::before { content: ""; position: absolute; inset: -16px -12px -12px -14px; z-index: -1; border-radius: 6px; background: var(--trail-soft); box-shadow: inset 3px 0 0 var(--trail); opacity: 0; pointer-events: none; }
.stop.is-flash .stop-card::before { animation: stopFlash 2.6s var(--ease) both; }
.stop.is-flash .stop-pin { animation: pinPop .9s cubic-bezier(.34, 1.56, .64, 1) .35s both; }
@keyframes stopFlash { 0% { opacity: 0; } 15%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media screen and (max-width: 760px) { .stop-card::before { inset: -10px -8px -8px -10px; } }
@keyframes pinPop { 0% { transform: scale(1); } 45% { transform: scale(1.55); } 100% { transform: scale(1.1); } }

@media screen and (max-width: 900px) {
  .jobs { padding: 18px 16px 14px; }
  .jobs-chart { height: auto; --bar-h: 16px; }
  .jobs-list li:nth-child(odd) .job-label { background: none; }
  .jobs-list { position: relative; inset: auto; display: grid; gap: 2px; }
  .jobs-list li { position: relative; left: auto; width: auto; top: auto; bottom: auto; }
  .job { position: relative; inset: auto; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-height: 44px; padding: 5px 0 7px; }
  .job-label, .is-now .job-label { position: static; flex-direction: row; border: 0; padding: 0; }
  .job-year { font-size: 1.05rem; min-width: 2.6em; }
  .job-name { font-size: .68rem; }
  .job-track { position: relative; left: auto; right: auto; bottom: auto; height: var(--bar-h); }
  .job-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--rule-2); }
  .job-bar { --bl: calc(var(--s) / var(--T) * 100%); --bw: calc(var(--d) / var(--T) * 100%); min-width: 6px; }
  .job-bar::before { width: 9px; height: 9px; left: -4px; top: -6px; border-width: 2px; }
  .job-pulse { right: -7px; margin-top: -13.5px; --pd: 7px; --p0: .2593; }
  .jobs-axis { position: relative; margin-top: 6px; }
  .jt-odd { display: none; }
  .jt-now { display: none; }
  .jt:nth-last-child(2) { display: block; }
}

.route-body { position: relative; }
.route-trail { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.trail-base { fill: none; stroke: var(--rule-2); stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; }
.trail-ink { fill: none; stroke: var(--trail); stroke-width: 3.5; stroke-dasharray: 12 9; stroke-linecap: round; }
.route-ink { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; z-index: 0; }
.route-ink, .route-ink > .route-trail { will-change: transform; }
/* свечение ночью - три полупрозрачные обводки шире линии (на вид как размытая тень), без фильтра: его браузер пересчитывал бы при каждом сдвиге */
.trail-glow { display: none; }
[data-theme="dark"] .trail-glow { display: inline; fill: none; stroke: rgba(255, 138, 102, .12); stroke-width: 5.5px; stroke-dasharray: 12 9; stroke-linecap: round; }
[data-theme="dark"] .trail-glow-2 { stroke: rgba(255, 138, 102, .07); stroke-width: 7.9px; }
[data-theme="dark"] .trail-glow-3 { stroke: rgba(255, 138, 102, .03); stroke-width: 11.5px; }

.stops { position: relative; z-index: 1; display: grid; gap: clamp(44px, 6vw, 88px); }
.stop { display: grid; grid-template-columns: 170px 64px minmax(0, 1fr); align-items: start; }
.stop-when { display: grid; justify-items: end; text-align: right; padding-top: 2px; padding-right: 6px; }
.stop-year { font-family: var(--serif); font-size: clamp(2.2rem, 1.8rem + 1.4vw, 3.2rem); font-weight: 600; line-height: .95; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.stop-span { font-family: var(--caps); font-size: .76rem; letter-spacing: .08em; color: var(--muted); margin-top: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop-pin { justify-self: center; margin-top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 3.5px solid var(--trail); box-shadow: 0 0 0 6px var(--paper); transition: transform .5s var(--ease), background-color .5s var(--ease); }
.stop.is-reached .stop-pin { background: var(--trail); transform: scale(1.1); }
.stop-now .stop-pin { width: 28px; height: 28px; margin-top: 11px; }
.stop-card { display: grid; gap: 6px; padding-left: 10px; }
.stop-org { font-family: var(--caps); font-size: .8rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.stop-title { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.15; font-weight: 500; max-width: 30em; }
.stop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 16px; border-top: 1px solid var(--rule-2); }
.stop-grid-short { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 66.6%; }
.sb { position: relative; display: grid; align-content: start; gap: 8px; padding: 16px 24px 4px 0; font-size: 1.1rem; line-height: 1.52; }
.sb + .sb { padding-left: 22px; border-left: 1px dashed var(--rule-2); }
.sb + .sb::before {
  content: ""; position: absolute; left: -6px; top: -6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--rule-2);
}
.sb h4 { font-family: var(--caps); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.sb-was p { color: var(--muted); }
.sb-did p { color: var(--text); }
.sb-did h4 { color: var(--ink-2); }
.sb-res { margin-top: -1px; border-top: 3px solid var(--trail); }
.sb-res h4 { color: var(--trail); }
.sb-res::before { border-color: var(--trail) !important; background: var(--trail) !important; }
.res-num { font-family: var(--serif); font-size: clamp(2.2rem, 1.7rem + 1.6vw, 3.1rem); font-weight: 600; line-height: .95; color: var(--trail); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.res-num small { font-size: .5em; font-weight: 500; }
.res-num-word { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-style: italic; font-weight: 500; }
.sb-res p:last-child { color: var(--ink); }

.route-end { display: grid; grid-template-columns: 170px 64px 1fr; align-items: center; margin-top: 36px; }
.end-flag { grid-column: 2; justify-self: center; width: 30px; height: 36px; position: relative; }
.end-flag::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 3px; background: var(--trail); }
.end-flag::after { content: ""; position: absolute; left: 7px; top: 1px; border-left: 20px solid var(--trail); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.end-text { grid-column: 3; padding-left: 10px; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ink-2); }

@media screen and (max-width: 1100px) {
  .stop-grid { grid-template-columns: 1fr 1fr; }
  .sb-res { grid-column: 1 / -1; border-left: 0 !important; padding-left: 0 !important; margin-top: 18px; }
  .sb-res::before { left: -6px !important; }
  .stop-grid-short { max-width: none; }
}
@media screen and (max-width: 760px) {
  .route-intro { grid-template-columns: 1fr; }
  .route-key { grid-column: 1; }
  .stop { grid-template-columns: 40px minmax(0, 1fr); }
  .stop-when { grid-column: 2; grid-row: 1; justify-items: start; text-align: left; display: flex; align-items: baseline; gap: 12px; padding: 0 0 6px 10px; }
  .stop-year { font-size: 2.1rem; }
  .stop-span { margin-top: 0; }
  .stop-pin { grid-column: 1; grid-row: 1; margin-top: 8px; width: 20px; height: 20px; }
  .stop-now .stop-pin { width: 24px; height: 24px; margin-top: 6px; }
  .stop-card { grid-column: 2; }
  .stop-grid, .stop-grid-short { grid-template-columns: 1fr; }
  .sb, .sb + .sb { padding: 14px 0 6px; border-left: 0; }
  .sb + .sb { border-top: 1px dashed var(--rule-2); }
  .sb + .sb::before { display: none; }
  .sb-res { border-top: 3px solid var(--trail) !important; margin-top: 10px; }
  .route-end { grid-template-columns: 40px 1fr; }
  .end-flag { grid-column: 1; }
  .end-text { grid-column: 2; }
}

/* как работаю */
.how { padding-block: clamp(56px, 8vw, 100px) 24px; }
.how-head { display: grid; gap: 10px; margin-bottom: 32px; }
/* Как я работаю. Пунктов может быть сколько угодно (рассчитано на 1-10): по пять в ряд.
   Меньше пяти - растягиваются на всю ширину, больше - переносятся в следующий ряд.
   Первый в ряду (1-й, 6-й, 11-й) прижат к краю и без левой черты, второй ряд отделен пунктиром сверху */
.how-list { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--rule-2); }
.how-list li { flex: 0 1 20%; min-width: 0; display: grid; align-content: start; gap: 10px; padding: 22px 22px 8px; border-left: 1px dashed var(--rule-2); }
.how-list li:nth-child(5n+1) { padding-left: 0; border-left: 0; }
.how-list li:nth-child(n+6) { border-top: 1px dashed var(--rule-2); }
.how-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink-2); font-family: var(--serif); font-weight: 600; color: var(--ink); font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.how-list h3 { font-family: var(--serif); font-size: 1.34rem; line-height: 1.2; }
.how-list p { font-size: 1.06rem; color: var(--text); line-height: 1.5; }
.how-list li:nth-child(2) { transition-delay: .06s; } .how-list li:nth-child(3) { transition-delay: .12s; }
.how-list li:nth-child(4) { transition-delay: .18s; } .how-list li:nth-child(5) { transition-delay: .24s; }
.how-list li:nth-child(n+6) { transition-delay: .3s; }
/* пока пунктов не больше пяти, они растягиваются на всю ширину;
   дальше ширина столбца фиксирована, и второй ряд встает ровно под первым */
@media screen and (min-width: 1101px) {
  .how-list li:nth-last-child(-n+5):first-child, .how-list li:nth-last-child(-n+5):first-child ~ li { flex-grow: 1; }
}
@media screen and (max-width: 1100px) {
  /* по два пункта в ряд: начало ряда - нечетные */
  .how-list li { flex-basis: 50%; padding: 20px 20px 16px 0; border-left: 0; border-bottom: 1px dashed var(--rule-2); }
  .how-list li:nth-child(n+6) { border-top: 0; }
  .how-list li:nth-child(even) { padding-left: 20px; border-left: 1px dashed var(--rule-2); }
}
@media screen and (max-width: 560px) {
  .how-list li { flex-basis: 100%; }
  .how-list li:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* Образование и языки: два блока или три - делят ширину поровну, при нехватке места переносятся */
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 64px; padding-block: 40px clamp(48px, 6vw, 72px); }
.edu-block { min-width: 0; display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid var(--rule-2); }
.edu-main { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); line-height: 1.2; margin-top: 6px; }
.edu-block p:last-child { color: var(--muted); }
@media screen and (max-width: 640px) { .edu { grid-template-columns: 1fr; } }

/* =====================================================================
   ЗАМЕТКИ И ПОЛКА - общее: капсулы-фильтры, метки тем, плавный фильтр
   ===================================================================== */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-family: var(--sans); font-size: 1.02rem; font-weight: 500; line-height: 1; color: var(--ink); white-space: nowrap;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-2) 30%, transparent);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.chip:hover { color: var(--trail); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink), 0 4px 12px -6px rgba(20, 30, 40, .45); }
.chip[aria-pressed="true"]:hover { color: var(--on-ink); }
.chip:focus-visible { outline-offset: 3px; border-radius: 999px; }
.chip-n { font-family: var(--caps); font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .3s var(--ease); }
.chip[aria-pressed="true"] .chip-n { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 1px 9px 0; border-radius: 999px;
  font-family: var(--caps); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  color: var(--ink-2); background: color-mix(in srgb, var(--paper-2) 80%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rule-2) 80%, transparent);
  white-space: nowrap;
}

/* фильтр (filter.js): лишнее тает, оставшееся и все, что ниже списка, съезжает на новое место */
.f-out { opacity: 0 !important; transform: translateY(-6px) scale(.985) !important; transition: opacity .2s var(--ease), transform .2s var(--ease) !important; pointer-events: none; }
.f-in { opacity: 0; transform: translateY(12px); }
.f-anim { transition: opacity .45s var(--ease) .08s, transform .52s var(--ease); }

/* =====================================================================
   ЗАМЕТКИ - блог: список записей и одна запись. Фон - бумага карты, как везде
   ===================================================================== */
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; font-family: var(--caps); font-size: .74rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.post-meta > * + *::before { content: "·"; margin: 0 .8em; color: var(--rule-2); }

.posts-wrap { display: grid; gap: clamp(22px, 2.6vw, 32px); padding-block: 0 clamp(64px, 8vw, 110px); }
.posts { display: grid; border-top: 1px solid var(--rule-2); }
.post { min-width: 0; border-bottom: 1px dashed var(--rule-2); }
.post-link {
  display: grid; grid-template-columns: 11.5rem minmax(0, 1fr) 48px; gap: 10px clamp(24px, 3.4vw, 56px); align-items: start;
  padding: 30px 0 32px; color: var(--text); text-decoration: none;
}
.post-link:focus-visible { outline-offset: 6px; }
.post-side { display: grid; gap: 12px; justify-items: start; padding-top: 7px; }
.post-side time, .post-top time { font-family: var(--caps); font-size: .76rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.post-main { display: grid; gap: 8px; }
.post-title { font-family: var(--serif); font-size: clamp(1.45rem, 1.2rem + .8vw, 1.95rem); line-height: 1.15; font-weight: 500; color: var(--ink); text-wrap: balance; transition: color .25s var(--ease); }
.post-ex { font-size: 1.06rem; line-height: 1.5; color: var(--muted); max-width: 38em; }
.post-read { font-family: var(--caps); font-size: .7rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.post-go {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; margin-top: 4px; border-radius: 50%;
  color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink-2) 40%, transparent);
  transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.post-go .sym { width: 20px; height: 20px; transition: transform .35s var(--ease); }
.post-link:hover .post-title { color: var(--trail); }
.post-link:hover .post-go { background: var(--trail); color: var(--on-ink); box-shadow: inset 0 0 0 1.5px var(--trail); }
.post-link:hover .post-go .sym { transform: translateX(3px); }

/* самая свежая запись - крупно, с кусочком карты */
.post-new { border-bottom: 1px solid var(--rule-2); }
.post-new .post-link { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(28px, 3.4vw, 48px) 0; }
.post-text { display: grid; gap: 16px; align-content: center; }
.post-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.post-new .post-title { font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.5rem); line-height: 1.03; }
.post-new .post-ex { font-size: var(--fs-lead); line-height: 1.45; color: var(--text); }
.post-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-top: 4px; }
.post-new .post-read { margin: 0; }
.post-more { display: inline-flex; align-items: center; gap: .45em; font-weight: 500; font-size: 1.08rem; color: var(--trail); }
.post-more .sym { transition: transform .3s var(--ease); }
.post-link:hover .post-more .sym { transform: translateX(4px); }
.post-art { position: relative; display: block; aspect-ratio: 25 / 18; overflow: hidden; border: 1.5px solid var(--ink-2); border-radius: 2px; background: var(--sea); transition: border-color .3s var(--ease); }
.post-art::after { content: ""; position: absolute; inset: 6px; border: 1px solid color-mix(in srgb, var(--ink-2) 40%, transparent); pointer-events: none; }
.post-art > img, .post-art > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; transition: transform 1.2s var(--ease); }
.post-link:hover .post-art { border-color: var(--ink); }
.post-link:hover .post-art > img, .post-link:hover .post-art > svg { transform: scale(1.04); }
.post-pin circle { fill: var(--land); stroke: var(--trail); stroke-width: 2.4; }
.post-pin .m-sym { stroke-width: 2.3; }

@media screen and (max-width: 760px) {
  .post-link { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 24px 0 26px; }
  .post-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 0; }
  .post-go { display: none; }
  .post-new .post-link { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .post-art { order: -1; aspect-ratio: 16 / 9; }
  .chip { padding: 0 15px; font-size: .98rem; }
}

/* одна запись */
.note-top { padding-block: clamp(28px, 4vw, 56px) 0; }
.back-link { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; font-weight: 500; color: var(--ink); text-decoration: underline dashed 1px; text-underline-offset: .28em; }
.back-link:hover { color: var(--trail); }
.note-wrap { display: grid; grid-template-columns: minmax(0, 68ch); justify-content: center; padding-block: clamp(16px, 2.6vw, 40px) clamp(64px, 8vw, 110px); }
.note-head { display: grid; gap: 20px; margin-bottom: clamp(30px, 3.4vw, 44px); }
.note-title { font-family: var(--serif); font-size: clamp(2.2rem, 1.5rem + 2.3vw, 3.5rem); line-height: 1.02; font-weight: 500; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.note-meta .post-meta { font-size: .78rem; }
.note-body { font-size: clamp(1.14rem, 1.05rem + .3vw, 1.28rem); line-height: 1.7; color: var(--text); }
.note-body p + p { margin-top: 1.05em; }
.note-lead { font-size: 1.14em; line-height: 1.55; color: var(--ink); }
.note-h { font-family: var(--serif); font-size: 1.5em; line-height: 1.2; margin: 1.6em 0 .55em; }
.note-h::before { content: ""; display: block; width: 64px; height: 3px; margin-bottom: 20px; background: repeating-linear-gradient(90deg, var(--trail) 0 10px, transparent 10px 17px); }
.note-h + p { margin-top: 0; }
.note-quote { margin: 1.5em 0; padding-left: 22px; border-left: 3px solid var(--rule-2); font-family: var(--serif); font-size: 1.08em; line-height: 1.5; color: var(--ink); }
.note-quote p + p { margin-top: .6em; }
.note-list { margin: 1.05em 0 0; padding-left: 1.15em; list-style: none; }
.note-list li { position: relative; }
.note-list li + li { margin-top: .45em; }
.note-list li::before { content: ""; position: absolute; left: -1.15em; top: .63em; width: 6px; height: 6px; border-radius: 50%; background: var(--trail); }

/* «Читать еще» - одна кнопка к следующей записи (собирает notes.js) */
.note-pn { margin-top: 60px; }
.note-pn:empty { display: none; }

.note-foot { display: grid; gap: 14px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--rule-2); }
.note-foot > p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; color: var(--ink); }
.note-foot-links { display: flex; flex-wrap: wrap; gap: 10px; }
@media screen and (max-width: 640px) {
  .note-pn { margin-top: 44px; }
}

/* прогресс чтения: тропа вдоль левого поля (notes.js), на телефоне и планшете - полоса вверху */
.read-trail { position: fixed; z-index: 40; left: 0; top: 0; right: 0; pointer-events: none; transition: opacity .45s var(--ease); }
.read-trail.is-side { right: auto; width: 40px; }
.read-trail.is-side.is-away { opacity: 0; }
.rt-svg { display: none; overflow: visible; }
.read-trail.is-side .rt-svg { display: block; position: absolute; left: 0; top: 0; }
/* окно красной тропы: шире тропы на 20 px с каждой стороны и выше на 6 px (свечение ночью не обрезается); открывается сдвигом */
.rt-clip { display: none; position: absolute; left: -20px; top: -6px; width: 80px; overflow: hidden; pointer-events: none; }
.read-trail.is-side .rt-clip { display: block; }
.read-trail.is-side .rt-clip > .rt-svg { left: 20px; top: 6px; }
.rt-clip, .rt-clip > .rt-svg, .rt-walk { will-change: transform; }
.rt-base { fill: none; stroke: var(--rule-2); stroke-width: 1.6; stroke-dasharray: 2 7; stroke-linecap: round; }
.rt-ink { fill: none; stroke: var(--trail); stroke-width: 2.6; stroke-dasharray: 9 7; stroke-linecap: round; }
[data-theme="dark"] .rt-ink { filter: drop-shadow(0 0 3px rgba(255, 138, 102, .55)); }
.rt-start { fill: var(--trail); }
.rt-walker { fill: var(--paper); stroke: var(--trail); stroke-width: 2.4; }
.rt-end .m-sym { stroke: var(--rule-2); --cloth-stroke: var(--rule-2); --cloth-fill: transparent; transition: stroke .4s var(--ease); }
.rt-end-in { transform-box: fill-box; transform-origin: 30% 100%; transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); }
.read-trail.is-done .rt-end .m-sym { stroke: var(--trail); --cloth-stroke: var(--trail); --cloth-fill: var(--trail); }
.read-trail.is-done .rt-end-in { transform: scale(1.3); }
.read-trail.is-done .rt-walker { opacity: 0; }
.rt-bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: color-mix(in srgb, var(--paper) 80%, transparent); }
.rt-bar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 1px; height: 2.5px;
  background: repeating-linear-gradient(90deg, var(--trail) 0 9px, transparent 9px 14px);
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
}
.read-trail.is-side .rt-bar { display: none; }
@media print { .read-trail { display: none !important; } }

/* =====================================================================
   ПОЛКА
   ===================================================================== */
.room-shelf {
  --cover-1: #c96f3b; --cover-2: #e2b464; --cover-3: #6f8f6b; --cover-4: #2f4f6f; --cover-5: #8e4b45; --cover-6: #d8c7a3;
  --pages: #f7f2e4; --pages-edge: #ddd2b8;
}
[data-theme="dark"] .room-shelf { --cover-1: #c77a4c; --cover-2: #d9b066; --cover-3: #5f917c; --cover-4: #3f6d96; --cover-5: #a05d56; --cover-6: #3b4f4f; --pages: #e4dcc8; --pages-edge: #b9ad92; }

/* первый экран: заголовок и описание, рядом «Сейчас» */
.shelf-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 410px); gap: 30px clamp(32px, 5vw, 88px); align-items: end; }
.shelf-now {
  position: relative; display: grid; gap: 4px; padding: 20px 24px 12px;
  background: var(--paper); border: 1.5px solid var(--ink-2); border-radius: 2px;
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--rule-2), 0 12px 32px rgba(20, 30, 40, .07);
}
.shelf-now::before, .shelf-now::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--ink-2); background: var(--paper-2);
  top: -7px; left: -7px; transform: rotate(45deg); pointer-events: none;
}
.shelf-now::after { top: auto; left: auto; right: -7px; bottom: -7px; }
.shelf-now .now-list > div { grid-template-columns: 6.4rem minmax(0, 1fr); }
.shelf-now .now-list dd { font-size: 1.02rem; }
@media screen and (max-width: 860px) {
  .shelf-top { grid-template-columns: minmax(0, 1fr); }
}

/* самое любимое: кусочек карты с главной и тропа, которая прорисовывается */
.fav-band { padding-block: clamp(8px, 2vw, 20px) clamp(48px, 6vw, 80px); }
.fav {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: var(--card); border: 1.5px solid var(--ink-2); border-radius: 2px; overflow: hidden;
}
.fav::after { content: ""; position: absolute; inset: 6px; border: 1px solid color-mix(in srgb, var(--ink-2) 32%, transparent); pointer-events: none; }
.fav-map { position: relative; min-height: 320px; background: var(--sea); border-right: 1.5px solid var(--ink-2); }
.fav-map svg, .fav-map img, .fav-map canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.fav-pin-bg { fill: var(--land); stroke: var(--trail); stroke-width: 2.6; }
.fav-pin .m-sym { stroke-width: 2.2; }
.fav-text { position: relative; z-index: 1; display: grid; gap: 14px; align-content: center; padding: clamp(28px, 3.6vw, 52px); }
.fav-k { display: inline-flex; align-items: center; gap: 10px; font-family: var(--caps); font-size: var(--fs-caps); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--trail); }
.fav-dot { --pd: 9px; --p0: .3103; }
.fav-title { font-family: var(--serif); font-size: clamp(2.2rem, 1.5rem + 2.2vw, 3.4rem); line-height: 1; font-weight: 500; }
.fav-by { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1.05rem + .3vw, 1.35rem); line-height: 1.3; color: var(--ink-2); }
.fav-say { font-size: 1.08rem; line-height: 1.55; color: var(--text); max-width: 30em; }
@media screen and (max-width: 860px) {
  .fav { grid-template-columns: minmax(0, 1fr); }
  .fav-map { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1.5px solid var(--ink-2); }
}

/* разделы и карточки */
.shelf { display: grid; gap: clamp(30px, 3.4vw, 44px); padding-bottom: clamp(64px, 8vw, 110px); }
.shelf-groups { display: grid; gap: clamp(52px, 6vw, 84px); }
.shelf-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 30px; }
.shelf-head h2 { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; }
.shelf-count { font-family: var(--caps); font-size: .8rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.shelf-rule { flex: 1; height: 0; border-top: 1px dashed var(--rule-2); transform: translateY(-6px); }
.shelf-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px clamp(20px, 2.4vw, 32px); align-items: start; }

.item { position: relative; display: grid; align-content: start; min-width: 0; border-radius: 4px; outline: none; -webkit-tap-highlight-color: transparent; cursor: default; }
.item:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 8px; }
.item-body { display: grid; gap: 4px; justify-items: start; }
.item-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 3px 9px 2px; border-radius: 999px;
  font-family: var(--caps); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.2;
  color: var(--trail); border: 1px solid color-mix(in srgb, var(--trail) 40%, transparent); background: var(--trail-soft);
}
/* Метка есть не у каждой карточки, а названия в ряду должны стоять в линию:
   у карточек без метки оставляем ровно столько же места. */
.item:not(.is-fav) .item-body::before { content: ""; display: block; font-size: .62rem; line-height: 1.2; height: calc(1.2em + 7px); margin-bottom: 6px; }
.item-tag.is-fav::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--trail); }
.item-title { font-family: var(--serif); font-size: 1.28rem; line-height: 1.18; font-weight: 500; color: var(--ink); text-wrap: balance; transition: color .3s var(--ease); }
.item-by { font-size: .98rem; line-height: 1.35; color: var(--ink-2); }
.item-why { font-size: .98rem; line-height: 1.4; color: var(--muted); }
.item:hover .item-title, .item:focus-visible .item-title, .item.is-on .item-title { color: var(--trail); }

/* сцена: у всех карточек одной высоты, предмет стоит на тонкой полке, под ним мягкая тень */
.stage { position: relative; display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 1 / 1.06; margin-bottom: 26px; perspective: 900px; }
/* высота сцены - по форме раздела, чтобы над предметом не оставалось пустоты */
.shelf-group[data-kind="music"] .stage { aspect-ratio: 1 / .78; }
.shelf-group[data-kind="books"] .stage { aspect-ratio: 1 / .96; perspective: 1500px; perspective-origin: 20% 50%; }
.shelf-group[data-kind="games"] .stage { aspect-ratio: 1 / .94; }
.stage::before { content: ""; position: absolute; left: -6%; right: -6%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--rule-2) 14%, var(--rule-2) 86%, transparent); }
.stage::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -7px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ink) 16%, transparent), transparent); pointer-events: none; z-index: -1; }

/* абстрактная графика обложек: у каждого раздела своя форма, рисунок - из палитры полки */
.art-sun { background: radial-gradient(circle at 50% 62%, var(--cover-2) 0 22%, transparent 22.5%), linear-gradient(180deg, var(--cover-1) 0 62%, var(--cover-5) 62%); }
.art-rings { background: repeating-radial-gradient(circle at 30% 70%, var(--cover-3) 0 9px, color-mix(in srgb, var(--cover-3) 70%, #fff) 9px 11px); }
.art-stripes { background: repeating-linear-gradient(-35deg, var(--cover-4) 0 16px, var(--cover-2) 16px 20px, var(--cover-4) 20px 34px); }
.art-grid { background: radial-gradient(circle, var(--cover-2) 2px, transparent 2.5px) 0 0 / 16px 16px, var(--cover-5); }
.art-arc { background: radial-gradient(circle at 50% 100%, transparent 0 30%, var(--cover-2) 30% 33%, transparent 33% 44%, var(--cover-2) 44% 46%, transparent 46%), var(--cover-4); }
.art-sun2 { background: radial-gradient(circle at 70% 30%, var(--cover-2) 0 16%, transparent 16.5%), linear-gradient(160deg, var(--cover-5), var(--cover-1)); }
.art-stripes2 { background: repeating-linear-gradient(90deg, var(--cover-3) 0 12px, color-mix(in srgb, var(--cover-3) 75%, #000) 12px 24px); }
.art-rings2 { background: repeating-radial-gradient(ellipse at 80% 20%, var(--cover-1) 0 10px, color-mix(in srgb, var(--cover-1) 70%, #fff) 10px 12px); }
.art-grid2 { background: linear-gradient(90deg, color-mix(in srgb, var(--cover-4) 60%, #fff) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(0deg, color-mix(in srgb, var(--cover-4) 60%, #fff) 1px, transparent 1px) 0 0 / 18px 18px, var(--cover-4); }
.art-hex { --box: var(--cover-3); }
.art-hex .box-front { background: conic-gradient(from 30deg at 50% 58%, var(--cover-3) 0 60deg, var(--cover-2) 60deg 120deg, var(--cover-1) 120deg 180deg, var(--cover-3) 180deg 240deg, var(--cover-2) 240deg 300deg, var(--cover-1) 300deg); }
.art-pix { --box: var(--cover-4); }
.art-pix .box-front { background: conic-gradient(var(--cover-4) 25%, var(--cover-5) 0 50%, var(--cover-4) 0 75%, var(--cover-5) 0) 0 0 / 28px 28px; }
.art-arc2 { --box: var(--cover-3); }
.art-arc2 .box-front { background: radial-gradient(circle at 0 100%, var(--cover-2) 0 25%, transparent 25.5%), radial-gradient(circle at 100% 20%, var(--cover-1) 0 35%, transparent 35.5%), var(--cover-3); }
.cover-caps { position: absolute; left: 11px; bottom: 10px; z-index: 1; font-family: var(--caps); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #fff8ea; opacity: .92; }

/* музыка: пластинка в конверте */
.rec { position: relative; width: 70%; aspect-ratio: 1; margin-right: 24%; }
.rec-sleeve { position: absolute; inset: 0; z-index: 1; border-radius: 2px; overflow: hidden; box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 14px 20px -14px rgba(20, 30, 40, .55); }
.rec-sleeve::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .12), transparent 6%, transparent 92%, rgba(255, 255, 255, .1)), linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 40%); }
.rec-disc { position: absolute; z-index: 0; top: 3%; left: 3%; width: 94%; height: 94%; transform: translateX(18%); transition: transform .9s var(--ease); }
.rec-vinyl {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #0e0e0e 0 3.5%, var(--label, var(--cover-2)) 4% 31%, #111 31.5% 34%, transparent 34.5%),
    conic-gradient(from 10deg, rgba(255, 255, 255, 0) 0 28deg, rgba(255, 255, 255, .2) 46deg, rgba(255, 255, 255, 0) 66deg 196deg, rgba(255, 255, 255, .12) 216deg, rgba(255, 255, 255, 0) 236deg),
    repeating-radial-gradient(circle closest-side, #1a1a1a 0 1.4%, #2a2a2a 1.4% 2.6%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 14px -8px rgba(0, 0, 0, .5);
  animation: vinylSpin 5s linear infinite paused;
}
@keyframes vinylSpin { to { transform: rotate(360deg); } }

/* кино и сериалы: постер */
.poster { position: relative; width: 66%; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 14px 20px -14px rgba(20, 30, 40, .6); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.poster::before { content: ""; position: absolute; inset: 7px; z-index: 1; border: 1px solid rgba(255, 250, 238, .5); border-radius: 1px; pointer-events: none; }
.poster > svg { display: block; width: 100%; height: 100%; max-width: none; }
.glare { position: absolute; top: -20%; bottom: -20%; left: -90%; width: 60%; z-index: 2; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%); transform: translateX(0) skewX(-12deg); pointer-events: none; }

/* книги: обложка на корешке, под ней страницы */
.book { position: relative; width: 58%; aspect-ratio: 2 / 3; margin-right: 4%; transform-style: preserve-3d; }
.book-pages {
  position: absolute; top: 2.5%; bottom: 1.5%; left: 3%; right: -4%; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(90deg, var(--pages) 0 2px, var(--pages-edge) 2px 3px) right / 7% 100% no-repeat, var(--pages);
  box-shadow: inset 8px 0 12px -6px rgba(0, 0, 0, .25), 0 14px 20px -14px rgba(20, 30, 40, .55);
}
.book-cover { position: absolute; inset: 0; border-radius: 2px 4px 4px 2px; overflow: hidden; transform-origin: 0 50%; transition: transform .8s var(--ease), box-shadow .8s var(--ease); box-shadow: 0 14px 20px -14px rgba(20, 30, 40, .6); }
.book-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10%; z-index: 1; background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .06) 70%, rgba(255, 255, 255, .16) 86%, rgba(0, 0, 0, .1)); }
.book-cover > svg { display: block; width: 100%; height: 100%; max-width: none; }

/* игры: коробка с толщиной */
.box { --d: 24px; position: relative; width: 60%; aspect-ratio: 3 / 4; margin-right: 8%; transform-style: preserve-3d; transform: rotateY(-10deg); transition: transform .8s var(--ease); }
.box-front { position: absolute; inset: 0; border-radius: 3px; overflow: hidden; transform: translateZ(calc(var(--d) / 2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.box-front::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 17%; background: rgba(15, 20, 25, .3); }
.box-front::after { content: ""; position: absolute; left: 8%; bottom: 6%; width: 13%; aspect-ratio: 3 / 4; border-radius: 2px; background: rgba(255, 250, 238, .8); box-shadow: inset 0 -35% 0 rgba(15, 20, 25, .18); }
.box-side { position: absolute; top: 0; bottom: 0; left: calc(100% - var(--d) / 2); width: var(--d); transform: rotateY(90deg); background: color-mix(in srgb, var(--box) 58%, #000); }
.box-top { position: absolute; left: 0; right: 0; top: calc(var(--d) / -2); height: var(--d); transform: rotateX(90deg); background: color-mix(in srgb, var(--box) 78%, #fff); }

/* настоящие пункты: «Властелин Колец» */
.art-lotr-f { background: #1f3a4a; }
.lf-sun { fill: #f0b664; }
.lf-far { fill: #3f6a6a; }
.lf-near { fill: #213f3a; }
.lf-road { fill: none; stroke: #f0b664; stroke-width: 2.4; stroke-dasharray: 5 4; stroke-linecap: round; }
.art-lotr-b { background: #efe4cc; }
.lb-lines path { fill: none; stroke: #8aa37c; stroke-width: 1.4; }
.lb-trail { fill: none; stroke: #b53a20; stroke-width: 3; stroke-dasharray: 7 5; stroke-linecap: round; }
.lb-end { fill: #b53a20; }
.art-lotr-b .cover-caps { color: #1e3a5f; }
.book-cover .cover-caps { top: 10px; bottom: auto; left: calc(10% + 8px); }
.poster .cover-caps { top: 15px; bottom: auto; left: 15px; }

/* живость при наведении, фокусе и нажатии на телефоне; при «меньше движения» - только цвет названия */
@media (prefers-reduced-motion: no-preference) {
  .item.is-on .rec-disc, .item:focus-visible .rec-disc { transform: translateX(48%); }
  .item.is-on .rec-vinyl, .item:focus-visible .rec-vinyl { animation-play-state: running; }
  .item.is-on .poster, .item:focus-visible .poster { transform: translateY(-12px); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 30px 30px -18px rgba(20, 30, 40, .5); }
  .item.is-on .glare, .item:focus-visible .glare { transform: translateX(350%) skewX(-12deg); transition: transform 1.1s var(--ease) .08s; }
  .item.is-on .book-cover, .item:focus-visible .book-cover { transform: rotateY(-30deg); box-shadow: 10px 16px 22px -14px rgba(20, 30, 40, .55); }
  .item.is-on .box, .item:focus-visible .box { transform: translateY(-8px) rotateX(9deg) rotateY(-28deg) rotateZ(-1.5deg); }
  @media (hover: hover) {
    .item:hover .rec-disc { transform: translateX(48%); }
    .item:hover .rec-vinyl { animation-play-state: running; }
    .item:hover .poster { transform: translateY(-12px); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 30px 30px -18px rgba(20, 30, 40, .5); }
    .item:hover .glare { transform: translateX(350%) skewX(-12deg); transition: transform 1.1s var(--ease) .08s; }
    .item:hover .book-cover { transform: rotateY(-30deg); box-shadow: 10px 16px 22px -14px rgba(20, 30, 40, .55); }
    .item:hover .box { transform: translateY(-8px) rotateX(9deg) rotateY(-28deg) rotateZ(-1.5deg); }
  }
}

@media screen and (max-width: 1100px) {
  .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media screen and (max-width: 760px) {
  .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 18px; }
  .stage { margin-bottom: 20px; }
  .box { --d: 16px; }
  .item-title { font-size: 1.1rem; }
  .item-by, .item-why { font-size: .92rem; }
  .item-tag { font-size: .58rem; letter-spacing: .12em; }
  .shelf-now { padding: 18px 18px 10px; }
}

/* =====================================================================
   Меньше движения
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .here-pulse { display: none; }
  .fp-tg-in, a.fp-sec:hover, a.fp-sec:focus-visible, a.fp-sec:active { transform: none !important; }
  .fp-ico::after { animation: none !important; }
  .c-needle-in, .c-needle-g, .ml-depth, .ml-relief, .hd-disc::before, .m-smoke path, .wf-fall { animation: none !important; }
  .mr-outer { stroke-dashoffset: 0 !important; }
  html .m-smoke path { opacity: .45; }
}

/* =====================================================================
   ПЕЧАТЬ - резюме на бумаге
   ===================================================================== */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root, :root[data-theme="dark"] {
    --paper: #fff; --paper-2: #fff; --card: #fff; --land: #fff; --text: #111; --ink: #0d2a4a; --ink-2: #33475e;
    --muted: #4b5560; --rule: #ccc; --rule-2: #bbb; --trail: #a3321a; --trail-soft: transparent; --on-ink: #fff;
  }
  html, body { background: #fff !important; font-size: 10.5pt; }
  .here, .site-foot, .skip, .toast, .no-print, .marks-bg, .route-trail, .route-ink, .route-end, .route-key { display: none !important; }
  .room { display: none !important; min-height: 0; }
  #room-cv { display: block !important; animation: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .print-only { display: block; }
  .print-contacts { font-family: var(--caps); font-size: 8.5pt; letter-spacing: .08em; color: #333; padding: 0 0 6pt; border-bottom: 1px solid #bbb; }
  .wrap { max-width: none; padding-inline: 0; }
  .room-head { padding: 10pt 0 8pt; }
  .cv-head { display: block; }
  .room-head-text { gap: 5pt; max-width: none; }
  .cv-name { font-size: 26pt; }
  .cv-role { font-size: 14pt; margin: 0; }
  .lead { font-size: 11pt; max-width: none; }
  .now-line { background: none; padding: 2pt 0 2pt 8pt; font-size: 10.5pt; }
  .pulse::before { display: none; }
  .marks { background: none; padding: 8pt 0; border-color: #bbb; }
  .marks-list { grid-auto-flow: column; grid-template-columns: 1.3fr; grid-auto-columns: 1fr; margin-top: 6pt; gap: 0; }
  .mark, .mark:nth-child(even) { padding: 0 8pt; border-left: 1px dashed #bbb; }
  .marks-list .mark:first-child { padding-left: 0; border-left: 0; grid-column: auto; }
  .mark-num { font-size: 20pt !important; }
  .mark-label { font-size: 8.5pt; }
  .mark-tri { display: none; }
  .route { padding: 12pt 0 0; }
  .route-intro { display: block; margin-bottom: 8pt; }
  .route-intro p { display: none; }
  .sec-title { font-size: 15pt; }
  .stops { display: flex; flex-direction: column-reverse; gap: 10pt; }
  /* Колонка дат - по самой длинной строке («05.2024 - осень 2025»), иначе
     дата на бумаге упирается в заголовок карточки. */
  .stop { grid-template-columns: 96pt minmax(0, 1fr); break-inside: avoid; page-break-inside: avoid; }
  .stop-pin { display: none; }
  .stop-when { grid-column: 1; padding: 0 10pt 0 0; justify-items: start; text-align: left; }
  .stop-year { font-size: 15pt; }
  .stop-span { font-size: 7.5pt; margin-top: 2pt; }
  .stop-card { grid-column: 2; padding: 0; gap: 2pt; }
  .stop-title { font-size: 12.5pt; }
  .stop-org { font-size: 7.5pt; }
  .stop-grid, .stop-grid-short { grid-template-columns: repeat(3, 1fr); max-width: none; margin-top: 4pt; }
  .sb, .sb + .sb { font-size: 9pt; line-height: 1.38; padding: 5pt 8pt 0 0; }
  .sb + .sb { padding-left: 8pt; }
  .sb-res { grid-column: auto !important; border-left: 1px dashed #bbb !important; padding-left: 8pt !important; margin-top: -1px !important; }
  .sb::before { display: none !important; }
  .res-num { font-size: 15pt; }
  .res-num-word { font-size: 12pt; }
  .how { padding: 12pt 0 0; break-inside: avoid; }
  .how-head { margin-bottom: 6pt; }
  .how-head .caps { display: none; }
  .how-list { flex-wrap: wrap; }
  .how-list li, .how-list li:nth-child(even) { flex-basis: 20%; padding: 6pt 6pt 0; border-left: 1px dashed #bbb; border-bottom: 0; border-top: 0; }
  .how-list li:nth-last-child(-n+5):first-child, .how-list li:nth-last-child(-n+5):first-child ~ li { flex-grow: 1; }
  .how-list li:nth-child(5n+1) { border-left: 0; padding-left: 0; }
  .how-list li:nth-child(n+6) { border-top: 1px dashed #bbb; }
  .how-list h3 { font-size: 9.5pt; }
  .how-list p { font-size: 8pt; }
  .how-n { display: none; }
  .edu { grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none; padding: 10pt 0 0; gap: 16pt; break-inside: avoid; }
  .edu-main { font-size: 12pt; }
  a { text-decoration: none; }
}

/* пауза анимаций вне экрана (app.js) и там, где их не видно: закрытая карточка медальона, закрытая карта в подвале,
   кольцо медальона, пока он ушел в подвал. На вид ничего не меняется - анимация продолжится с того же места */
.anim-paused, .anim-paused *, .anim-paused::before, .anim-paused::after, .anim-paused *::before, .anim-paused *::after,
.here:not(.is-open) .hc-lines *, .site-foot.is-closed .fp-mark *, .here.is-docked .hd-disc::before { animation-play-state: paused !important; }

/* режим снимков: прокручивается body (иначе headless снимает пустоту) */
html.shot-y { height: 100%; overflow: hidden; }
html.shot-y body { height: 100%; overflow-y: auto; }

.wrap.contacts { border-top: 0; background: linear-gradient(var(--rule-2), var(--rule-2)) var(--gutter) 0 / calc(100% - var(--gutter) * 2) 1px no-repeat; }
.js .reveal.reveal-now { transition: none; }
html.shot-y .reveal { transition: none !important; }
