/* Viacheslav Yermolenko — site base.
   Style «Монтажна» (A, html[data-theme='A']) — NLE black, warm white, REC red ·
   Unbounded (variable 200–900: liquid heads AND subheads) / Manrope / JetBrains Mono */

:root {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --surface: #161618;
  --surface-2: #1e1e21;
  --line: rgba(241, 239, 234, 0.1);
  --line-strong: rgba(241, 239, 234, 0.22);
  --text: #f1efea;
  --muted: #a3a097;
  --accent: #ff453a;          /* REC */
  --accent-ink: #0b0b0c;     /* 5.8:1 on REC (white would be 3.4:1) */
  --link: #f1efea;
  --btn-bg: #f1efea;          /* primary button */
  --btn-ink: #0b0b0c;
  --on-media: #ffffff;
  --rec: #ff453a;
  --stage-bg: radial-gradient(120% 90% at 50% 40%, #18181b 0%, #0d0d0f 55%, #070708 100%);
  --card-bg: #161619;
  --card-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shade: #050506;
  --lt-ripple: 255 255 255;

  --f-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-liquid: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --display-w: 500;
  --line-w: 400;              /* the second-level statement under a wordmark */
  --display-ls: -0.025em;
  --display-vs: normal;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --tsb-right: 0px;
  --tsb-bottom: 0px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

html[data-tsb='v'] { --tsb-right: 86px; }
html[data-tsb='h'] { --tsb-bottom: 90px; }
@media (max-width: 767px) { html[data-tsb='h'] { --tsb-bottom: 62px; } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s ease, color 0.4s ease;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--f-mono); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 calc(var(--gutter) + var(--tsb-right)) 0 var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; hyphens: manual; }

.skip { position: fixed; left: 12px; top: 12px; z-index: 200; background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; border-radius: 10px; transform: translateY(-160%); transition: transform 0.2s; text-decoration: none; font-weight: 600; }
.skip:focus { transform: none; }

/* ---------- buttons, links, segmented ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-family: var(--f-ui); font-weight: 600; font-size: 15px; letter-spacing: 0.005em; text-decoration: none; cursor: pointer;
  background: transparent; color: var(--text);
  transition: transform 0.25s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); border-color: transparent; }
.btn-primary:hover { background: color-mix(in oklab, var(--btn-bg) 86%, var(--bg)); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-xl { min-height: 60px; padding: 0 28px; font-size: 18px; }
.btn-glass { background: rgba(11, 11, 12, 0.62); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn-glass svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--link); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--link) 40%, transparent); padding-bottom: 2px; }
.link-arrow::after { content: '→'; transition: transform 0.3s var(--ease-out); }
.link-arrow:hover::after, a:hover > .link-arrow::after { transform: translateX(4px); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: color-mix(in oklab, var(--bg) 82%, transparent); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 30px; transition: color 0.2s, background-color 0.25s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--text); color: var(--bg); }

.rec-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); flex: none; }

/* kicker = a clip label: colour chip + number + name */
.kick { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kick i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: block; flex: none; }
.kick span:first-of-type { color: var(--text); }

/* section heads */
.sec-h {
  font-family: var(--f-display); font-weight: var(--display-w); font-variation-settings: var(--display-vs);
  letter-spacing: var(--display-ls); line-height: 1; margin: 0 0 22px; font-size: clamp(40px, 7.2vw, 108px);
}
.sec-h.lt { font-family: var(--lt-font); }

/* NLE clip header at the top edge of a section: the "splice" between two clips */
.clip-head {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; height: 26px;
  margin: 0 calc(var(--tsb-right)) 0 0; padding: 0 var(--gutter);
  font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in oklab, var(--bg-2) 92%, transparent), transparent 70%);
}
.clip-head i { width: 18px; height: 10px; border-radius: 2px; background: var(--c); display: block; }
.clip-head b { font-weight: 500; color: var(--text); }
.clip-head em { margin-left: auto; font-style: normal; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; z-index: 70; left: 0; right: var(--tsb-right); top: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px var(--gutter); pointer-events: none;
  transition: transform 0.45s var(--ease-out);
}
.topbar > * { pointer-events: auto; }
.topbar.hide { transform: translateY(-110%); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: var(--display-w); font-variation-settings: var(--display-vs); font-size: 14px; letter-spacing: -0.005em; color: var(--text); padding: 8px 12px 8px 10px; border-radius: 999px; background: color-mix(in oklab, var(--bg) 70%, transparent); }
.topbar-r { display: flex; align-items: center; gap: 8px; }
html.on-media .brand, html.on-media .seg { color: #fff; }

@media (max-width: 767px) {
  .topbar { padding: 10px 12px; gap: 6px; }
  .topbar-cta { display: none; }
  .brand { font-size: 11.5px; padding: 7px 10px 7px 9px; gap: 7px; }
  .seg button { padding: 5px 8px; font-size: 12px; min-height: 30px; }
}

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(24px + var(--tsb-bottom) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: opacity 0.3s, transform 0.3s var(--ease-out); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- detail (letterbox open of a work) ---------- */
.detail { position: fixed; inset: 0; z-index: 150; background: #000; color: #fff; }
.detail[hidden] { display: none; }
.d-frame { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 50%; will-change: transform; background: #000; }
.d-bg { position: absolute; inset: -6%; width: 112%; height: 112%; max-width: none; object-fit: cover; filter: blur(36px) brightness(0.55); }
.d-fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-fg.contain { object-fit: contain; }
.d-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 24%, transparent 50%, rgba(0,0,0,.82) 100%); pointer-events: none; }
.d-info { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(clamp(20px, 5vw, 56px) + env(safe-area-inset-bottom)); display: grid; gap: 14px; max-width: 820px; }
.d-info .mask { overflow: hidden; padding-bottom: 2px; }
.d-info .mask > * { will-change: transform; }
.d-kick { display: inline-flex; gap: 10px; align-items: center; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.d-kick::before { content: ''; width: 18px; height: 1px; background: var(--rec); }
.d-info h2 { margin: 0; font-family: var(--f-display); font-weight: var(--display-w); font-variation-settings: var(--display-vs); font-size: clamp(30px, 6vw, 80px); line-height: 1.02; letter-spacing: var(--display-ls); }
.d-info .btn-primary { background: #fff; color: #0b0b0c; }
.d-top { position: absolute; right: var(--gutter); top: calc(clamp(14px, 2.4vw, 26px) + env(safe-area-inset-top)); display: flex; gap: 8px; }
.d-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; cursor: pointer; display: grid; place-items: center; }
.d-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.d-btn:focus-visible { outline: 2px solid #fff; }
.d-btn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ---------- shared top bar pieces (home + direction pages) ---------- */
/* topbar mark: VY | MIRY in miniature */
.brand-vy { display: inline-flex; align-items: center; gap: 0; font-family: var(--f-display); letter-spacing: -0.01em; }
.brand-vy b { font-weight: 700; }
.brand-vy span { font-weight: 300; }
.brand-vy i { display: inline-block; width: 2px; height: 1.05em; background: var(--rec); margin: 0 0.18em; }

/* directions menu */
.pg-dirs { position: relative; }
.pg-dirs summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: color-mix(in oklab, var(--bg) 82%, transparent);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.pg-dirs summary::-webkit-details-marker { display: none; }
.pg-dirs summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 0.3s var(--ease-out); }
.pg-dirs[open] summary svg { transform: rotate(180deg); }
.pg-dirs-list {
  position: absolute; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; min-width: 280px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}
.pg-dirs-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--text); }
.pg-dirs-list a:hover { background: var(--surface-2); }
.pg-dirs-list a[aria-current='page'] { background: color-mix(in oklab, var(--c) 22%, var(--surface)); }
.pg-dirs-list i { width: 14px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.pg-dirs-list b { font-weight: 500; font-size: 11px; color: var(--muted); }
html.on-media .pg-dirs summary { color: #fff; }
@media (max-width: 900px) { .pg-dirs { display: none; } }
