/* =====================================================
   CERT — Chapelle Endurance Racing Team
   css/style.css
   ===================================================== */

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

:root {
  --neon:    #CCFF00;
  --neon-dim: rgba(204, 255, 0, 0.12);
  --black:   #000000;
  --dark:    #0d0d0d;
  --card:    #111111;
  --text:    #ffffff;
  --muted:   rgba(255, 255, 255, 0.40);
  --font:    'Barlow Condensed', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--black);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* ── GRID BACKGROUND ───────────────────────────────── */
/*
   Two overlapping linear-gradients create a precise grid.
   Opacity is very low to stay subtle on pure black.
*/
#hero {
  background-color: var(--black);
  background-image:
    linear-gradient(rgba(204, 255, 0, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 255, 0, 0.045) 1px, transparent 1px);
  background-size: 100px 100px;
  background-position: center center;
}

/* ── SCROLL SPACER ─────────────────────────────────── */
#scroll-spacer {
  height: 600px;
  background: var(--black);
}

/* ═════════════════════════════════════════════════════
   NAVBAR
   ===================================================== */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 62px;
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(204, 255, 0, 0.07);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.logo-badge {
  background: var(--neon);
  color: #000;
  font-family: var(--font);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 5px 8px;
  line-height: 1;
}

.logo-text-block {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1.1;
}

.logo-sub {
  font-family: var(--font);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
  line-height: 1;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-link {
  font-family: var(--font);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  cursor: none;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); border-bottom-color: var(--neon); }

/* Member button */
.btn-member {
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  padding: 7px 20px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: none;
}

.btn-member:hover {
  background: var(--neon);
  color: #000;
  border-color: var(--neon);
}


/* ═════════════════════════════════════════════════════
   HERO
   ===================================================== */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Three.js canvas */
#canvas-3d {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
}

/* Radial neon glow centred behind the 3D object */
.hero-glow {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 680px;
  height: 420px;
  background: radial-gradient(
    ellipse at center,
    rgba(180, 255, 0, 0.16) 0%,
    rgba(180, 255, 0, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 50%;
}

/* ── HEADLINE (top-right) ──────────────────────────── */
.hero-headline {
  position: absolute;
  top: 100px;
  right: 48px;
  text-align: right;
  z-index: 10;
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--neon);
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.4s;
}

.hero-title {
  font-family: var(--font);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.87;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-title .line {
  display: block;
  font-size: clamp(80px, 9.5vw, 138px);
  opacity: 0;
  transform: translateY(28px);
  animation: slideUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .line-1 { animation-delay: 0.55s; }
.hero-title .line-2 { animation-delay: 0.70s; }
.hero-title .line-3 { animation-delay: 0.85s; }

.hero-title .accent { color: var(--neon); }

/* ── SCROLL INDICATOR (bottom-right) ──────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  right: 48px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 1.5s;
}

.scroll-label {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.28);
  writing-mode: vertical-lr;  /* rotated 90° looks like original */
  transform: rotate(180deg);
}

.scroll-bar {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--neon), transparent);
  animation: scrollPulse 2s ease-in-out infinite 1.8s;
}


/* ═════════════════════════════════════════════════════
   NEXT RACE WIDGET
   ===================================================== */
#next-race-widget {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 300;

  display: flex;
  align-items: center;

  /* Start small, expand to the right on hover */
  width: 130px;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--neon);
  padding: 14px 16px;
  gap: 0;
  cursor: none;
  max-width: 400px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#next-race-widget:hover {
  width: 340px;
}

/* Collapsed part (always visible) */
.widget-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  width: 98px;  /* matches collapsed widget inner width */
}

.widget-icon {
  color: var(--neon);
  width: 18px;
  height: 18px;
}

.widget-label {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--neon);
}

/* Vertical divider */
.widget-divider {
  flex-shrink: 0;
  width: 1px;
  height: 52px;
  background: rgba(204, 255, 0, 0.25);
  margin: 0 14px;
}

/* Expanded content */
.widget-expanded {
  display: flex;
  align-items: center;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.25s ease 0.15s;
  gap: 0;
}

#next-race-widget:hover .widget-expanded {
  opacity: 1;
}

.widget-race-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.widget-race-name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 1px;
}

.widget-race-meta,
.widget-race-drivers {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.widget-race-meta svg,
.widget-race-drivers svg {
  color: var(--neon);
  opacity: 0.8;
  flex-shrink: 0;
}

/* Countdown block */
.widget-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid rgba(204, 255, 0, 0.2);
}

#countdown-value {
  font-family: var(--font);
  font-weight: 900;
  font-size: 32px;
  color: var(--neon);
  line-height: 1;
}

.countdown-unit {
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 3px;
}

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border: 1.5px solid #CCFF00;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  /* Décalage de -15px (moitié de 30px) pour centrer sur le pointeur */
  transform: translate(calc(var(--cx, 0px) - 15px), calc(var(--cy, 0px) - 15px));
  transition: transform 0.06s linear,  /* suit la souris */
              width     0.2s ease,
              height    0.2s ease,
              opacity   0.2s ease;
  mix-blend-mode: difference;           /* effet d'inversion sympa sur fond sombre */
}

/* Grossit légèrement sur les éléments cliquables */
a:hover ~ #custom-cursor,
button:hover ~ #custom-cursor {
  width: 46px;
  height: 46px;
}

/* ═════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ===================================================== */
@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1); }
  50%       { opacity: 1;    transform: scaleY(1.1); }
}
