/* ============================================================
   NightCity.pl — Cinematic HUD Styles v3
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --nc-yellow: #F3E600;
  --nc-cyan: #02D7F2;
  --nc-red: #C5003C;
  --nc-bg: #050508;
  --nc-surface: #0a0a12;
  --nc-text: #e0e0e0;
  --nc-text-dim: #888;
  --nc-font-display: 'NightCityFont', 'Courier New', monospace;
  --nc-font-mono: 'Courier New', monospace;
  --nc-font-body: 'Segoe UI', Arial, sans-serif;
}

/* --- Font Face --- */
@font-face {
  font-family: 'NightCityFont';
  src: url('../assets/Font.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Selection --- */
::selection { background: rgba(243, 230, 0, 0.3); color: #fff; }

/* --- Scrollbar hidden --- */
::-webkit-scrollbar { display: none; }
html { scrollbar-width: none; }

/* --- Hide native video UI --- */
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }


/* --- Base --- */
html, body { height: 100%; overflow: hidden; }

body {
  background-color: var(--nc-bg);
  background-image: radial-gradient(ellipse at 50% 30%, var(--nc-surface) 0%, var(--nc-bg) 70%);
  color: var(--nc-text);
  font-family: var(--nc-font-body);
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  animation: fadeIn 0.15s ease-in backwards;
  will-change: opacity;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Skip Link --- */
.skip-link {
  position: absolute; top: -100%; left: 50%; transform: translateX(-50%);
  background: var(--nc-yellow); color: #000; padding: 8px 16px;
  z-index: 100; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Focus --- */
:focus-visible { outline: 2px solid var(--nc-yellow); outline-offset: 2px; }
.logo-button:focus { outline: none; }
.logo-button:focus-visible { outline: 2px solid var(--nc-yellow); outline-offset: 4px; }

/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */

/* Diagonal lines (from mockup 3) */
.bg-diagonals {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 100px, rgba(197,0,60,0.018) 100px, rgba(197,0,60,0.018) 101px),
    repeating-linear-gradient(45deg, transparent, transparent 100px, rgba(2,215,242,0.012) 100px, rgba(2,215,242,0.012) 101px);
}

/* Red horizontal accent line */
.bg-red-line {
  position: fixed; top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(197,0,60,0.15) 25%, rgba(197,0,60,0.25) 50%, rgba(197,0,60,0.15) 75%, transparent 95%);
  pointer-events: none; z-index: 0;
  box-shadow: 0 0 20px rgba(197,0,60,0.1);
  transition: opacity 0.2s, box-shadow 0.2s;
}

/* Scanlines */
.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(2, 215, 242, 0.02) 2px, rgba(2, 215, 242, 0.02) 4px);
  pointer-events: none; z-index: 40;
}

/* Ambient Glow */
.ambient-glow { position: fixed; pointer-events: none; border-radius: 50%; }

.ambient-glow--yellow {
  top: -20%; left: 50%; transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(243, 230, 0, 0.1) 0%, transparent 60%);
  z-index: 1;
}
.ambient-glow--cyan {
  bottom: -15%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 400px;
  background: radial-gradient(ellipse, rgba(2, 215, 242, 0.06) 0%, transparent 60%);
  z-index: 1;
}
.ambient-glow--red {
  bottom: 20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(197, 0, 60, 0.08) 0%, transparent 60%);
  z-index: 1;
}

/* ============================================================
   PARTICLES — Obfuscated text (&k style), red glitch chars
   ============================================================ */
.particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 2;
  contain: layout style;
}

.particle {
  position: absolute;
  font-family: var(--nc-font-mono);
  color: var(--nc-red);
  text-shadow: 0 0 4px rgba(197,0,60,0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  contain: layout style paint;
}

/* ============================================================
   GLITCH CHARS — More visible, with red glow
   ============================================================ */
.glitch-chars {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 3;
  contain: layout style;
}

.glitch-char {
  position: absolute;
  font-size: 26px;
  font-family: var(--nc-font-mono);
  color: rgba(197, 0, 60, 0.5);
  text-shadow: 0 0 12px rgba(197, 0, 60, 0.5), 0 0 24px rgba(197, 0, 60, 0.2);
  will-change: transform, opacity;
  contain: strict;
  pointer-events: none;
  animation: glitchFade ease-in-out infinite;
  opacity: 0;
}

@keyframes glitchFade {
  0%, 100% { opacity: 0; transform: translate(0, 0) skewX(0); }
  10%      { opacity: 0; }
  15%      { opacity: 1; transform: translate(2px, 0) skewX(-2deg); }
  20%      { transform: translate(-1px, 1px) skewX(0); }
  50%      { opacity: 0.6; transform: translate(3px, -2px) skewX(3deg); }
  80%      { opacity: 1; transform: translate(-2px, 0) skewX(-1deg); }
  85%      { opacity: 1; }
  90%      { opacity: 0; }
}

.glitch-char--1 { top: 12%; left: 7%;   animation-duration: 6s;  animation-delay: 0s; }
.glitch-char--2 { top: 25%; right: 9%;  animation-duration: 5s;  animation-delay: 1.5s; font-size: 20px; }
.glitch-char--3 { top: 40%; left: 4%;   animation-duration: 7s;  animation-delay: 0.8s; font-size: 22px; }
.glitch-char--4 { top: 55%; right: 5%;  animation-duration: 8s;  animation-delay: 3s; font-size: 28px; }
.glitch-char--5 { top: 68%; left: 10%;  animation-duration: 5s;  animation-delay: 2s; font-size: 18px; }
.glitch-char--6 { top: 78%; right: 12%; animation-duration: 6s;  animation-delay: 4s; font-size: 24px; }
.glitch-char--7 { top: 18%; left: 85%;  animation-duration: 9s;  animation-delay: 1s; font-size: 16px; }
.glitch-char--8 { top: 88%; left: 15%;  animation-duration: 5s;  animation-delay: 5s; }

/* ============================================================
   HUD ELEMENTS
   ============================================================ */

/* Brackets — CP2077 HUD targeting style */
.hud-bracket {
  position: fixed; width: 30px; height: 30px;
  z-index: 5; pointer-events: none;
}
.hud-bracket::before, .hud-bracket::after {
  content: ''; position: absolute; background: rgba(197,0,60,0.4);
}
/* Tick marks on brackets */
.hud-bracket--tl { top: 30px; left: 22px; border-top: 2px solid rgba(2,215,242,0.4); border-left: 2px solid rgba(2,215,242,0.4); }
.hud-bracket--tl::before { width: 6px; height: 1px; top: 6px; left: -1px; }
.hud-bracket--tl::after  { width: 1px; height: 6px; top: -1px; left: 6px; }

.hud-bracket--tr { top: 30px; right: 22px; border-top: 2px solid rgba(2,215,242,0.4); border-right: 2px solid rgba(2,215,242,0.4); }
.hud-bracket--tr::before { width: 6px; height: 1px; top: 6px; right: -1px; }
.hud-bracket--tr::after  { width: 1px; height: 6px; top: -1px; right: 6px; }

.hud-bracket--bl { bottom: 32px; left: 22px; border-bottom: 2px solid rgba(2,215,242,0.4); border-left: 2px solid rgba(2,215,242,0.4); }
.hud-bracket--bl::before { width: 6px; height: 1px; bottom: 6px; left: -1px; }
.hud-bracket--bl::after  { width: 1px; height: 6px; bottom: -1px; left: 6px; }

.hud-bracket--br { bottom: 32px; right: 22px; border-bottom: 2px solid rgba(2,215,242,0.4); border-right: 2px solid rgba(2,215,242,0.4); }
.hud-bracket--br::before { width: 6px; height: 1px; bottom: 6px; right: -1px; }
.hud-bracket--br::after  { width: 1px; height: 6px; bottom: -1px; right: 6px; }

/* HUD Bars — CP2077 system UI style */
.hud-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 20px; font-family: var(--nc-font-mono);
  font-size: 9px; letter-spacing: 1.5px; z-index: 20; flex-shrink: 0;
  text-transform: uppercase;
}
.hud-bar--top {
  color: rgba(2,215,242,0.7);
  border-bottom: 1px solid rgba(197,0,60,0.2);
  background: linear-gradient(90deg, rgba(197,0,60,0.03) 0%, transparent 30%, transparent 70%, rgba(2,215,242,0.03) 100%);
}
.hud-bar__status { color: var(--nc-yellow); transition: opacity 0.3s; }
.hud-bar--bottom {
  color: rgba(2,215,242,0.7);
  font-size: 12px;
  border-top: 1px solid rgba(197,0,60,0.2);
  background: linear-gradient(90deg, rgba(197,0,60,0.03) 0%, transparent 30%, transparent 70%, rgba(2,215,242,0.03) 100%);
}
.hud-bar--bottom a { color: var(--nc-yellow); text-decoration: none; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.content {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; z-index: 10; position: relative; padding: 16px;
}

/* --- Logo --- */
.logo-container { position: relative; z-index: 10; text-align: center; }

.logo-button {
  background: none; border: none; cursor: pointer; padding: 0;
  display: block; animation: logoFloat 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.logo {
  display: block; max-width: 300px; height: auto;
  filter: drop-shadow(0 0 30px rgba(243,230,0,0.4)) drop-shadow(0 0 60px rgba(243,230,0,0.15));
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  mix-blend-mode: screen;
  transition: transform 0.3s, filter 0.2s;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.logo-button:hover .logo {
  filter: drop-shadow(0 0 50px rgba(243,230,0,0.7)) drop-shadow(0 0 100px rgba(243,230,0,0.35));
  transform: scale(1.05);
}

/* --- Fact Panel --- */
.fact-panel {
  position: fixed;
  background: rgba(5,5,8,0.95);
  border: 1px solid rgba(243,230,0,0.3);
  border-left: 3px solid var(--nc-yellow);
  padding: 14px 18px;
  max-width: 340px; min-width: 260px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  will-change: transform, opacity;
  box-shadow: 0 0 20px rgba(243,230,0,0.08), 0 0 40px rgba(197,0,60,0.04);
}

.fact-panel--right { transform: translateY(-50%) translateX(20px); }
.fact-panel--left  { transform: translateY(-50%) translateX(-20px); }
.fact-panel--visible { opacity: 1; }
.fact-panel--visible.fact-panel--right,
.fact-panel--visible.fact-panel--left { transform: translateY(-50%) translateX(0); }
.fact-panel--center { transform: translateX(-50%) translateY(20px); }
.fact-panel--center.fact-panel--visible { transform: translateX(-50%) translateY(0); }

.fact-label {
  font-family: var(--nc-font-mono); font-size: 9px;
  color: var(--nc-red); letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 6px;
}
.fact-name {
  font-family: var(--nc-font-body); font-size: 15px;
  font-weight: 700; color: var(--nc-yellow); margin-bottom: 6px;
}
.fact-text {
  font-family: var(--nc-font-body); font-size: 13px;
  color: var(--nc-text-dim); line-height: 1.7;
}

/* ============================================================
   VIDEO PLAYER
   ============================================================ */
.video-container {
  position: relative; width: 65%; max-width: 620px; z-index: 10;
}

.video-glow {
  position: absolute; inset: -3px;
  contain: layout style;
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, var(--nc-red), var(--nc-cyan)) 1;
  box-shadow: 0 0 20px rgba(2,215,242,0.3), 0 0 40px rgba(2,215,242,0.15), 0 0 20px rgba(197,0,60,0.12);
  pointer-events: none;
  z-index: -1;
}

.video-frame { position: relative; background: #000; overflow: hidden; }

.video-frame video {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
  background: #000;
}

.video-poster {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 2;
  pointer-events: none;
}
.video-poster.hidden { display: none; }

.video-play-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 70px; height: 70px;
  border: 2px solid var(--nc-yellow); border-radius: 50%;
  background: rgba(0,0,0,0.6); color: var(--nc-yellow);
  z-index: 3; display: flex; align-items: center; justify-content: center;
  padding-left: 4px; transition: transform 0.3s ease, background 0.3s, box-shadow 0.3s, opacity 0.3s;
  box-shadow: 0 0 20px rgba(243,230,0,0.2);
  animation: playPulse 2s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes playPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50%      { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

.video-play-btn:hover {
  background: rgba(243,230,0,0.15);
  box-shadow: 0 0 30px rgba(243,230,0,0.5);
  animation: none;
  transform: translate(-50%, -50%) scale(1.1);
}
.video-play-btn.pulse-out {
  animation: none !important;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out, background 0.3s, box-shadow 0.3s;
}
.video-play-btn.hidden { opacity: 0; pointer-events: none; animation: none; }

/* Controls */
.video-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(0deg, rgba(5,5,8,0.95) 0%, rgba(5,5,8,0.6) 60%, transparent 100%);
  border-top: 1px solid rgba(2,215,242,0.08);
  z-index: 3; opacity: 0; transition: opacity 0.3s;
}
.video-frame:hover .video-controls, .video-controls.visible { opacity: 1; }
@media (hover: none) { .video-controls.visible { opacity: 1; } }

.vc-play { background: none; border: none; color: var(--nc-yellow); font-size: 14px; padding: 6px; position: relative; transition: text-shadow 0.2s; }
.vc-play::after { content: ''; position: absolute; inset: -10px; }
.vc-play:hover { text-shadow: 0 0 8px rgba(243,230,0,0.6); }

.vc-progress { flex: 1; height: 3px; background: rgba(255,255,255,0.1); position: relative; border-radius: 1px; cursor: pointer; }
.vc-progress::before { content: ''; position: absolute; inset: -20px 0; }
.vc-progress-bar {
  height: 100%; width: 0%; background: var(--nc-yellow);
  transition: width 0.1s linear; box-shadow: 0 0 4px rgba(243,230,0,0.4); border-radius: 1px; position: relative;
}
.vc-progress-bar::after {
  content: ''; position: absolute; right: -3px; top: -3px;
  width: 9px; height: 9px; background: var(--nc-yellow);
  border-radius: 50%; box-shadow: 0 0 6px rgba(243,230,0,0.5);
  opacity: 0; transition: opacity 0.2s;
}
.vc-progress:hover .vc-progress-bar::after { opacity: 1; }

.vc-time { font-family: var(--nc-font-mono); font-size: 10px; color: rgba(2,215,242,0.7); letter-spacing: 1px; min-width: 36px; }
.vc-mute { background: none; border: none; color: rgba(2,215,242,0.7); font-size: 13px; padding: 6px; position: relative; }
.vc-mute::after { content: ''; position: absolute; inset: -10px; }
.vc-mute:hover { color: var(--nc-cyan); }
.vc-volume { width: 50px; height: 3px; background: rgba(255,255,255,0.1); position: relative; border-radius: 1px; cursor: pointer; }
.vc-volume::before { content: ''; position: absolute; inset: -20px 0; }
.vc-volume-bar { height: 100%; width: 80%; background: var(--nc-cyan); box-shadow: 0 0 4px rgba(2,215,242,0.3); border-radius: 1px; }
.vc-fullscreen { background: none; border: none; color: rgba(2,215,242,0.7); font-size: 14px; padding: 6px; position: relative; }
.vc-fullscreen::after { content: ''; position: absolute; inset: -10px; }
.vc-fullscreen:hover { color: var(--nc-cyan); text-shadow: 0 0 6px rgba(2,215,242,0.5); }

/* Focus indicators for video controls */
.vc-play:focus-visible,
.vc-mute:focus-visible,
.vc-fullscreen:focus-visible { outline: 2px solid var(--nc-yellow); outline-offset: 2px; }
.vc-progress:focus-visible,
.vc-volume:focus-visible { outline: 2px solid var(--nc-yellow); outline-offset: 2px; }

/* Fullscreen */
.video-frame:fullscreen, .video-frame:-webkit-full-screen {
  background: #000; display: flex; flex-direction: column; justify-content: center;
}
.video-frame:fullscreen video, .video-frame:-webkit-full-screen video {
  width: 100%; height: auto; max-height: 100vh; object-fit: contain;
}
.video-frame:fullscreen .video-controls, .video-frame:-webkit-full-screen .video-controls {
  position: fixed; bottom: 0; left: 0; right: 0; opacity: 0;
  padding: 10px 20px; gap: 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, transparent 100%);
}
.video-frame:fullscreen:hover .video-controls, .video-frame:-webkit-full-screen:hover .video-controls,
.video-frame:fullscreen .video-controls.visible, .video-frame:-webkit-full-screen .video-controls.visible { opacity: 1; }
.video-frame:fullscreen .video-play-btn, .video-frame:-webkit-full-screen .video-play-btn { width: 90px; height: 90px; }
.video-frame:fullscreen .video-play-btn svg, .video-frame:-webkit-full-screen .video-play-btn svg { width: 32px; height: 36px; }
.video-frame:fullscreen .vc-progress, .video-frame:-webkit-full-screen .vc-progress { height: 6px; }

/* ============================================================
   SALE BUTTON
   ============================================================ */
.sale-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  margin-top: 12px;
  background: none;
  border: 1px solid rgba(243, 230, 0, 0.2);
  border-left: 3px solid #F3E600;
  z-index: 10;
  transition: border-color 0.3s, background 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.sale-btn:hover {
  border-color: rgba(243, 230, 0, 0.2);
  border-left-color: #F3E600;
  background: none;
}
.sale-btn__text {
  font-family: var(--nc-font-display);
  font-size: 18px;
  color: #F3E600;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(243, 230, 0, 0.15);
}
.sale-btn__sep {
  width: 1px;
  height: 20px;
  background: rgba(243, 230, 0, 0.15);
  flex-shrink: 0;
}
.sale-btn__copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.sale-btn__copy:hover {
  border-color: rgba(2, 215, 242, 0.3);
  background: rgba(2, 215, 242, 0.05);
}
.sale-btn__icon {
  width: 14px; height: 14px;
  stroke: rgba(2, 215, 242, 0.4);
  fill: none;
  transition: stroke 0.2s;
}
.sale-btn__copy:hover .sale-btn__icon {
  stroke: #02D7F2;
}
.sale-btn__label {
  font-family: var(--nc-font-mono);
  font-size: 12px;
  color: rgba(2, 215, 242, 0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s;
}
.sale-btn__copy:hover .sale-btn__label {
  color: #02D7F2;
}
.sale-btn:focus { outline: none; }
.sale-btn:focus-visible { outline: 2px solid var(--nc-yellow); outline-offset: 2px; }
.sale-btn.copied .sale-btn__icon { stroke: #F3E600; }
.sale-btn.copied .sale-btn__label { color: #F3E600; }
.sale-btn.copied .sale-btn__copy {
  border-color: rgba(243, 230, 0, 0.3);
  background: rgba(243, 230, 0, 0.05);
}

/* ============================================================
   GLITCH BURST — Smooth fade in/out
   ============================================================ */
.glitch-burst .logo {
  filter: drop-shadow(-3px 0 0 rgba(197,0,60,0.4)) drop-shadow(3px 0 0 rgba(2,215,242,0.4));
}
.glitch-burst .bg-red-line { opacity: 0.8; box-shadow: 0 0 40px rgba(197,0,60,0.3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .logo { max-width: 200px; }
  .content { gap: 4vh; }
  .video-container { width: 90%; }
  .hud-bar { font-size: 7px; padding: 4px 40px; }
  .hud-bracket--tl { top: 6px; left: 6px; }
  .hud-bracket--tr { top: 6px; right: 6px; }
  .hud-bracket--bl { bottom: 6px; left: 6px; }
  .hud-bracket--br { bottom: 6px; right: 6px; }
  .particle--9, .particle--10, .particle--11, .particle--12 { display: none; }
  .fact-panel { max-width: 280px; min-width: 200px; }
}

@media (max-width: 400px) {
  .logo { max-width: 160px; }
  .hud-bar--top, .hud-bar--bottom { display: none; }
  .hud-bracket { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .particles, .glitch-chars { display: none; }
  .logo { filter: drop-shadow(0 0 20px rgba(243,230,0,0.3)); }
  body { animation: none; }
}
