/* ==========================================
   Phoenix er Diary 2 — Global Styles (Production v3)
   Lean CSS: complements Tailwind utility classes
   ========================================== */

/* System variables */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base */
html, body {
  height: 100%;
}
body {
  font-family: 'Roboto Mono', monospace;
  background-color: #000;
  color: #fff;
  overflow-x: hidden; /* avoid side scroll on mobile */
  background-image: url('https://diaryofphoenix.click/assets/phoenix-bg.jpg'); /* fallback if video fails */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* =========================
   Background & Overlays
   ========================= */
.background-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 1;
}
#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}
.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6); /* darkness tint */
  z-index: 2; /* sits above the video */
}
/* Glitch layers that ride on top of the overlay background */
.overlay::before,
.overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://diaryofphoenix.click/assets/phoenix-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0;
  z-index: 0; /* visible above overlay's background (element bg paints beneath content) */
  will-change: transform, opacity, clip-path;
}
.overlay::before { animation: bg-glitch-1 3s steps(1) infinite; }
.overlay::after  { animation: bg-glitch-2 5s steps(1) infinite reverse; }

/* Retro scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0), rgba(255,255,255,0) 50%,
    rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.05));
  background-size: 100% 4px;
  animation: scan 10s linear infinite;
  z-index: 3;
  will-change: background-position;
}

/* Content stacking above bg */
.content-container { position: relative; z-index: 4; }

/* =========================
   Brand / Titles
   ========================= */
.brand-header { pointer-events: auto; }
.brand-logo { height: auto; filter: drop-shadow(0 0 10px rgba(0,0,0,0.35)); }

/* =========================
   Playlist CTA (SVG inherits color)
   ========================= */
/* (Primary styling provided via Tailwind in HTML) */

/* =========================
   Social Hover Treatments
   ========================= */
.social-link-fb:hover { color: #1877F2; }
.social-link-yt:hover { color: #FF0000; }
.social-link-share:hover { color: #e5e7eb; }

/* =========================
   Footer note
   ========================= */
.footer-note { color: #9ca3af; }
.footer-note .verse-link { color: #e5e7eb; text-decoration: underline; text-underline-offset: 2px; }
.footer-note .verse-link:hover { color: #ffffff; }

/* =========================
   Share modal toast (extra safety)
   ========================= */
#shareNotification { pointer-events: none; }

/* =========================
   Audio Player + Visualizer
   ========================= */
#audio-player-container {
  position: fixed;
  right: 20px;
  bottom: calc(var(--safe-bottom) + 20px);
  width: 110px;
  height: 110px;
  z-index: 40;
  pointer-events: none; /* only the button should capture */
}
#visualizer {
  position: absolute;
  inset: 0;
  width: 110px;  /* CSS size, JS scales for DPR */
  height: 110px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(255,0,0,0.25));
}
#circular-text {
  position: absolute;
  inset: 0;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  animation: spin 12s linear infinite;
  animation-play-state: paused; /* JS toggles running/paused */
}
#circular-text span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center bottom;
  will-change: transform;
}
#play-pause-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  border: 2px solid rgba(255,255,255,0.9);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), rgba(0,0,0,0.6));
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.6), inset 0 0 6px rgba(255,255,255,0.08);
  pointer-events: auto; /* capture clicks */
  transition: transform .2s cubic-bezier(.2,.9,.2,1), box-shadow .2s ease, border-color .2s ease;
}
#play-pause-btn:hover {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: rgba(255,0,0,0.7);
  box-shadow: 0 6px 22px rgba(255,0,0,0.18), inset 0 0 10px rgba(255,255,255,0.12);
}
#play-pause-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(185,28,28,0.55); }
#play-icon, #pause-icon { width: 26px; height: 26px; }

/* =========================
   Animations / Keyframes
   ========================= */
@keyframes scan { 0% { background-position: 0 0; } 100% { background-position: 0 100dvh; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Background glitch bands */
@keyframes bg-glitch-1 {
  2%  { transform: translate(-3px, 1px); opacity: 1; clip-path: polygon(0 25%, 100% 25%, 100% 30%, 0 30%); }
  4%  { transform: translate(0, 0);   opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  40% { transform: translate(2px, -2px); opacity: 1; clip-path: polygon(0 75%, 100% 75%, 100% 77%, 0 77%); }
  42% { transform: translate(0, 0);   opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
@keyframes bg-glitch-2 {
  0%  { transform: translate(0, 0);   opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  6%  { transform: translate(2px, 1px); opacity: 1; clip-path: polygon(0 15%, 100% 15%, 100% 18%, 0 18%); }
  8%  { transform: translate(0, 0);   opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  55% { transform: translate(-2px, -1px); opacity: 1; clip-path: polygon(0 58%, 100% 58%, 100% 61%, 0 61%); }
  57% { transform: translate(0, 0);   opacity: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* Flicker utility for logos */
.flicker { animation: flicker 3s linear infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }

/* =========================
   Accessibility / Motion prefs
   ========================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .overlay::before, .overlay::after, .scanlines { animation: none !important; }
  #circular-text { animation: none !important; }
}

/* =========================
   Small Screens polish
   ========================= */
@media (max-width: 480px) {
  #audio-player-container { right: 12px; bottom: calc(var(--safe-bottom) + 12px); width: 100px; height: 100px; }
  #visualizer, #circular-text { width: 100px; height: 100px; }
  #play-pause-btn { width: 54px; height: 54px; }
}

/* ===== Partners Row (labels + logos aligned) ===== */
.partners-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;              /* space between the two blocks */
  align-items: start;        /* top-align labels in both columns */
  justify-items: center;     /* center each block */
}

.partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  min-width: 180px;          /* keeps label on one line */
}

/* Make both logos share the same visual height for perfect alignment */
.partner-logo {
  height: 56px;              /* unified logo height */
  width: auto;               /* keep aspect ratio */
}

/* scale up a touch on bigger screens */
@media (min-width: 640px) {
  .partners-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 1.75rem;
  }
  .partner-logo { height: 64px; }
}

@media (min-width: 1024px) {
  .partner-logo { height: 72px; }
}