/* ========================================
   HARNA COMPANY — Modern Interactive
======================================== */

:root {
  --gold: #f0c040;
  --black: #03050c;
  --text: #f0f4ff;
  --text-muted: #9aabcd;
  --transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--black);
  color: var(--text);
}

/* Backgrounds */
.bg-base {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(0, 47, 167, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 47, 167, 0.10) 0%, transparent 45%),
    #03050c;
  z-index: -3;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease, background 0.6s ease;
  z-index: -2;
  pointer-events: none;
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  15%  { opacity: 0.45; }
  85%  { opacity: 0.25; }
  100% { transform: translateY(-100vh) scale(0.4); opacity: 0; }
}

/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(3, 5, 12, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gold);
}

.logo-header img {
  height: 32px;
  filter: drop-shadow(0 0 6px rgba(240,192,64,0.35));
}

.logo-header span {
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 1rem;
}

.nav {
  display: flex;
  gap: 0.1rem;
  list-style: none;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: var(--transition);
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--gold);
  font-size: 1.2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
}

/* ===== ACCUEIL ===== */
body.accueil {
  overflow: hidden;
}

.main-accueil {
  height: 100vh;
  padding-top: 56px;
  display: flex;
  flex-direction: column;
}

/* Logo = environ moitié de la page */
.hero-center {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  z-index: 10; /* au-dessus de la pluie */
}

.main-logo {
  height: min(42vh, 340px);
  width: auto;
  max-width: 85vw;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(0,47,167,0.45));
  transition: filter 0.5s ease;
  position: relative;
  z-index: 10;
}

/* Grille des cases - avec petit espace */
.filiales-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  padding: 0 12px 12px;
  height: min(38vh, 280px);
}

.filiale-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.filiale-card:hover,
.filiale-card.active {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-3px);
  z-index: 2;
}

.card-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.35s ease;
  position: relative;
  z-index: 1;
}

.filiale-card:hover .card-label,
.filiale-card.active .card-label {
  color: #fff;
}

.filiale-card[data-color="#e53935"]:hover .card-label,
.filiale-card[data-color="#e53935"].active .card-label { color: #ef5350; }

.filiale-card[data-color="#ff6d00"]:hover .card-label,
.filiale-card[data-color="#ff6d00"].active .card-label { color: #ff9100; }

.filiale-card[data-color="#29b6f6"]:hover .card-label,
.filiale-card[data-color="#29b6f6"].active .card-label { color: #4fc3f7; }

.filiale-card[data-color="#43a047"]:hover .card-label,
.filiale-card[data-color="#43a047"].active .card-label { color: #66bb6a; }

.filiale-card[data-color="#8e24aa"]:hover .card-label,
.filiale-card[data-color="#8e24aa"].active .card-label { color: #ce93d8; }

.filiale-card[data-color="#1565c0"]:hover .card-label,
.filiale-card[data-color="#1565c0"].active .card-label { color: #64b5f6; }

.filiale-card[data-color="#2e7d32"]:hover .card-label,
.filiale-card[data-color="#2e7d32"].active .card-label { color: #81c784; }

.filiale-card[data-color="#f0c040"]:hover .card-label,
.filiale-card[data-color="#f0c040"].active .card-label { color: #ffd966; }

/* ===== PLUIE D'ICÔNES DORÉES (derrière le logo) ===== */
.theme-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1; /* derrière le logo (z-index 10) */
  overflow: hidden;
}

.rain-icon {
  position: absolute;
  top: -10%;
  animation: rainFall linear forwards;
  user-select: none;
  filter: 
    sepia(1) 
    saturate(8) 
    hue-rotate(5deg) 
    brightness(1.15) 
    drop-shadow(0 0 4px rgba(240, 192, 64, 0.6));
  will-change: transform, opacity;
  opacity: 0.75;
}

@keyframes rainFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  12% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(110vh) rotate(20deg) scale(1);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .filiales-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    height: min(45vh, 320px);
    gap: 8px;
  }
  
  .main-logo {
    height: min(32vh, 220px);
  }
  
  .card-label {
    font-size: 0.88rem;
  }
}

@media (max-width: 550px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(3,5,12,0.97);
    flex-direction: column;
    padding: 1rem;
  }
  
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  
  .main-logo {
    height: min(28vh, 160px);
  }
  
  .filiales-grid {
    height: min(48vh, 300px);
    padding: 0 8px 8px;
    gap: 6px;
  }
  
  .card-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
  }
}
