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

:root {
  --accent:     #f5c800;
  --black:      #2a2a2a;
  --black-mid:  #111111;
  --black-deep: #080808;
  --white:      #ffffff;
  --gray:       #666;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--white);
  font-family: var(--font-body);
  color: var(--black);
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* ===== BACKGROUND PHOTO ===== */
.page__bg { display: none; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header__logo {
  font-family: var(--font-display);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--black);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.header__logo-img { height: 32px; width: auto; display: block; }

.header__back {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--black);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  padding: 9px 16px;
  transition: background 0.2s, transform 0.2s;
}
.header__back::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M0 5h12M5 1L1 5l4 4' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M0 5h12M5 1L1 5l4 4' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.header__back:hover { background: #e6b800; }
.header__back:hover::before { transform: translateX(-3px); }

/* ===== MAIN LAYOUT ===== */
.page {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px 0 0;
}


/* ===== MID BLOCK (invader + rule + content) ===== */
.page__mid {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-end;
  padding-bottom: clamp(24px, 5vh, 56px);
}

/* ===== 404 SVG (ratio 1013:314 ≈ 3.23:1 — piloté par width) ===== */
.page__invader {
  display: block;
  width: clamp(130px, 42vw, 240px);
  max-width: 60vw;
  height: auto;
  align-self: center;
  margin-bottom: clamp(16px, 4vh, 60px);
}

/* ===== ACCENT RULE ===== */
.page__rule {
  width: 100%;
  height: 1px;
  background: transparent;
  flex-shrink: 0;
}

/* ===== BOTTOM SECTION ===== */
.page__bottom {
  padding: clamp(16px, 3vh, 32px) 6vw 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: end;
}

.page__headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 72px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--black);
}

.page__headline em {
  font-style: normal;
  color: var(--accent);
}

.page__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page__desc {
  font-size: clamp(13px, 1.4vw, 15px);
  color: rgba(42,42,42,0.5);
  line-height: 1.65;
  max-width: 42ch;
}

.page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.btn--primary {
  background: var(--accent);
  color: var(--black);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 13px 28px;
  transition: transform 0.2s;
  display: inline-block;
  flex-shrink: 0;
}
.btn--primary:hover { transform: translateY(-2px); }

.btn--ghost {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(42,42,42,0.45);
  text-decoration: none;
  border-bottom: 1px solid rgba(42,42,42,0.2);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.btn--ghost:hover {
  color: var(--black);
  border-color: rgba(42,42,42,0.5);
}

/* ===== 404 NUMBER ===== */
.page__number {
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 300px);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: rgba(245,200,0,0.08);
  -webkit-text-stroke: 2px rgba(245,200,0,0.55);
  text-stroke: 2px rgba(245,200,0,0.55);
  user-select: none;
  pointer-events: none;
  align-self: end;
  text-align: right;
  padding-right: 0;
  padding-bottom: 0;
  transform: translateY(20px);
}

/* ===== TICKER ===== */
.page__ticker {
  overflow: hidden;
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 10px 0;
  flex-shrink: 0;
}

.page__ticker-inner {
  display: flex;
  white-space: nowrap;
  animation: ticker 18s linear infinite;
  width: max-content;
}

.page__ticker-text {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(42,42,42,0.2);
  padding: 0 32px;
}

.page__ticker-dot {
  color: var(--accent);
  opacity: 0.6;
}

@keyframes ticker {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ===== XS : très petits écrans < 480px ===== */
@media (max-width: 479px) {
  .header { padding: 0 16px; }
  .header__logo-img { height: 32px; }
  .header__logo-text { font-size: 20px; }
  .header__back { display: none; }

  .page__invader {
    width: clamp(90px, 32vw, 140px);
    margin-bottom: clamp(10px, 3vh, 20px);
  }

  .page__bottom {
    padding: 10px 20px 0;
    gap: 14px;
  }

  .page__headline { font-size: clamp(26px, 7.5vw, 36px); }

  .page__desc { font-size: 13px; max-width: 100%; }

  .page__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .btn--primary, .btn--ghost { font-size: 11px; padding: 12px 22px; }

  .page__number {
    font-size: clamp(64px, 28vw, 110px);
    text-align: center;
    align-self: center;
    padding-right: 0;
    transform: translateY(0);
    margin-bottom: 6px;
  }
}

/* ===== SM : mobiles 480–767px ===== */
@media (min-width: 480px) and (max-width: 767px) {
  .header__back { display: none; }

  .page__invader {
    width: clamp(120px, 28vw, 180px);
    margin-bottom: clamp(12px, 3.5vh, 28px);
  }

  .page__bottom { padding: 14px 32px 0; gap: 20px; }

  .page__headline { font-size: clamp(30px, 6.5vw, 44px); }

  .page__desc { font-size: 13px; }

  .page__number {
    font-size: clamp(72px, 32vw, 140px);
    text-align: center;
    align-self: center;
    padding-right: 0;
    transform: translateY(0);
    margin-bottom: 8px;
  }
}

/* ===== LANDSCAPE compact (hauteur < 520px) ===== */
@media (max-height: 520px) {
  .page__invader {
    width: clamp(70px, 16vh, 120px);
    margin-bottom: 6px;
  }
  .page__mid { padding-bottom: 4px; }
  .page__bottom { padding-top: 6px; padding-bottom: 6px; gap: 10px; }
  .page__headline { font-size: clamp(20px, 4.5vw, 32px); }
  .page__desc { display: none; }
  .page__ticker { display: none; }
  .page__number { font-size: clamp(56px, 16vh, 110px); transform: translateY(0); }
}

/* ===== MD : tablettes & desktop 768px+ ===== */
@media (min-width: 768px) {
  .header { padding: 0 60px; }

  .page__mid {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    grid-template-columns: 1fr;
    justify-content: normal;
    padding-bottom: 0;
  }

  .page__invader {
    align-self: end;
    justify-self: center;
    width: clamp(180px, 26vw, 340px);
    max-width: 45vw;
    height: auto;
    margin-bottom: clamp(12px, 2.5vh, 24px);
  }

  .page__bottom {
    grid-template-columns: 1fr auto;
    align-items: end;
    padding-top: clamp(10px, 2vh, 20px);
    padding-bottom: clamp(20px, 4vh, 44px);
  }

  .page__number { font-size: clamp(140px, 19vw, 260px); }
}

/* ===== LG : grands écrans 1200px+ ===== */
@media (min-width: 1200px) {
  .page__bottom { grid-template-columns: 55% 1fr; }
  .page__number { font-size: clamp(170px, 20vw, 290px); }
  .page__invader { width: clamp(240px, 28vw, 400px); }
}

/* ===== XL : très grands écrans 1600px+ ===== */
@media (min-width: 1600px) {
  .page__invader { width: clamp(300px, 26vw, 460px); }
  .page__number { font-size: clamp(200px, 22vw, 320px); }
}

/* ===== MOBILE : centrage global + ticker agrandi < 768px ===== */
@media (max-width: 767px) {
  .page__bottom { justify-items: center; }
  .page__left { display: flex; flex-direction: column; align-items: center; }
  .page__headline { text-align: center; }
  .page__desc { text-align: center; max-width: 100%; }
  .page__actions { justify-content: center; align-items: center; }
  .page__body { align-items: center; }
  .page__ticker { padding: 40px 0; }
  .page__ticker-text { font-size: 40px; }
}
