/* ПК-розмітка «нічний гараж». Усе під html[data-ui=d]; телефонна розмітка тут схована. */
html[data-ui=d] [data-layout=m] { display: none !important; }
html[data-ui=m] [data-layout=d] { display: none !important; }

html[data-ui=d] {
  --bg: #06080b; --bg2: #0c1015; --steel: #1a2027; --line: #26313b;
  --tx: #e6edf3; --mut: #8fa1b3; --cyan: #2ff3ff; --mag: #ff2ea6; --green: #78ff8c; --amber: #ffb347;
  --head: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
  background: var(--bg);
}
html[data-ui=d] body {
  margin: 0; background: var(--bg); color: var(--tx);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
[data-layout=d] { position: relative; }
[data-layout=d] *, [data-layout=d] *::before, [data-layout=d] *::after { box-sizing: border-box; }
[data-layout=d] .skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--cyan); color: #000; padding: 8px 12px; }
[data-layout=d] .skip:focus { left: 8px; }
[data-layout=d] :focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* хром і неон */
[data-layout=d] .chrome {
  font-family: var(--head); font-weight: 700; letter-spacing: -.01em; line-height: 1.02;
  background: linear-gradient(180deg, #fff 0%, #cfd8e2 38%, #6f7d8b 52%, #e9eef3 70%, #9aa7b3 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(47, 243, 255, .18));
}
[data-layout=d] .kinetic span { display: inline-block; padding-bottom: .06em; background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  [data-layout=d] .kinetic span { animation: d-rise .8s cubic-bezier(.2, .8, .2, 1) both; }
  [data-layout=d] .kinetic span:nth-child(2) { animation-delay: .12s; }
  [data-layout=d] .kinetic span:nth-child(3) { animation-delay: .24s; }
  [data-layout=d] .kinetic span:nth-child(4) { animation-delay: .36s; }
}
@keyframes d-rise { from { transform: translateY(.6em); opacity: 0; } to { transform: none; opacity: 1; } }

/* шапка */
.d-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 12px 32px; background: rgba(6, 8, 11, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.d-brand { font-family: var(--head); font-size: 18px; letter-spacing: .02em; }
.d-brand span { color: var(--mut); }
.d-top nav { display: flex; gap: 22px; margin-left: auto; }
.d-top nav a { color: var(--mut); text-decoration: none; font-size: 15px; }
.d-top nav a:hover { color: var(--cyan); }

/* CTA — хромована кнопка з неоновим контуром */
.d-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 10px; text-decoration: none;
  font: 700 18px/1 var(--head); letter-spacing: .02em; color: #041014;
  background: linear-gradient(180deg, #e9fdff, #7ff7ff 45%, #22c9d6 55%, #b7fbff);
  box-shadow: 0 0 0 1px #9ffaff inset, 0 0 22px rgba(47, 243, 255, .45), 0 8px 24px rgba(0, 0, 0, .5);
  transition: transform .15s, box-shadow .15s;
}
.d-cta:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #fff inset, 0 0 34px rgba(47, 243, 255, .7), 0 10px 28px rgba(0, 0, 0, .55); }
.d-cta--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }

/* перший екран: сцена + пульт */
.d-hero {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr);
  min-height: calc(100vh - 65px); border-bottom: 1px solid var(--line);
}
.d-stage {
  position: sticky; top: 65px; align-self: start; height: min(calc(100vh - 65px), 1000px); min-height: 520px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #10202a 0%, #06080b 60%);
  border-right: 1px solid var(--line);
}
.d-poster, .d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-poster { object-fit: contain; padding: 48px; opacity: .9; transition: opacity .6s; }
.d-stage.is-3d .d-poster { opacity: 0; pointer-events: none; }
.d-stage canvas { display: block; touch-action: none; cursor: grab; outline-offset: -3px; }
.d-stage canvas:active { cursor: grabbing; }

.d-pill {
  position: absolute; left: 20px; top: 18px; margin: 0; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; background: rgba(6, 8, 11, .72); border: 1px solid rgba(47, 243, 255, .5);
  box-shadow: 0 0 14px rgba(47, 243, 255, .25); color: #d9fbff; pointer-events: none;
}
.d-item {
  position: absolute; left: 20px; bottom: 64px; display: flex; align-items: center; gap: 8px;
  max-width: min(560px, calc(100% - 40px)); padding: 8px 10px; border-radius: 12px;
  background: rgba(10, 14, 19, .88); border: 1px solid rgba(255, 179, 71, .7);
  box-shadow: 0 0 18px rgba(255, 179, 71, .25);
}
.d-item[hidden] { display: none; }
.d-item p { margin: 0 4px; display: grid; font-size: 14px; }
.d-item p span { color: var(--mut); }
.d-item button { background: none; border: 1px solid var(--line); color: var(--tx); border-radius: 8px; min-width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.d-item button:hover { border-color: var(--amber); }

.d-legend { position: absolute; left: 20px; bottom: 16px; display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--mut); pointer-events: none; }
.d-legend li { display: flex; align-items: center; gap: 6px; }
.d-legend i { width: 14px; height: 10px; border-radius: 2px; border: 1px solid; }
.lg-car { border-color: var(--mag) !important; background: rgba(255, 46, 166, .2); }
.lg-work { border-color: var(--green) !important; background: rgba(120, 255, 140, .25); }
.lg-gate { border-color: var(--cyan) !important; background: rgba(47, 243, 255, .15); }
.lg-door { border-color: var(--amber) !important; background: rgba(255, 179, 71, .2); }

/* секційні ворота — перехід між варіантами */
[data-layout=d] .shutter {
  position: absolute; inset: 0; z-index: 3; display: grid; grid-template-rows: repeat(7, 1fr);
  transform: translateY(-101%); transition: transform .42s cubic-bezier(.6, 0, .3, 1); pointer-events: none;
}
[data-layout=d] .shutter.down { transform: none; }
[data-layout=d] .shutter i {
  display: block; border-bottom: 2px solid #05070a;
  background: linear-gradient(180deg, #8e9aa6 0%, #c9d2db 18%, #5d6873 52%, #a4afba 82%, #3b444d 100%);
  box-shadow: inset 0 -1px 0 rgba(47, 243, 255, .65);
}
@media (prefers-reduced-motion: reduce) { [data-layout=d] .shutter { transition: none; } }

.d-panel { padding: 40px 40px 32px; display: flex; flex-direction: column; gap: 18px; }
.d-eyebrow { margin: 0; color: var(--cyan); font: 600 14px/1 var(--head); letter-spacing: .18em; text-transform: uppercase; }
.d-panel h1 { margin: 0; font-size: clamp(40px, 4.1vw, 64px); }
.d-lead { margin: 0; color: #b9c6d2; font-size: 17px; max-width: 46ch; }

.d-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.d-tabs [role=tab] {
  display: grid; gap: 2px; text-align: left; padding: 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, #151b22, #0c1015); color: var(--tx);
  border: 1px solid var(--line); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.d-tabs [role=tab]:hover { border-color: #3f5566; }
.d-tabs [role=tab][aria-selected=true] { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset, 0 0 20px rgba(47, 243, 255, .25); }
.t-label { font: 600 15px/1.2 var(--head); }
.t-size { color: var(--mut); font-size: 13px; }
.t-sum { font: 700 17px/1.3 var(--head); color: #dffcff; }

.d-sum { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.d-sum output { font: 700 44px/1 var(--head); color: #fff; text-shadow: 0 0 22px rgba(47, 243, 255, .35); }
.d-sum span { color: var(--mut); font-size: 14px; }

.d-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chk { display: grid; gap: 2px; padding: 10px 12px 10px 16px; border-left: 3px solid; border-radius: 4px; background: rgba(255, 255, 255, .025); font-size: 14.5px; }
.chk span { color: #b9c6d2; }
.chk--car { border-color: var(--mag); }
.chk--bench { border-color: var(--green); }
.chk--path { border-color: var(--amber); }
.d-panel .d-cta { align-self: flex-start; margin-top: 4px; }
.d-fine { margin: 0; color: var(--mut); font-size: 13px; }

/* страхи */
.d-fears { padding: 88px 32px; max-width: 1360px; margin: 0 auto; }
.d-fears h2, .d-spec h2, .d-film h2, .d-final h2 { font-size: clamp(32px, 3vw, 46px); margin: 0 0 28px; }
.d-fears__grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; }
.fear {
  position: relative; padding: 24px; border-radius: 16px;
  background: linear-gradient(180deg, #11171d, #0a0d11); border: 1px solid var(--line);
}
.fear::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; pointer-events: none; border: 1px solid transparent; }
.fear--car::before { border-color: rgba(255, 46, 166, .55); box-shadow: 0 0 22px rgba(255, 46, 166, .15); }
.fear--bench::before { border-color: rgba(120, 255, 140, .45); box-shadow: 0 0 22px rgba(120, 255, 140, .12); }
.fear--price::before { border-color: rgba(47, 243, 255, .5); box-shadow: 0 0 22px rgba(47, 243, 255, .14); }
.fear h3 { margin: 0 0 10px; font: 700 24px/1.15 var(--head); }
.fear p { margin: 0 0 12px; color: #b9c6d2; font-size: 15px; }
.fear blockquote { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; background: #07090c; border: 1px dashed rgba(255, 46, 166, .5); font-size: 14px; display: grid; gap: 6px; }
.fear blockquote span:first-child { color: #ffd1ea; font-weight: 600; }
.fear__note { margin-top: 12px !important; font-size: 14px !important; }
.fear__alt { color: var(--mut) !important; font-size: 14px !important; }

[data-layout=d] .zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
[data-layout=d] .zones li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; }
[data-layout=d] .zones li > span:first-child { grid-column: 1 / -1; color: #b9c6d2; }
[data-layout=d] .zbar { height: 8px; border-radius: 4px; background: rgba(120, 255, 140, .18); position: relative; overflow: hidden; }
[data-layout=d] .zbar { overflow: visible; background: rgba(120, 255, 140, .5); }
[data-layout=d] .zbar i { position: absolute; top: -3px; bottom: -3px; left: var(--r); width: 2px; background: #fff; box-shadow: 0 0 6px #fff; } /* смуга — вільно, риска — норма */
[data-layout=d] .zones b { font-family: var(--head); }
[data-layout=d] .zones small { color: var(--mut); }

[data-layout=d] .bars { display: grid; gap: 12px; }
[data-layout=d] .bar { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px; color: var(--tx); font: inherit; cursor: pointer; }
[data-layout=d] .bar:hover, [data-layout=d] .bar.is-on { border-color: rgba(47, 243, 255, .5); }
[data-layout=d] .bar__label { font-size: 14px; }
[data-layout=d] .bar__label small { color: var(--mut); }
[data-layout=d] .bar__track { grid-column: 1; height: 10px; border-radius: 5px; background: #121920; overflow: hidden; }
[data-layout=d] .bar__fill { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #22c9d6, #2ff3ff); box-shadow: 0 0 10px rgba(47, 243, 255, .6); }
[data-layout=d] .bar b { grid-row: 1 / 3; grid-column: 2; font: 700 18px/1 var(--head); }

/* специфікація */
.d-fears, .d-spec, .d-film { scroll-margin-top: 70px; }
.d-spec { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; padding: 40px 32px 88px; max-width: 1360px; margin: 0 auto; align-items: start; }
.d-spec__plan { position: sticky; top: 90px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #07090c; }
.d-spec__plan img { display: block; width: 100%; height: auto; }
.d-spec table { width: 100%; border-collapse: collapse; font-size: 15px; }
.d-spec th, .d-spec td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.d-spec th:nth-child(n+2), .d-spec td:nth-child(n+2) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-spec thead th { color: var(--mut); font-weight: 500; font-size: 13px; }
.d-spec tfoot th, .d-spec tfoot td { font: 700 20px/1.2 var(--head); border-bottom: 0; color: #fff; }
.d-spec tfoot th { text-align: right; }
.d-spec .d-fine { margin-top: 12px; }
.d-warn { margin: 14px 0 0; padding: 0 0 0 18px; color: var(--amber); font-size: 14px; }

/* ролик */
.d-film { padding: 40px 32px 88px; max-width: 1360px; margin: 0 auto; }
.d-film video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; background: #07090c; border: 1px solid var(--line); object-fit: contain; }

/* фінал: ворота, що піднімаються над кнопкою */
.d-final { position: relative; text-align: center; padding: 120px 32px 110px; overflow: hidden; border-top: 1px solid var(--line); }
.d-final__door {
  position: absolute; inset: 0 0 auto; height: 52px; opacity: .55;
  background: repeating-linear-gradient(180deg, #4e5965 0 10px, #1a2027 10px 13px);
  box-shadow: 0 1px 0 var(--cyan), 0 0 26px rgba(47, 243, 255, .35);
}
.d-final p { color: #b9c6d2; margin: -12px 0 28px; font-size: 18px; }
.d-foot { padding: 24px 32px 40px; color: var(--mut); font-size: 13px; border-top: 1px solid var(--line); max-width: 1360px; margin: 0 auto; }

@media (max-width: 1100px) {
  .d-hero { grid-template-columns: 1fr; }
  .d-stage { position: relative; top: auto; height: 62vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .d-fears__grid { grid-template-columns: 1fr 1fr; }
  .d-spec { grid-template-columns: 1fr; }
  .d-spec__plan { position: static; }
}

/* ролик: поки файлу немає або він не грає — видно постер-план */
[data-layout=d] .film-wrap { position: relative; }
[data-layout=d] .film-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 16px; border-radius: 16px; }
[data-layout=d] .film { position: relative; opacity: 0; transition: opacity .4s; }
[data-layout=d] .film.is-playing { opacity: 1; }
[data-layout=d] .film-wrap { border: 1px solid var(--line); border-radius: 16px; background: #07090c; overflow: hidden; }
[data-layout=d] .film-wrap .film { border: 0; }

/* посилання «Конфіденційність» у підвалі — кольором тексту підвалу (docs/SITE.md «Конфиденциальность») */
.d-foot a { color: inherit; }
