/* Інтерактивний блок LLumar */

@font-face {
  font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #14151a;
  --surface-2: #1b1c22;
  --line: #2a2b32;
  --text: #f3f3f5;
  --soft: #c3c4cb;   /* основний текст описів */
  --muted: #9a9ba4;  /* підказки; контраст до --bg ≈ 7:1 */
  --red: #ed302e;
  --red-hover: #ff4744;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/1.6 Manrope, system-ui, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #ff6a66; outline-offset: 3px; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.experience { max-width: 1480px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }

/* ---- вступ ---- */
.intro { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 32px; align-items: end; padding: clamp(32px, 4vw, 56px) 0 28px; }
h1 { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 600; }
h1 span { color: #8b8c95; }
.intro p { color: var(--soft); font-size: 16px; }

/* ---- режими ---- */
.modes { display: flex; gap: 32px; border-bottom: 1px solid var(--line); }
.modes button { position: relative; padding: 16px 0; font-size: 16px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .15s; }
.modes button:hover { color: var(--text); }
.modes button[aria-pressed="true"] { color: var(--text); }
.modes button[aria-pressed="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); }
.modes small { margin-left: 6px; padding: 2px 6px; border: 1px solid #5a2b2c; border-radius: 4px; color: #ff7c79; font-size: 11px; font-weight: 700; vertical-align: 2px; }

/* ---- сцена + панель ---- */
/* Висота сцени й панелі фіксована: текст змінюється під час наведення,
   і якби блок «стрибав», деталі тікали б з-під курсора. */
.workspace { display: grid; grid-template: "stage panel" clamp(500px, 44vw, 660px) "zones zones" auto / minmax(0, 1fr) 380px; }
.stage { grid-area: stage; }
.panel { grid-area: panel; }
.zone-bar { grid-area: zones; }
.stage {
  position: relative; overflow: hidden; isolation: isolate; container-type: size;
  background: radial-gradient(ellipse 70% 60% at 50% 72%, #22242b 0%, #121318 55%, var(--bg) 100%);
}
#viewport { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .5s; }
#viewport canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#viewport canvas:active { cursor: grabbing; }
.stage.is-ready #viewport { opacity: 1; }

/* Зображення-заглушка: видно, поки вантажиться 3D, і лишається, якщо WebGL немає.
   Розмір повторює кадрування камери в scene.js. */
.poster { position: absolute; left: 50%; top: 50%; height: min(100cqh, 67.7cqw); width: auto; aspect-ratio: 16 / 9; max-width: none; transform: translate(-50%, -50%); pointer-events: none; transition: opacity .5s; }
.stage.is-ready .poster { opacity: 0; }

.loader { position: absolute; left: 50%; bottom: 22px; z-index: 4; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: #121318e6; color: var(--soft); font-size: 13px; white-space: nowrap; }
.loader .bar { width: 72px; height: 3px; border-radius: 3px; background: #33343b; overflow: hidden; }
.loader .bar i { display: block; width: 0; height: 100%; background: var(--red); transition: width .2s; }
.stage:not(.is-ready):not(.is-poster) .gesture { display: none; }

.tools { position: absolute; top: 16px; right: 16px; z-index: 4; display: flex; gap: 8px; }
.tools button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #14151ad9; color: var(--soft); transition: color .15s, border-color .15s; }
.tools button:hover { color: var(--text); border-color: #4a4b54; }
.tools button[aria-pressed="true"] { color: #ff6a66; border-color: var(--red); }
.tools button:disabled { opacity: .35; cursor: default; }

.gesture { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2; padding: 0 16px; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; transition: opacity .4s; }
.gesture.is-used { opacity: 0; }

#hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hotspot { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; display: grid; place-items: center; pointer-events: auto; }
.hotspot::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px #ffffff2e, 0 2px 10px #0009; transition: transform .15s, background .15s, box-shadow .15s; }
.hotspot:hover::before, .hotspot.is-hover::before { transform: scale(1.25); background: #ff8c89; box-shadow: 0 0 0 6px #ed302e40, 0 0 18px #ed302e80; }
.hotspot.active::before { background: var(--red); box-shadow: 0 0 0 6px #ed302e4d, 0 0 22px #ed302e99; }

#hover-tip { position: absolute; z-index: 5; max-width: 240px; padding: 10px 14px; border: 1px solid #3c3d45; border-radius: 8px; background: #191a20f5; box-shadow: 0 12px 40px #0009; font-size: 13px; line-height: 1.45; pointer-events: none; }
#hover-tip b { display: block; font-size: 14px; }
#hover-tip span { color: var(--muted); }

.panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3b44 transparent; padding: 28px 0 24px 32px; border-left: 1px solid var(--line); }
.panel-tag { color: #ff6a66; font-size: 13px; font-weight: 600; }
h2 { margin: 4px 0 12px; font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
.panel-text { color: var(--soft); }
.list-title { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.benefits { display: grid; gap: 10px; margin-top: 12px; }
.benefits li { position: relative; padding-left: 22px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.benefits li::before { content: ''; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.panel-action { margin-top: 24px; }
.fine { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.action-label { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--soft); }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.segmented button { flex: 1; padding: 9px 4px; border-radius: 7px; color: var(--soft); font-size: 14px; font-weight: 600; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--red); color: #fff; }
.action-note { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---- зони ---- */
.zone-bar { padding: 20px 0 8px; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--soft); font-size: 14px; white-space: nowrap; transition: border-color .15s, color .15s; }
.chips button:hover, .chips button.is-hover { border-color: var(--red); color: var(--text); }
.chips button[aria-pressed="true"] { border-color: var(--text); color: var(--text); background: var(--surface-2); }

footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 28px; color: var(--muted); font-size: 12.5px; }
footer a { color: inherit; }

/* ---- на весь екран ---- */
.experience:fullscreen { max-width: none; background: var(--bg); overflow: auto; }
.experience:fullscreen .workspace { grid-template-rows: max(460px, 100vh - 300px) auto; }

/* ---- планшет і телефон ---- */
@media (max-width: 1020px) {
  .intro { grid-template-columns: 1fr; gap: 14px; }
  /* зони стоять одразу під авто, опис — під ними: так плашки не зсуваються, коли міняється текст */
  .workspace { grid-template: "stage" clamp(320px, 62vw, 520px) "zones" auto "panel" auto / minmax(0, 1fr); }
  .stage { margin: 0 calc(-1 * clamp(20px, 4vw, 56px)); }
  .panel { overflow: visible; padding: 8px 0 24px; border-left: 0; }
  .zone-bar { border-top: 0; padding: 16px 0; }
  .fine { margin-top: 0; }
}
@media (max-width: 640px) {
  h1 { font-size: 32px; }
  .intro p { font-size: 15px; }
  .modes { gap: 0; justify-content: space-between; }
  .modes button { font-size: 15px; }
  .tools { top: 12px; right: 12px; }
  h2 { font-size: 26px; }
  /* зони гортаються вбік, щоб не займати пів екрана */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 6px; scrollbar-width: none; max-width: 100vw; }
  .chips::-webkit-scrollbar { display: none; }
  footer { flex-direction: column; gap: 4px; }
  #hover-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
