/*
 * loader.css
 * HC Photography — Standalone Loader Styles
 * ─────────────────────────────────────────
 * HOW TO USE:
 *   <link rel="stylesheet" href="loader.css">
 *
 * CUSTOMISE:
 *   --loader-primary : accent / ring colour  (default: gold #d4af37)
 *   --loader-bg      : background colour     (default: black #000000)
 */

/* ── CSS Variables ────────────────────────────────── */
:root {
  --loader-primary: #d4af37;
  --loader-bg:      #000000;
}

/* ── Scoped reset ─────────────────────────────────── */
#hc-loader * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Full-screen overlay ──────────────────────────── */
#hc-loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--loader-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

/* ── Hex-grid background ──────────────────────────── */
#hc-loader-hex {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* ── Bokeh particles ──────────────────────────────── */
#hc-loader .hc-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

#hc-loader .hc-particle {
  position: absolute;
  bottom: -100px;
  background: radial-gradient(circle, rgba(212,175,55,.22) 0%, rgba(212,175,55,0) 70%);
  border-radius: 50%;
  filter: blur(1.5px);
  opacity: 0;
  animation: hc-drift var(--drift-duration, 8s) infinite ease-in-out;
  animation-delay: var(--drift-delay, 0s);
}

@keyframes hc-drift {
  0%   { transform: translateY(0) scale(.6);        opacity: 0; }
  15%  { opacity: var(--max-opacity, .4); }
  85%  { opacity: var(--max-opacity, .4); }
  100% { transform: translateY(-110vh) scale(1.3);  opacity: 0; }
}

/* ── Centre content wrapper ───────────────────────── */
#hc-loader .hc-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  text-align: center;
  z-index: 2;
  position: relative;
}

/* ── Lens ring container ──────────────────────────── */
#hc-loader .hc-lens {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Spinning bezel ───────────────────────────────── */
#hc-loader .hc-bezel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  animation: hc-spin 45s linear infinite;
}

@keyframes hc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

#hc-loader .hc-bezel-outer {
  fill: none;
  stroke: rgba(212,175,55,.18);
  stroke-width: 1px;
}

#hc-loader .hc-bezel-inner {
  fill: none;
  stroke: rgba(212,175,55,.35);
  stroke-width: 1.5px;
}

#hc-loader .hc-lens-text {
  fill: rgba(212,175,55,.55);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 2px;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: Outfit, sans-serif;
}

/* ── Gold progress arc ────────────────────────────── */
#hc-loader .hc-ring-svg {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 200px;
  height: 200px;
  pointer-events: none;
  z-index: 3;
  transform: rotate(-90deg);
}

#hc-loader .hc-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.02);
  stroke-width: 2.5px;
}

#hc-loader .hc-ring-fill {
  fill: none;
  stroke: var(--loader-primary);
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-dasharray: 471;
  stroke-dashoffset: 471;
  filter: drop-shadow(0 0 3px rgba(212,175,55,.5));
  transition: stroke-dashoffset 2.2s cubic-bezier(.22, 1, .36, 1);
}

/* ── Dark logo chamber ────────────────────────────── */
#hc-loader .hc-chamber {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #0b0a08;
  box-shadow: inset 0 4px 12px rgba(0,0,0,.8), 0 0 20px rgba(212,175,55,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* ── Logo wrapper (pops in on load) ───────────────── */
#hc-loader .hc-logo-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0) scale(.65);
  width: 108px;
  height: 108px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  z-index: 1;
  transition: transform .8s cubic-bezier(.25, 1, .5, 1), opacity .8s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,.6);
  will-change: transform, opacity;
}

#hc-loader.hc-loading .hc-logo-wrap {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1);
  animation: hc-pulse 3s infinite ease-in-out 1s;
}

@keyframes hc-pulse {
  0%, 100% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    filter: drop-shadow(0 0 10px rgba(212,175,55, 0));
  }
  50% {
    transform: translate3d(-50%, -50%, 0) scale(1.04);
    filter: drop-shadow(0 0 15px rgba(212,175,55,.2));
  }
}

#hc-loader .hc-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Brand name + tagline ─────────────────────────── */
#hc-loader .hc-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

#hc-loader .hc-title {
  font-family: Montserrat, sans-serif;
  font-size: 2.1rem;
  font-weight: 300;
  letter-spacing: 8px;
  color: var(--loader-primary);
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(212,175,55,.15);
}

#hc-loader .hc-subtitle {
  font-family: Outfit, sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 5px;
  color: #a3a099;
  text-transform: uppercase;
}

/* ── SVG hex-cell stroke ──────────────────────────── */
.hc-hex-cell {
  fill: none;
  stroke: rgba(212,175,55,.05);
  stroke-width: 1px;
}

/* ── Camera Shutter Flash Effect ──────────────────── */
#hc-loader .hc-shutter-flash {
  position: absolute;
  inset: 0;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.05s ease-out;
}

#hc-loader .hc-shutter-flash.hc-flash-active {
  opacity: 0.85;
  transition: opacity 0.05s ease-out;
}

/* ── Sound Toggle Button ──────────────────────────── */
#hc-loader .hc-sound-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--loader-primary);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

#hc-loader .hc-sound-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--loader-primary);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

#hc-loader .hc-sound-btn:active {
  transform: scale(0.95);
}

#hc-loader .hc-sound-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}

#hc-loader .hc-sound-btn .hc-icon-mute {
  display: none;
}

#hc-loader .hc-sound-btn.hc-muted .hc-icon-sound {
  display: none;
}

#hc-loader .hc-sound-btn.hc-muted .hc-icon-mute {
  display: block;
}

#hc-loader .hc-sound-btn.hc-muted {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.2);
  color: #a3a099;
}

/* ── Mobile responsive ────────────────────────────── */
@media (max-width: 480px) {
  #hc-loader .hc-title    { font-size: 1.35rem; letter-spacing: 4px; }
  #hc-loader .hc-subtitle { font-size: .65rem;  letter-spacing: 3px; }
  #hc-loader .hc-lens     { width: 170px; height: 170px; }
  #hc-loader .hc-ring-svg { width: 150px; height: 150px; }
  #hc-loader .hc-chamber  { width: 110px; height: 110px; }
  #hc-loader .hc-logo-wrap{ width: 78px;  height: 78px;  }
  #hc-loader .hc-sound-btn{ top: 16px; right: 16px; width: 38px; height: 38px; }
}

/* ── Reduced motion (accessibility) ──────────────── */
@media (prefers-reduced-motion: reduce) {
  #hc-loader .hc-bezel,
  #hc-loader .hc-ring-fill,
  #hc-loader .hc-logo-wrap,
  #hc-loader .hc-particle {
    animation: none !important;
    transition: none !important;
  }
  #hc-loader .hc-logo-wrap {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
  #hc-loader .hc-shutter-flash {
    display: none !important;
  }
}
