/* ═══════════════════════════════════════════
   CRESVO HUB — Glass Hub Page
   ═══════════════════════════════════════════ */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #040a06; /* fallback si vidéo indisponible */
}

/* ── SVG filters hidden ── */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   FOND VIDÉO
═══════════════════════════════════════════ */
.hub-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.hub-bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Voile minimal — juste assez pour que le texte reste lisible */
.hub-bg__veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
}

/* ═══════════════════════════════════════════
   HUB LAYOUT
═══════════════════════════════════════════ */
.hub {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center;
  padding: 2.5rem 3rem 2rem;
  gap: 0;
  color: #fff;
}

/* ── HEADER + NAV ── */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0;
}

.hub-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.hub-logo__img {
  height: 36px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}

.hub-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hub-nav__link {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: color .2s;
}
.hub-nav__link:hover { color: white; }
.hub-nav__link--active { color: white; font-weight: 700; }

.hub-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  letter-spacing: -0.1px;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 4px 16px rgba(0,0,0,0.22);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.hub-nav__cta:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 6px 22px rgba(0,0,0,0.3);
}

.hub-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hub-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
}

/* ── HERO TEXT ── */
.hub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .75rem;
  padding: 1.5rem 0;
}

.hub-hero__eyebrow {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
}

.hub-hero__title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.0;
  color: #fff;
  text-shadow: 0 4px 60px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════
   CARTES GLASS
═══════════════════════════════════════════ */
.hub-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  align-self: center;
}

/* ── CARTE ── */
.hub-card {
  position: relative;
  height: clamp(300px, 38vh, 420px);
  border-radius: 28px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  /* Isolation = stacking context = overflow:hidden clips enfants absolus */
  isolation: isolate;
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .45s ease;
  will-change: transform;
}

.hub-card:hover {
  transform: translateY(-8px) scale(1.018);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.5),
    0 12px 24px rgba(0,0,0,0.3);
}

/* ── VERRE DISTORDU — vidéo clonée avec filtre SVG ── */
/*
  Mécanisme :
  - Même source vidéo que le fond
  - position:absolute, décalée par JS pour aligner avec la vidéo de fond
  - filter: url(#gf-*) applique feTurbulence + feDisplacementMap sur les pixels réels
  - overflow:hidden de .hub-card coupe proprement
  → Le verre distord visuellement ce qu'il y a derrière, comme un vrai verre épais
*/
.hub-card__glass-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.hub-card__clone-video {
  /* Positionnée par JS pour coïncider avec la vidéo de fond */
  position: absolute;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  top: 0;
  left: 0;
  /* Distorsion appliquée via JS (attribut filter) */
}

/* ── TEINTE VERRE ORGANIQUE — laiteuse et un peu opaque ── */
.hub-card__tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    150deg,
    rgba(255,255,255,0.10) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.04) 100%
  );
  backdrop-filter: blur(14px) saturate(1.1) brightness(1.03);
  -webkit-backdrop-filter: blur(14px) saturate(1.1) brightness(1.03);
}

/* ── REFLET SPÉCULAIRE ── */
.hub-card__specular {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(
    170deg,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.12) 35%,
    transparent 70%
  );
  border-radius: 28px 28px 0 0;
  pointer-events: none;
  /* Liseré blanc en haut — arête du verre */
  border-top: 1px solid rgba(255,255,255,0.55);
}

/* ── BORDURE VERRE ── */
.hub-card__rim {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,0.12),
    inset 1px 0 0 rgba(255,255,255,0.16),
    inset -1px 0 0 rgba(255,255,255,0.08),
    0 24px 60px rgba(0,0,0,0.35),
    0 4px 16px rgba(0,0,0,0.20);
  pointer-events: none;
}

/* ── CORPS CONTENU ── */
.hub-card__body {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: 2rem 2.25rem;
  gap: 0;
}

.hub-card__icon {
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}

.hub-card__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 1.25rem;
}

.hub-card__title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
  margin-bottom: .75rem;
  margin-top: auto;
}

.hub-card__desc {
  font-size: .875rem;
  color: rgba(255,255,255,.68);
  line-height: 1.65;
  font-weight: 400;
  max-width: 32ch;
}

/* ── CTA BOUTON LIQUID GLASS ── */
.hub-card__footer {
  flex-shrink: 0;
}

.hub-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.01em;
  /* Le backdrop-filter ici agit sur les couches dessous (distorsion + teinte) */
  backdrop-filter: blur(10px) saturate(1.5) brightness(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.5) brightness(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.10),
    0 6px 20px rgba(0,0,0,0.25);
  transition: all .25s ease;
}

.hub-card:hover .hub-card__cta {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 10px 30px rgba(0,0,0,0.35);
  transform: translateX(2px);
}

/* ── FOOTER ── */
.hub-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .65rem;
  color: rgba(255,255,255,.22);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding-top: .5rem;
}

.hub-footer__sep { opacity: .5; }

/* ═══════════════════════════════════════════
   ANIMATIONS D'ENTRÉE
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hub-header  { animation: fadeUp .7s ease both; }
.hub-hero    { animation: fadeUp .7s .12s ease both; }
.hub-cards   { animation: fadeUp .7s .22s ease both; }
.hub-footer  { animation: fadeUp .7s .35s ease both; }

/* Entrée décalée des cartes */
#card-showroom { animation: fadeUp .65s .3s ease both; }
#card-sites    { animation: fadeUp .65s .42s ease both; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow: auto; }
  .hub {
    height: auto;
    min-height: 100vh;
    padding: 2rem 1.25rem 1.5rem;
    grid-template-rows: auto auto auto auto;
    gap: 1rem;
  }
  .hub-cards { grid-template-columns: 1fr; }
  .hub-card  { height: 280px; }
  .hub-hero__title { font-size: 2.75rem; }

  .hub-nav { display: none; }
  .hub-nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    position: fixed;
    inset: 0;
    background: rgba(4,10,6,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 90px 6vw 40px;
    z-index: 50;
  }
  .hub-nav.open .hub-nav__link { font-size: 18px; }
  .hub-nav.open .hub-nav__cta  { font-size: 15px; padding: 11px 22px; }
  .hub-burger { display: flex; position: relative; z-index: 51; }
}

@media (max-width: 480px) {
  .hub { padding: 1.5rem 1rem 1rem; }
  .hub-hero__title { font-size: 2.25rem; }
  .hub-card { height: 260px; border-radius: 20px; }
  .hub-card__body { padding: 1.5rem; }
  .hub-card__rim { border-radius: 20px; }
  .hub-card__specular { border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }
}
