/* Токены АЯ — один в один из AYA-Final/css/frame-preview/00-tokens.css (светлая тема) */
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url(fonts/geist-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 700; font-display: swap; src: url(fonts/geist-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }

:root {
  --afp-font-ui: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --afp-font-heading: "Geist", "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --afp-page-pad-x: clamp(14px, 2vw, 28px);
  --afp-gap-xs: 10px; --afp-gap-sm: 14px; --afp-gap-md: 20px; --afp-gap-lg: 28px;
  --afp-radius-chip: 999px; --afp-radius-card: 28px; --afp-radius-panel: 30px; --afp-radius-soft: 22px;
  --afp-border-light: rgba(16, 24, 40, 0.08);
  --afp-border-brand: rgba(0, 95, 109, 0.18);
  --afp-text: #24323b; --afp-text-strong: #1c2a33; --afp-text-soft: #687783; --afp-kicker: #7f8d99;
  --afp-surface: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,249,252,0.94));
  --afp-surface-chip: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,251,0.88));
  --afp-surface-card: radial-gradient(circle at 0% 0%, rgba(0,95,109,0.045), transparent 40%), radial-gradient(circle at 100% 0%, rgba(255,159,10,0.025), transparent 28%), linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,248,251,0.92));
  --afp-shadow-sm: 0 10px 24px rgba(2, 8, 23, 0.06), 0 2px 8px rgba(0, 95, 109, 0.04);
  --afp-shadow-md: 0 18px 42px rgba(2, 8, 23, 0.08), 0 4px 18px rgba(0, 95, 109, 0.05), inset 0 1px 0 rgba(255,255,255,0.46);
  --afp-primary: linear-gradient(135deg, #0f95a7 0%, #0a7281 100%);
  --afp-primary-text: #ffffff;
  /* бренд: основной, акцент, знак, коралл (раздел 9 стандарта 00) */
  --aya-petrol: #005f6d; --aya-amber: #ff9f0a; --aya-turq: #1AAAB4; --aya-coral: #ff6b6b;
  /* «светлый атлас» — производные бренда (оттенки петрольного и янтарного), согласовать с Глебом */
  --atlas-paper: #f3efe6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--atlas-paper); color: var(--afp-text);
  font-family: var(--afp-font-ui); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: var(--atlas-paper); }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(243,239,230,.7) !important; }
.maplibregl-ctrl-bottom-right { bottom: calc(env(safe-area-inset-bottom) + 222px); }
.maplibregl-marker:has(.ev-wrap) { z-index: 3; }
.maplibregl-marker:has(.lbl) { z-index: 1; }
.maplibregl-marker:has(.camp-head) { z-index: 2; }

.top { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 10px) var(--afp-page-pad-x) 0;
  display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.top > * { pointer-events: auto; }
.year { display: flex; align-items: baseline; gap: 8px; color: var(--afp-text-strong); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.y-num { font-family: var(--afp-font-heading); font-weight: 700; font-size: 40px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.y-era { font-weight: 600; font-size: 20px; }
.seg { display: flex; padding: 4px; border-radius: var(--afp-radius-chip); background: var(--afp-surface-chip); box-shadow: var(--afp-shadow-sm); border: 1px solid var(--afp-border-light); }
.seg button { min-height: 40px; padding: 0 16px; border-radius: var(--afp-radius-chip); font-weight: 600; font-size: 15px; color: var(--afp-text-soft); transition: background .2s, color .2s; }
.seg button.on { background: var(--afp-primary); color: var(--afp-primary-text); }

.epochs { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 64px); display: flex; gap: 6px; overflow-x: auto;
  padding: 0 var(--afp-page-pad-x); scrollbar-width: none; }
.epochs::-webkit-scrollbar { display: none; }
.epochs button { flex: none; min-height: 32px; padding: 0 12px; border-radius: var(--afp-radius-chip); font-size: 13px; font-weight: 600;
  background: var(--afp-surface-chip); border: 1px solid var(--afp-border-light); color: var(--afp-text); box-shadow: 0 2px 8px rgba(0,95,109,.05); }
.epochs button:active { transform: scale(.96); }

.dock { position: absolute; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 8px); padding: 10px 10px 8px;
  border-radius: var(--afp-radius-soft); background: var(--afp-surface); border: 1px solid var(--afp-border-light); box-shadow: var(--afp-shadow-md); }
.dock-row { display: flex; align-items: center; gap: 8px; }
.play { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--afp-primary); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(0,95,109,.22); transition: transform .12s; }
.play:active { transform: scale(.93); }
.speed { flex: none; min-height: 36px; padding: 0 12px; border-radius: var(--afp-radius-chip); border: 1px solid var(--afp-border-brand); font-weight: 600; font-size: 14px; background: var(--afp-surface-chip); font-variant-numeric: tabular-nums; }
.ruler-wrap { flex: 1; min-width: 0; height: 40px; }
#ruler, #tracks { display: block; width: 100%; touch-action: none; }
#tracks { height: 120px; margin-top: 6px; }

.ev { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(28,42,51,.28); background: #e9e2d2 center/cover no-repeat;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--aya-petrol); transform-origin: 50% 50%; }
.ev-wrap { transition: opacity .35s; }
.ev.in { animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.ev.war { border-color: #ffe1e1; }
.ev.near { opacity: .55; transform: scale(.82); }
.ev.ph { background: radial-gradient(circle, var(--c) 0 7px, #f4eee2 8px); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ev-cap { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--afp-text-strong);
  background: rgba(255,255,255,.86); padding: 2px 7px; border-radius: 8px; pointer-events: none; }
.lbl { font-size: 13px; font-weight: 700; color: var(--aya-petrol); white-space: nowrap; pointer-events: none; letter-spacing: .01em;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px rgba(255,255,255,.9); transition: opacity .4s; }
.lbl.big { font-size: 16px; }
.lbl.small { font-size: 11px; font-weight: 600; }
.camp-head { width: 14px; height: 14px; border-radius: 50%; background: var(--aya-coral); border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(255,107,107,.25); }

.toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 230px); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--afp-surface); border: 1px solid var(--afp-border-light); box-shadow: var(--afp-shadow-sm); border-radius: 16px; padding: 10px 14px; font-size: 14px; max-width: 88vw; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--afp-text-strong); }
.fps { position: absolute; right: 8px; top: calc(env(safe-area-inset-top) + 110px); font: 600 12px/1 ui-monospace, monospace; background: rgba(0,0,0,.6); color: #fff; padding: 4px 6px; border-radius: 6px; }

.sheet { position: absolute; inset: 0; background: var(--atlas-paper); transform: translateX(100%); transition: transform .34s cubic-bezier(.3,.8,.2,1); z-index: 5; }
.sheet.open { transform: none; }
.sheet-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
.back { position: absolute; z-index: 2; left: 12px; top: calc(env(safe-area-inset-top) + 10px); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.9); box-shadow: var(--afp-shadow-sm); color: var(--aya-petrol); }
.hero { width: 100%; aspect-ratio: 4 / 3; background: #e9e2d2 center 20%/cover no-repeat; }
.hero.ph { aspect-ratio: 16 / 7; display: grid; place-items: center; color: var(--afp-text-soft); font-size: 14px; background: linear-gradient(160deg, #efe8da, #e2ddd0); }
.sh-pad { padding: var(--afp-gap-md) var(--afp-page-pad-x) 0; }
.sh-title { font-family: var(--afp-font-heading); font-weight: 700; font-size: 30px; line-height: 1.12; color: var(--aya-petrol); margin: 0 0 6px; }
.sh-meta { color: var(--afp-text-soft); font-size: 15px; margin-bottom: 14px; }
.sh-note { color: var(--afp-kicker); font-size: 13px; margin: -8px 0 12px; }
.sh-text { font-size: 18px; line-height: 1.45; color: var(--afp-text-strong); margin: 0 0 18px; }
.listen { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: var(--afp-radius-chip); background: var(--afp-primary); color: #fff; font-weight: 600; font-size: 17px; box-shadow: 0 10px 22px rgba(0,95,109,.2); }
.listen[disabled] { opacity: .5; }
.badge { display: inline-block; margin-left: 10px; font-size: 12px; color: var(--afp-text-soft); vertical-align: middle; }
.sh-h2 { font-family: var(--afp-font-heading); font-weight: 700; font-size: 22px; color: var(--aya-petrol); margin: 26px 0 12px; }
.cards { display: flex; gap: 10px; overflow-x: auto; padding: 0 var(--afp-page-pad-x) 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.card { flex: none; width: 46%; min-width: 150px; scroll-snap-align: start; border-radius: var(--afp-radius-soft); background: var(--afp-surface-card); border: 1px solid var(--afp-border-light); box-shadow: var(--afp-shadow-sm); overflow: hidden; text-align: left; }
.card .ci { aspect-ratio: 4/3; background: #e9e2d2 center/cover no-repeat; }
.card .ci.ph { background: linear-gradient(160deg, #efe8da, #e2ddd0); }
.card .ct { padding: 8px 10px 2px; font-weight: 700; font-size: 15px; color: var(--afp-text-strong); }
.card .cm { padding: 0 10px 10px; font-size: 12px; color: var(--afp-text-soft); }
.src { margin: 0; padding: 0 0 0 18px; font-size: 13px; line-height: 1.5; color: var(--afp-text-soft); }
.src a { color: var(--aya-petrol); }

@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } .ev.in { animation: none; } }

/* серия «Плей» */
.series-chip { background: var(--afp-primary) !important; color: #fff !important; border: 0 !important; }
.caption { position: absolute; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 222px); padding: 12px 14px 10px; border-radius: var(--afp-radius-soft);
  background: var(--afp-surface); border: 1px solid var(--afp-border-light); box-shadow: var(--afp-shadow-md); z-index: 4; }
.cap-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--afp-text-soft); }
.cap-head span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-dots { display: flex; gap: 4px; } .cap-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,95,109,.18); } .cap-dots i.on { background: var(--aya-petrol); }
#cap-close { width: 44px; height: 32px; margin: -6px -8px -6px 0; color: var(--afp-text-soft); font-size: 15px; }
#cap-text { margin: 6px 0 4px; font-size: 16px; line-height: 1.42; color: var(--afp-text-strong); min-height: 2.8em; }
.cap-src { font-size: 11px; color: var(--afp-kicker); }
.ev.focus { box-shadow: 0 0 0 4px rgba(255,159,10,.55), 0 4px 12px rgba(28,42,51,.28); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(255,159,10,.15), 0 4px 12px rgba(28,42,51,.28); } }
@media (prefers-reduced-motion: reduce) { .ev.focus { animation: none; } }
