/* ============================================================
     PROJECT DETAIL — Northern Light
     Reuses dark.css tokens, nav, cursor, loader, footer.
     ============================================================ */

  /* hide translatable text until the language is applied (prevents EN→RU flash) */
  html:not(.i18n-ready) [data-i18n],
  html:not(.i18n-ready) [data-lang-en],
  html:not(.i18n-ready) [data-i18n-html] { visibility: hidden; }

  /* ---------- ATMOSPHERE (photo backdrop) ---------- */
  html { background: var(--bg); }
  body { background: transparent; }
  .atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
  .atmo-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; filter: saturate(0.92) contrast(1.02); transition: opacity 1.8s ease; }
  .atmo-slide.is-on { opacity: 0.16; }
  .atmosphere::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(from var(--bg) r g b / 0.92) 0%, rgb(from var(--bg) r g b / 0.78) 30%, rgb(from var(--bg) r g b / 0.74) 60%, rgb(from var(--bg) r g b / 0.95) 100%); }

  .wrap { max-width: none; margin: 0; padding: 0 var(--pad-x); }

  /* ---------- BACK LINK ---------- */
  .backbar { padding: 122px var(--pad-x) 0; }
  .backbar .wrap { padding: 0; }
  .back { position: relative; display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-family: 'Rubik', sans-serif; font-size: 14px; font-weight: 500; letter-spacing: 0; transition: color .35s ease; }
  .back .bk-txt { position: relative; }
  .back .bk-txt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--easing); }
  .back:hover .bk-txt::after { transform: scaleX(1); }
  .back .ar { display: inline-flex; align-items: center; color: var(--red); transition: transform .4s var(--easing); }
  .back .ar svg { width: 18px; height: 18px; display: block; }
  .back:hover { color: var(--ink); }
  .back:hover .ar { transform: translateX(-5px); }

  /* ---------- HERO ---------- */
  .hero { padding: 30px var(--pad-x) 0; }
  .hero .wrap { padding: 0; }
  .hero .eyebrow { display: flex; align-items: baseline; gap: 12px; color: var(--ink); margin-bottom: 22px; font-family: var(--cat-font, 'Rubik'), sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
  .hero .eyebrow .ey-cat { color: var(--red); }
  .hero .eyebrow .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line); align-self: center; }
  .hero .eyebrow .ey-year { color: var(--ink); font-variant-numeric: tabular-nums; }

  .hero h1 { font-family: 'Rubik', sans-serif; font-weight: 800; font-size: clamp(48px, 7vw, 116px); line-height: 0.92; letter-spacing: -0.05em; color: var(--ink); }
  .hero h1 .row { display: block; overflow: hidden; padding: 0.04em 0 0.16em; }
  .hero h1 .row > span { display: inline-block; transform: translateY(110%); will-change: transform; }
  .hero h1 i { font-style: normal; color: var(--red); }

  /* ---------- SECTION SCAFFOLD ---------- */
  .section { padding: 96px var(--pad-x) 0; }
  .hero + .section { padding-top: 40px; }
  .section .wrap { padding: 0; }
  .sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 36px; }
  .sec-head .num { color: var(--red); font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.06em; }
  .sec-head .htxt { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
  .sec-head .rule { flex: 1; height: 1px; background: var(--line); align-self: center; }

  /* ---------- PLAYER (self-hosted video) ---------- */
  .player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 36px 84px -42px rgba(0,0,0,0.9); }
  .player:focus { outline: none; }
  .player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }

  .pl-cover { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 50%, rgba(8,7,6,0.14), rgba(8,7,6,0.42)); transition: opacity .45s ease; }
  .player.is-started .pl-cover { opacity: 0; pointer-events: none; }
  .pl-bigplay { width: 64px; height: 64px; border-radius: 50%; background: rgba(28,26,21,0.45); border: 1px solid rgba(244,239,230,0.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: none; display: flex; align-items: center; justify-content: center; color: var(--red); transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .4s var(--easing); }
  .pl-bigplay:hover { background: var(--red); border-color: var(--red); color: #fff; }
  .pl-bigplay svg { width: 32px; height: 32px; margin-left: 0; }

  .pl-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 14px; padding: 34px 18px 13px; background: linear-gradient(0deg, rgba(8,7,6,0.78), transparent); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .4s var(--easing); }
  .player.controls-on .pl-controls { opacity: 1; transform: translateY(0); }
  .pl-btn { position: relative; background: none; border: none; cursor: none; color: var(--ink); padding: 6px; display: flex; align-items: center; justify-content: center; transition: color .3s ease; }
  .pl-btn:hover { color: var(--red); }
  .pl-btn svg { width: 20px; height: 20px; }
  /* hover tooltips — glass chips like the view tag */
  .pl-tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(5px); background: rgba(28,26,21,0.55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-radius: 5px; padding: 4px 9px; font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; white-space: nowrap; opacity: 0; transition: opacity .3s ease, transform .35s var(--easing); pointer-events: none; }
  .pl-btn:hover .pl-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
  .pl-btn.tip-l .pl-tip { left: 0; transform: translateY(5px); }
  .pl-btn.tip-l:hover .pl-tip { transform: translateY(0); }
  .pl-btn.tip-r .pl-tip { left: auto; right: 0; transform: translateY(5px); }
  .pl-btn.tip-r:hover .pl-tip { transform: translateY(0); }
  @media (hover: none) { .pl-tip { display: none; } }

  /* volume — slider always visible to the right of the speaker icon */
  .pl-vol { position: relative; display: flex; align-items: center; }
  .pl-volline { position: relative; width: 64px; height: 24px; margin-left: 10px; display: flex; align-items: center; cursor: none; touch-action: none; }
  .pl-volline::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.18); }
  .pl-volfill { position: absolute; height: 3px; border-radius: 2px; background: var(--red); width: 100%; pointer-events: none; }
  .pl-volknob { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--red); transform: translateX(-50%) scale(0); left: 100%; pointer-events: none; transition: transform .25s var(--easing); }
  .pl-volline:hover .pl-volknob, .player.voldrag .pl-volknob { transform: translateX(-50%) scale(1); }

  .pl-time { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.05em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pl-time #plCur { color: var(--red); }

  .pl-line { position: relative; flex: 1; height: 24px; display: flex; align-items: center; cursor: none; touch-action: none; }
  .pl-line::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.18); }
  .pl-buffer { position: absolute; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.28); width: 0; }
  .pl-fill { position: absolute; height: 3px; border-radius: 2px; background: var(--red); width: 0; }
  .pl-knob { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--red); transform: translateX(-50%) scale(0); transition: transform .25s var(--easing); }
  .pl-line:hover .pl-knob, .player.scrubbing .pl-knob { transform: translateX(-50%) scale(1); }

  .player:fullscreen { border-radius: 0; }
  .player:fullscreen, .player:fullscreen * { cursor: auto !important; }

  /* ---------- STILLS GALLERY ---------- */
  .stills { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
  .still { position: relative; overflow: hidden; border-radius: 11px; background: var(--bg-2); box-shadow: 0 22px 56px -34px rgba(0,0,0,0.8); transition: box-shadow .7s ease; }
  .still.w3 { grid-column: span 3; aspect-ratio: 16 / 10; }
  .still.w2 { grid-column: span 2; aspect-ratio: 4 / 5; }
  .still.w6 { grid-column: span 6; aspect-ratio: 21 / 8.4; }
  .still { cursor: none; }
  .still .img { position: absolute; inset: -6%; background-size: cover; background-position: center; filter: saturate(1.06) contrast(1.03); transition: transform 1.2s var(--easing), filter 1.1s var(--easing); will-change: transform; }
  .still:is(:hover, .is-live) { box-shadow: 0 36px 80px -30px rgba(0,0,0,0.9); }
  .still:is(:hover, .is-live) .img { transform: scale(1.06); }
  /* hover "view ↗" tag — matches homepage cards */
  .still .view-tag { position: absolute; top: 14px; right: 14px; z-index: 3; font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; padding: 5px 10px; background: rgba(28,26,21,0.42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border-radius: 5px; opacity: 0; transform: translateY(-5px); transition: opacity .4s ease, transform .4s var(--easing); pointer-events: none; }
  .still .view-tag .av { font-weight: 800; color: var(--red); -webkit-text-stroke: 1.4px var(--red); font-size: 12px; margin-left: 2px; }
  .still:is(:hover, .is-live) .view-tag { opacity: 1; transform: translateY(0); }

  /* ---------- CREDITS ---------- */
  .cred-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 60px; }
  .cred { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
  .cred .ck { color: var(--ink); font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
  .cred .cv { color: var(--ink); font-size: 15px; font-weight: 500; text-align: right; }
  .cred .cv .red { color: var(--red); }

  /* ---------- NEXT PROJECT ---------- */
  .nextp { margin-top: 110px; border-top: 1px solid var(--line); }
  .nextp a { display: block; padding: 64px var(--pad-x); position: relative; overflow: hidden; }
  .nextp .np-inner { display: flex; justify-content: flex-start; align-items: center; position: relative; z-index: 2; text-align: left; }
  .nextp .np-k { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
  .nextp .np-title { font-family: 'Rubik', sans-serif; font-weight: 800; font-size: clamp(38px, 6vw, 92px); letter-spacing: -0.05em; line-height: 0.9; color: var(--ink); transition: color .4s ease; }
  .nextp .np-title i { font-style: normal; color: var(--red); }
  .nextp .np-bg { position: absolute; inset: 0; z-index: 1; background-size: cover; background-position: center; opacity: 0; transform: scale(1.08); filter: grayscale(0.3) brightness(0.5); transition: opacity .6s ease, transform 1.2s var(--easing); }
  .nextp a:is(:hover, .is-live) .np-bg { opacity: 0.5; transform: scale(1); }
  .nextp .np-title:hover { color: var(--red); }
  /* фото плашки упирается прямо в футер — без зазора */
  footer.site-footer { margin-top: 0; }

  /* ---------- LIGHTBOX ---------- */
  .lightbox { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgb(from var(--bg) r g b / 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; touch-action: none; overscroll-behavior: contain; }
  .lb-stage { position: relative; width: 90vw; height: 84vh; height: 84dvh; display: flex; align-items: center; justify-content: center; }
  .lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 5px; box-shadow: 0 50px 130px -30px rgba(0,0,0,0.92); opacity: 0; will-change: transform; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
  .lb-top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 24px clamp(14px, 3vw, 40px); z-index: 3; }
  .lb-counter { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 13px; letter-spacing: 0.08em; color: var(--ink); }
  .lb-counter b { color: var(--red); font-weight: 600; }
  .lb-close { cursor: none; background: none; border: none; color: var(--ink); display: flex; align-items: center; justify-content: center; padding: 12px; transition: color .3s ease; }
  .lb-close:hover { color: var(--red); }
  .lb-close svg { width: 22px; height: 22px; }
  .lb-navzone { position: fixed; top: 0; bottom: 0; z-index: 3; display: flex; align-items: center; pointer-events: none; }
  .lb-zone-prev { left: clamp(14px, 3vw, 40px); }
  .lb-zone-next { right: clamp(14px, 3vw, 40px); }
  .lb-nav { pointer-events: auto; cursor: none; background: none; border: none; color: var(--ink); padding: 12px; display: flex; align-items: center; justify-content: center; transition: color .3s ease; }
  .lb-nav:hover { color: var(--red); }
  .lb-nav svg { width: 22px; height: 22px; }
  .lb-cap { position: fixed; bottom: 0; left: 0; right: 0; text-align: center; padding: 20px var(--pad-x) 26px; z-index: 3; font-family: 'Rubik', sans-serif; font-weight: 500; font-size: 13px; letter-spacing: 0.04em; color: var(--fg-dim); }
  @media (max-width: 760px) {
    .lb-stage { width: 94vw; height: 74vh; height: 74dvh; }
    .lb-cap { font-size: 12px; padding-left: 16px; padding-right: 16px; }
  }

  /* ---------- RESPONSIVE ---------- */
  @media (max-width: 1000px) {
    .meta { justify-self: start; max-width: 560px; }
    .stills { grid-template-columns: repeat(4, 1fr); }
    .still.w3 { grid-column: span 2; }
    .still.w2 { grid-column: span 2; }
    .still.w6 { grid-column: span 4; }
  }
  @media (max-width: 760px) {
    .backbar { padding-top: 100px; }
    .credits .wrap { grid-template-columns: 1fr; gap: 0; }
    .cred-list { grid-template-columns: 1fr; }
    .stills { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .still.w3, .still.w2, .still.w6 { grid-column: span 2; aspect-ratio: 4 / 3; }
    .pl-bigplay { width: 54px; height: 54px; }
    .pl-bigplay svg { width: 26px; height: 26px; }
    .pl-controls { gap: 10px; padding: 26px 12px 10px; }
  }

  /* ---------- TOUCH DEVICES ---------- */
  @media (hover: none) {
    .lb-navzone { display: none; }
    .lb-close { padding: 14px; margin: -6px -8px 0 0; }
    .lb-close svg { width: 24px; height: 24px; }
    .lb-top { padding-top: max(16px, env(safe-area-inset-top)); }
    .lb-cap { padding-bottom: max(22px, calc(env(safe-area-inset-bottom) + 10px)); }
    .pl-volline { display: none; }
    .pl-btn { padding: 12px; }
    .pl-btn svg { width: 22px; height: 22px; }
    .pl-line { height: 44px; }
    .pl-knob { width: 15px; height: 15px; }
  }
