/* МТК №24 «Ленин в октябре» — динамическая объёмная карта Петрограда.
   Брендовая палитра и шрифты музея (paper / brass / signal-red / graphite). */

@font-face {
  font-family: "Nolde";
  font-weight: 400; font-style: normal; font-display: swap;
  src: url("./fonts/nolde/nolde.otf") format("opentype");
}
@font-face {
  font-family: "20 Kopeek";
  font-weight: 400; font-style: normal; font-display: swap;
  src: url("./fonts/kopeek/20-kopeek-book.otf") format("opentype");
}
@font-face {
  font-family: "20 Kopeek";
  font-weight: 600; font-style: normal; font-display: swap;
  src: url("./fonts/kopeek/20-kopeek-demibold.otf") format("opentype");
}

:root {
  --paper:    #F7F9EF;
  --brass:    #D2B773;
  --red:      #A02128;
  --graphite: #435059;
  --window:   #9DA3A6;
  --ink:      #161B1E;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: "Nolde", Georgia, serif;
  -webkit-user-select: none; user-select: none;
  cursor: default;
}

.stage {
  position: fixed; inset: 0;
  background: #050708;
}

/* РАБОЧИЙ ЭКРАН — размер/положение задаёт JS (аспект ТЗ ≈ 2925×2497) */
.work {
  position: absolute; isolation: isolate; overflow: hidden;
  background: #0c1012;
  box-shadow: 0 0 0 1px rgba(210,183,115,0.25), 0 24px 80px rgba(0,0,0,0.7);
}
.work::after {            /* проекторная фактура только на рабочем экране */
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 42%, transparent 55%, rgba(8,11,13,0.55) 100%),
    repeating-linear-gradient(0deg, rgba(247,249,239,0.035) 0, rgba(247,249,239,0.035) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: soft-light;
}

#map, #gl {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; display: block; touch-action: none;
}

/* ТЕХНИЧЕСКАЯ ЗОНА — вне рабочего экрана (полный диктор-текст + таймлайн) */
.tech {                                   /* ГЗК — правая панель, вне рабочего экрана */
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--techW, 30%);
  z-index: 7; background: #060809; border-left: 1px solid #1c2329;
  display: flex; flex-direction: column;
  padding: clamp(16px,2.4vh,30px) clamp(14px,1.4vw,26px);
}
.tech-head { flex-shrink: 0; padding-bottom: 0.7em; border-bottom: 1px solid #1c2329; margin-bottom: 0.7em; }
.tech-scene {
  font-family: "20 Kopeek", monospace; font-weight: 600; font-size: clamp(13px,1.7vh,20px);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass);
}
.tech-title {
  font-family: "Nolde", Georgia, serif; font-size: clamp(16px,2.2vh,28px); line-height: 1.05;
  color: var(--paper); margin: 0.15em 0 0.5em;
}
.tech-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 0.7em; row-gap: 0.25em; }
.tech-meta dt {
  font-family: "20 Kopeek", monospace; font-size: clamp(9px,1.1vh,12px); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--window); opacity: 0.7; white-space: nowrap;
}
.tech-meta dd {
  margin: 0; font-family: "20 Kopeek", monospace; font-size: clamp(10px,1.25vh,14px);
  color: var(--paper); opacity: 0.92; line-height: 1.3;
}
.tech-meta dd.fx { color: var(--brass); }
.tech-vo { flex: 1; overflow-y: auto; }
.tech-label {
  font-family: "20 Kopeek", monospace; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--window); opacity: 0.6;
}
#vo-full {
  margin: 0.3em 0 0; font-family: "20 Kopeek", monospace;
  font-size: clamp(12px,1.5vh,17px); line-height: 1.4; color: var(--paper); opacity: 0.92;
  max-width: 100%;
}

/* большие часы + календарь (время события) */
.clockbox {
  position: absolute; z-index: 6; top: clamp(16px,2.6vh,40px); left: 50%; transform: translateX(-50%);
  text-align: center; pointer-events: none;
}
.clockbox .ev-date {
  font-family: "20 Kopeek", monospace; font-weight: 600;
  font-size: clamp(15px,2vh,28px); letter-spacing: 0.12em; text-transform: uppercase;
  color: #F2DCA6; margin-bottom: 0.18em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95), 0 0 16px rgba(0,0,0,0.7);  /* контраст над светлой картой */
}
.clockbox .ev-time {
  font-family: "Nolde", Georgia, serif; font-size: clamp(34px,6.5vh,96px); line-height: 0.95;
  color: var(--paper); text-shadow: 0 3px 20px rgba(0,0,0,0.7);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}

/* ---------- forces legend (top-right) ---------- */
.forces {
  position: absolute; z-index: 5; right: clamp(22px,2.8vw,56px); top: clamp(20px,3.4vh,52px);
  display: grid; row-gap: 0.55em; justify-items: end;
  font-family: "20 Kopeek", monospace; font-size: clamp(11px,1.15vh,16px);
  color: var(--paper); opacity: 0.9; pointer-events: none;
}
.force-row { display: flex; align-items: center; gap: 0.6em; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15em; height: 1.15em; border-radius: 2px; font-size: 0.8em; flex-shrink: 0;
}
.chip-vrk { background: var(--brass); color: var(--red); }
.chip-pg  { background: #14181b; border: 1px solid var(--window); }

/* ---------- illustration inset (lower-right) ---------- */
.ill {
  position: absolute; z-index: 5; right: clamp(22px,2.8vw,56px);
  bottom: clamp(96px,13vh,150px); margin: 0; width: clamp(220px, 24vw, 420px);
  opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.ill.show { opacity: 1; transform: none; }
.ill img {
  display: block; width: 100%; height: auto; max-height: 42vh; object-fit: cover;
  border: 1px solid rgba(210,183,115,0.4);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6); filter: saturate(0.85) contrast(1.02);
}
.ill figcaption {
  font-family: "20 Kopeek", monospace; font-size: clamp(10px,1.05vh,14px);
  color: var(--brass); opacity: 0.9; margin-top: 0.5em; line-height: 1.35; text-align: right;
}

/* проекторная фактура перенесена на .work::after (только рабочий экран) */
.stage::after { content: none; }

/* ---------- top-left brand block ---------- */
.brand {
  position: absolute; z-index: 5; top: clamp(20px,3.4vh,52px); left: clamp(22px,2.8vw,56px);
  pointer-events: none;
}
.brand .kicker {
  font-family: "20 Kopeek", "Courier New", monospace;
  font-size: clamp(11px,1.1vh,18px); letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--brass); opacity: 0.92; margin-bottom: 0.5em;
}
.brand h1 {
  font-family: "Nolde", Georgia, serif; font-weight: 400;
  font-size: clamp(30px,4.6vh,76px); line-height: 0.94; letter-spacing: -0.01em;
  margin: 0; color: var(--paper); text-shadow: 0 4px 22px rgba(0,0,0,0.6);
}
.brand .sub {
  font-family: "20 Kopeek", monospace; font-size: clamp(11px,1.15vh,16px);
  letter-spacing: 0.04em; color: var(--paper); opacity: 0.6; margin-top: 0.7em;
}

/* ---------- lower-third narration ---------- */
.narration {
  position: absolute; z-index: 5; left: 9%;   /* отступ внутрь, чтобы скос формы не резал текст */
  bottom: clamp(86px,12vh,140px); max-width: min(56%, 720px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.narration.swap { opacity: 0; transform: translateY(14px); }
.narration .date {
  font-family: "20 Kopeek", monospace; font-size: clamp(13px,1.5vh,24px);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass);
  margin-bottom: 0.45em;
  display: inline-block; border-bottom: 1px solid rgba(210,183,115,0.4); padding-bottom: 0.3em;
}
.narration h2 {
  font-family: "Nolde", Georgia, serif; font-weight: 400;
  font-size: clamp(26px,4.4vh,72px); line-height: 0.98; letter-spacing: -0.005em;
  margin: 0.25em 0 0.4em; color: var(--paper); text-shadow: 0 3px 18px rgba(0,0,0,0.65);
}
.narration .lede {
  font-family: "20 Kopeek", monospace; font-size: clamp(13px,1.55vh,22px);
  line-height: 1.5; color: var(--paper); opacity: 0.86; max-width: 34em;
}

/* ---------- quote card (right) ---------- */
.quote {
  position: absolute; z-index: 5; right: clamp(22px,2.8vw,56px);
  top: 50%; transform: translateY(-50%); max-width: min(34%, 460px);
  padding: clamp(18px,2vw,30px) clamp(20px,2.2vw,34px);
  background: linear-gradient(160deg, rgba(67,80,89,0.42), rgba(12,16,18,0.66));
  border: 1px solid rgba(210,183,115,0.34); border-left: 3px solid var(--red);
  backdrop-filter: blur(3px); pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease; opacity: 0;
}
.quote.show { opacity: 1; }
.quote .mark { font-family: "Nolde", serif; color: var(--red); font-size: 3.4em; line-height: 0.4; opacity: 0.7; }
.quote p {
  font-family: "Nolde", Georgia, serif; font-size: clamp(16px,1.9vh,28px);
  line-height: 1.32; color: var(--paper); margin: 0.2em 0 0.9em; font-style: italic;
}
.quote .cite {
  font-family: "20 Kopeek", monospace; font-size: clamp(10px,1.05vh,14px);
  letter-spacing: 0.04em; color: var(--brass); opacity: 0.85; line-height: 1.4;
}

/* ---------- legend (top-right) ---------- */
.legend {
  position: absolute; z-index: 5; right: clamp(22px,2.8vw,56px); top: clamp(20px,3.4vh,52px);
  display: grid; row-gap: 0.5em; justify-items: end;
  font-family: "20 Kopeek", monospace; font-size: clamp(11px,1.15vh,16px);
  color: var(--paper); opacity: 0.82; pointer-events: none;
}
.legend-row { display: flex; align-items: center; gap: 0.55em; white-space: nowrap; }
.legend .dot { width: 0.82em; height: 0.82em; border-radius: 50%; flex-shrink: 0; }
.dot-hq     { background: var(--brass); }
.dot-target { background: var(--red); }
.dot-object { background: var(--paper); }
.dot-signal { background: var(--red); box-shadow: 0 0 0 3px rgba(160,33,40,0.35); }
.dot-under  { background: var(--graphite); border: 1px solid var(--window); }

/* ---------- bottom timeline / transport ---------- */
.transport {                              /* таймлайн — нижняя полоса под рабочим экраном */
  position: absolute; left: 0; right: var(--techW, 30%); bottom: 0; height: var(--transportH, 48px);
  z-index: 7; background: #060809; border-top: 1px solid #1c2329;
  display: flex; align-items: center; gap: 18px; padding: 0 clamp(18px,2vw,40px);
}
.btn-play {
  flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid rgba(210,183,115,0.5);
  background: rgba(247,249,239,0.06); color: var(--paper);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: clamp(14px,1.5vh,20px); transition: background 0.2s, border-color 0.2s;
}
.btn-play:hover { background: rgba(210,183,115,0.18); border-color: var(--brass); }

.track { position: relative; flex: 1; height: 100%; cursor: pointer; }
.track-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: rgba(157,163,166,0.3); transform: translateY(-50%);
}
.track-fill {
  position: absolute; left: 0; top: 50%; height: 2px; width: 0;
  background: var(--red); transform: translateY(-50%); box-shadow: 0 0 10px rgba(160,33,40,0.7);
}
.tick {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--graphite); border: 1px solid var(--window);
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.tick.done { background: var(--brass); border-color: var(--brass); }
.tick.active {
  background: var(--red); border-color: var(--red); width: 13px; height: 13px;
  box-shadow: 0 0 0 4px rgba(160,33,40,0.28);
}
.tick .lbl {
  position: absolute; left: 50%; bottom: 150%; transform: translateX(-50%);
  font-family: "20 Kopeek", monospace; font-size: clamp(9px,0.95vh,12px);
  letter-spacing: 0.05em; color: var(--paper); opacity: 0; white-space: nowrap;
  transition: opacity 0.25s; pointer-events: none;
}
.tick.active .lbl, .track:hover .tick:hover .lbl { opacity: 0.92; }
.clock {
  flex-shrink: 0; font-family: "20 Kopeek", monospace; font-size: clamp(12px,1.3vh,18px);
  letter-spacing: 0.08em; color: var(--paper); opacity: 0.8; min-width: 7.5em; text-align: right;
}
.clock b { color: var(--brass); font-weight: 600; }

.attrib {
  position: absolute; z-index: 5; left: clamp(22px,2.8vw,56px);
  bottom: clamp(66px,8.6vh,104px);
  font-family: "20 Kopeek", monospace; font-size: clamp(9px,0.9vh,12px);
  color: var(--window); opacity: 0.5; pointer-events: none; letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .quote { position: static; transform: none; max-width: none; display: none; }
  .narration { max-width: 86%; }
}

/* ===== ТОЧНАЯ ФОРМА РАБОЧЕГО ЭКРАНА по ТЗ (in/размер 24.PNG) ===== */
.work {
  box-shadow: none;
  clip-path: polygon(0.00% 2.03%, 0.15% 11.99%, 0.44% 12.50%, 0.44% 16.72%, 0.74% 17.23%, 0.74% 21.45%, 1.03% 21.96%, 1.03% 26.18%, 1.33% 26.69%, 1.33% 30.91%, 1.62% 31.42%, 1.62% 35.64%, 1.91% 36.15%, 1.91% 40.37%, 2.21% 40.88%, 2.21% 45.10%, 2.50% 45.61%, 2.50% 49.83%, 2.80% 50.17%, 2.80% 54.56%, 3.09% 54.90%, 3.09% 59.29%, 3.39% 59.80%, 3.39% 64.02%, 3.68% 64.53%, 3.68% 68.75%, 3.98% 69.09%, 3.98% 73.48%, 4.27% 73.99%, 4.27% 78.21%, 4.57% 78.72%, 4.57% 82.94%, 4.86% 83.45%, 4.86% 87.67%, 5.15% 88.01%, 5.15% 92.40%, 5.45% 92.91%, 5.74% 99.83%, 13.55% 99.83%, 20.18% 99.16%, 37.26% 98.48%, 62.74% 98.48%, 80.12% 99.16%, 86.60% 99.83%, 94.26% 99.83%, 94.55% 98.82%, 94.55% 94.26%, 94.85% 93.75%, 94.85% 89.19%, 95.14% 88.68%, 95.14% 84.12%, 95.43% 83.78%, 95.43% 79.05%, 95.73% 78.72%, 95.73% 74.16%, 96.02% 73.82%, 96.02% 69.26%, 96.32% 68.75%, 96.32% 64.19%, 96.61% 63.68%, 96.61% 59.12%, 96.91% 58.61%, 96.91% 54.05%, 97.20% 53.55%, 97.20% 48.99%, 97.50% 48.48%, 97.50% 43.92%, 97.79% 43.75%, 97.79% 39.02%, 98.09% 38.68%, 98.09% 33.95%, 98.38% 33.61%, 99.26% 13.85%, 99.56% 13.34%, 99.56% 9.12%, 99.85% 8.45%, 99.85% 2.03%, 92.19% 1.69%, 91.90% 1.35%, 86.75% 1.35%, 86.30% 1.01%, 80.71% 1.01%, 80.27% 0.68%, 61.71% 0.34%, 60.68% 0.00%, 27.69% 0.34%, 27.39% 0.68%, 19.44% 0.68%, 19.00% 1.01%, 13.40% 1.01%, 12.96% 1.35%, 7.81% 1.35%, 7.66% 1.69%);
  -webkit-clip-path: polygon(0.00% 2.03%, 0.15% 11.99%, 0.44% 12.50%, 0.44% 16.72%, 0.74% 17.23%, 0.74% 21.45%, 1.03% 21.96%, 1.03% 26.18%, 1.33% 26.69%, 1.33% 30.91%, 1.62% 31.42%, 1.62% 35.64%, 1.91% 36.15%, 1.91% 40.37%, 2.21% 40.88%, 2.21% 45.10%, 2.50% 45.61%, 2.50% 49.83%, 2.80% 50.17%, 2.80% 54.56%, 3.09% 54.90%, 3.09% 59.29%, 3.39% 59.80%, 3.39% 64.02%, 3.68% 64.53%, 3.68% 68.75%, 3.98% 69.09%, 3.98% 73.48%, 4.27% 73.99%, 4.27% 78.21%, 4.57% 78.72%, 4.57% 82.94%, 4.86% 83.45%, 4.86% 87.67%, 5.15% 88.01%, 5.15% 92.40%, 5.45% 92.91%, 5.74% 99.83%, 13.55% 99.83%, 20.18% 99.16%, 37.26% 98.48%, 62.74% 98.48%, 80.12% 99.16%, 86.60% 99.83%, 94.26% 99.83%, 94.55% 98.82%, 94.55% 94.26%, 94.85% 93.75%, 94.85% 89.19%, 95.14% 88.68%, 95.14% 84.12%, 95.43% 83.78%, 95.43% 79.05%, 95.73% 78.72%, 95.73% 74.16%, 96.02% 73.82%, 96.02% 69.26%, 96.32% 68.75%, 96.32% 64.19%, 96.61% 63.68%, 96.61% 59.12%, 96.91% 58.61%, 96.91% 54.05%, 97.20% 53.55%, 97.20% 48.99%, 97.50% 48.48%, 97.50% 43.92%, 97.79% 43.75%, 97.79% 39.02%, 98.09% 38.68%, 98.09% 33.95%, 98.38% 33.61%, 99.26% 13.85%, 99.56% 13.34%, 99.56% 9.12%, 99.85% 8.45%, 99.85% 2.03%, 92.19% 1.69%, 91.90% 1.35%, 86.75% 1.35%, 86.30% 1.01%, 80.71% 1.01%, 80.27% 0.68%, 61.71% 0.34%, 60.68% 0.00%, 27.69% 0.34%, 27.39% 0.68%, 19.44% 0.68%, 19.00% 1.01%, 13.40% 1.01%, 12.96% 1.35%, 7.81% 1.35%, 7.66% 1.69%);
  filter: drop-shadow(0 16px 50px rgba(0,0,0,0.6));
}
