/* ============================================
   8XRUN — Athletic Brutalist Design System
   Shared CSS — toutes les pages
   ============================================ */

:root {
  /* Colors */
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.55);
  --fg-subtle: rgba(255, 255, 255, 0.35);
  --accent: #ff2e2e;
  --accent-hover: #ff5555;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --grid: rgba(255, 255, 255, 0.04);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-32: 128px;

  /* Container */
  --container-max: 1600px;
  --container-pad: 48px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* Container */
.container {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--s-8) var(--container-pad);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-4) 0 var(--s-12);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  text-decoration: none;
  color: var(--fg);
}

.logo-mark img {
  width: 56px;
  height: 56px;
}

.logo-mark .logo-text {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: var(--s-8);
  align-items: center;
}

.nav-link {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-link::before {
  content: '●';
  color: var(--accent);
  margin-right: 8px;
  font-size: 8px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--fg);
}

.nav-link:hover::before,
.nav-link[aria-current="page"]::before {
  opacity: 1;
}

/* Hamburger mobile */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  color: var(--fg);
  font-family: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.h-display {
  font-family: 'Archivo Black', sans-serif;
  /* Resserré pour éviter le débordement sur grands écrans */
  font-size: clamp(64px, 13vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.05em; /* resserré pour gagner de la largeur */
  /* Sécurité absolue : le texte ne déborde jamais */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: none;
}

.h-display .stroke {
  -webkit-text-stroke: 2px var(--fg);
  color: transparent;
  display: block;
}

.h-display .accent {
  color: var(--accent);
  display: inline-block;
  transform: skewX(-8deg);
}

.h-1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.h-2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--accent);
}

.lede {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 600px;
}

.lede strong {
  color: var(--fg);
  font-weight: 700;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 20px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--accent);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   FORMS
   ============================================ */

.form-row {
  display: flex;
  gap: 0;
  border: 2px solid var(--bg);
}

.form-row input {
  flex: 1;
  padding: 20px 24px;
  background: var(--bg);
  color: var(--fg);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.form-row input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-row button {
  padding: 20px 32px;
  background: var(--bg);
  color: var(--accent);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.form-row button:hover {
  background: var(--fg);
  color: var(--bg);
}

.form-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form feedback */
.form-feedback {
  margin-top: var(--s-4);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  display: none;
}

.form-feedback.success {
  color: #4ade80;
  display: block;
}

.form-feedback.error {
  color: var(--accent);
  display: block;
}

/* Standalone form (Contact page) */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 600px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.form-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 16px 20px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--accent);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  margin-top: var(--s-20);
  padding-top: var(--s-12);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-8);
  padding-bottom: var(--s-12);
}

.footer-brand .logo-mark {
  margin-bottom: var(--s-6);
}

.footer-brand p {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 400px;
}

.footer-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-subtle);
  margin-bottom: var(--s-4);
  font-weight: 400;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.footer-col a {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-6) 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-subtle);
  flex-wrap: wrap;
  gap: var(--s-4);
}

/* ============================================
   PAGE HEADER (for non-home pages)
   ============================================ */

.page-header {
  padding: var(--s-20) 0 var(--s-12);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.page-header::before {
  content: attr(data-bg-text);
  position: absolute;
  top: 50%;
  right: -50px;
  transform: translateY(-50%);
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(120px, 18vw, 280px);
  line-height: 1;
  color: var(--bg-elev);
  pointer-events: none;
  white-space: nowrap;
  z-index: -1;
  opacity: 0.6;
}

.page-header .page-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-6);
}

.page-header .page-title .accent {
  color: var(--accent);
}

.page-header .page-subtitle {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 700px;
  line-height: 1.6;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-up {
  animation: slideUp 0.8s ease-out backwards;
}

.animate-fade {
  animation: fadeIn 0.6s ease-out backwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  :root {
    --container-pad: 24px;
  }

  .site-header {
    padding: var(--s-2) 0 var(--s-6);
  }

  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 100px 24px var(--s-8);
    gap: var(--s-6);
    z-index: 100;
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav .nav-link {
    font-size: 16px;
  }

  .nav-toggle {
    display: block;
    z-index: 101;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-6);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .form-row {
    flex-direction: column;
    border: none;
  }

  .form-row input,
  .form-row button {
    border: 2px solid var(--bg);
    margin-bottom: -2px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
