/* =============================================
   POLICE
============================================= */
@font-face {
  font-family: "SuperHockey";
  src: url("font/Super Hockey.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gilroy-Medium";
  src: url("font/Gilroy-Medium.ttfs") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* =============================================
   RESET
============================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-synthesis: none;
}

/* =============================================
   VARIABLES
============================================= */
:root {
  --cream: #fff5e6;
  --red: #4d0004;
  --orange: #e46103;
  --green: #729b60;
  --blue: #6097b7;

  --display: "SuperHockey", sans-serif;
  --body: "Gilroy-Medium", system-ui, sans-serif;

  --header-h: 4.5rem;
  --pad: 3rem;
  --gap: 3rem;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brand {
  font-family: var(--display);
}

/* MaVille dans les popups : taille ajustée pour rester inline */
.keyword-popup .brand {
  font-family: var(--display);
  font-size: 1em;
  line-height: inherit;
  vertical-align: baseline;
}

/* =============================================
   HEADER
============================================= */
header {
  height: var(--header-h);
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  position: relative;
  z-index: 10;
}

.logo-link img {
  height: 3.5rem;
  display: block;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  font-family: var(--display);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream);
  text-decoration: none;
}

/* =============================================
   SECTION 1 — HERO
============================================= */
.hero {
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: calc(100svh - var(--header-h) - 2rem);
  padding-left: var(--pad);
  overflow: visible;
  position: relative;
  background: var(--cream);
}

/* --- Colonne gauche --- */
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 3rem 0 14rem 0;
  position: relative;
  z-index: 2;
}

.hero-left h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 6.25rem); /* 100px max */
  color: var(--red);
  line-height: 1;
}

.hero-left p {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem); /* 17px max */
  line-height: 1.25;
  color: var(--red);
  width: 100%;
}

/* Cercle vert */
.circle-green {
  position: absolute;
  top: 36rem;
  left: -11vw;
  width: clamp(14rem, 37vw, 60rem);
  height: clamp(14rem, 37vw, 60rem);
  background: var(--green);
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 6.5vw 0 0 11vw;
  z-index: 15;
}

.circle-green-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.circle-green span {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 3.5rem);
  line-height: 1.2;
  color: var(--cream);
  transform: translateY(-25%);
}

.circle-green-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.logo-wrap {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.circle-green-logos img {
  object-fit: contain;
}

/* --- Réglages individuels des logos --- */
.logo-atlas {
  grid-column: 1 / -1;
}
.logo-atlas img {
  width: clamp(7rem, 20vw, 32rem);
  height: clamp(7rem, 20vw, 32rem);
  transform: translate(15%, -45%);
  filter: brightness(0) invert(1);
}

.logo-vaud img {
  width: clamp(3.5rem, 10vw, 16rem);
  height: clamp(4rem, 12vw, 19rem);
  transform: translate(-5%, -130%);
  filter: brightness(0) invert(1);
}

.logo-police img {
  width: clamp(3.5rem, 10vw, 16rem);
  height: clamp(3.5rem, 10vw, 16rem);
  transform: translate(-1vw, -165%);
  filter: brightness(0) invert(1);
}

/* --- Colonne droite --- */
.hero-right {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Cercle orange décoratif */
.circle-deco {
  position: absolute;
  top: calc(-1 * var(--header-h));
  left: 30vw;
  width: clamp(8rem, 18vw, 13rem);
  aspect-ratio: 1;
  background: var(--orange);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* Cercle principal avec la photo route */
.circle-app {
  position: relative;
  top: 10rem;
  left: 9vw;
  z-index: 1;
  width: clamp(20rem, 66vw, 70rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--blue);
}

.circle-app-bg {
  position: absolute;
  top: 0;
  left: -1.5vw;
  right: 0;
  bottom: 0;
  width: calc(100% + 3vw);
  object-fit: cover;
  transform: scale(1.3) translateY(45%);
  z-index: 2;
}

.circle-app h2 {
  position: absolute;
  top: 7vw; /* ajuste pour monter/descendre le texte */
  z-index: 1; /* derrière l'image, devant le fond bleu */
  font-family: var(--display);
  font-size: clamp(2.5rem, 11vw, 12rem); /* 150px max */
  color: var(--red);
  line-height: 0.8;
  text-align: center;
}

.circle-app-icon-link {
  top: 4vw;
  position: relative;
  z-index: 3;
  display: block;
  line-height: 0;
}

.circle-app-icon {
  width: clamp(4rem, 15vw, 12rem);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.circle-app-icon-link:hover .circle-app-icon {
  transform: scale(1.1);
}

/* =============================================
   SECTION 2 — OBJECTIFS
============================================= */
.section-objectives {
  background: var(--red);
  position: relative;
  overflow: visible;
  height: auto;
  padding: var(--pad) var(--pad) 6rem;
  display: flex;
  flex-direction: column;
}

.objectives-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 6rem);
  color: var(--cream);
  text-transform: uppercase;
  text-align: right;
  position: relative;
  z-index: 16;
}

/* Mots-clés en bas */
.objectives-keywords {
  display: flex;
  justify-content: center;
  gap: 5rem;
  align-items: center;
  padding: 5rem 0 0;
  position: relative;
  z-index: 16;
}

.keyword-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.keyword-icon {
  width: clamp(4rem, 12vw, 8rem);
  height: auto;
  transition: transform 0.2s ease;
}

.keyword-item {
  position: relative;
}

.keyword-item:hover .keyword-icon {
  transform: scale(1.1);
}

.keyword-popup {
  position: absolute;
  bottom: calc(100% + 1rem);
  left: 0;
  right: 0;
  margin-inline: auto;
  width: 16rem;
  background: var(--cream);
  color: var(--red);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  translate: 0 0.5rem;
  transition:
    opacity 0.2s ease,
    translate 0.2s ease;
  z-index: 30;
}

.keyword-item:hover .keyword-popup,
.keyword-item.active .keyword-popup {
  opacity: 1;
  translate: 0 0;
}

.keyword-label {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cycliste bas gauche */
.objectives-cyclist {
  position: absolute;
  bottom: -15rem;
  left: -5rem;
  height: clamp(15rem, 35vw, 35rem);
  z-index: 20;
}

.objectives-cyclist img {
  height: 100%;
  width: auto;
  bottom: -200;
  transform: scaleX(-1);
}

/* Cercle vert avec carte bas droite */
.objectives-map {
  position: absolute;
  right: -8vw;
  bottom: -15rem;
  width: clamp(15rem, 34vw, 26rem);
  aspect-ratio: 1;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 25;
}

.objectives-map img {
  width: clamp(26rem, 37vw, 45rem);
  height: auto;
  object-fit: contain;
  transform: translateX(18%) translateY(-10%);
}

/* =============================================
   SECTION 3 — MA VILLE (fond rouge + cercle orange)
============================================= */
.section-maville {
  position: relative;
  z-index: 10;
  background: var(--blue);
  height: 120svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-maville h2 {
  font-family: var(--display);
  font-size: clamp(3rem, 20vw, 20rem);
  color: var(--cream);
  text-transform: uppercase;
  text-align: center;
  line-height: 0.85;
  position: relative;
  z-index: 1;
  padding-top: 10rem;
}

/* Grand cercle décoratif derrière photo et titre */
.maville-circle {
  position: absolute;
  bottom: -126svh;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: clamp(20rem, 110vw, 800rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orange);
  z-index: 0;
  pointer-events: none;
}

.maville-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 84svh;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
}

/* Texte intro en haut de la section rouge */
.maville-text {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  padding: 3rem var(--pad) 6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  top: 5rem;
}

.maville-text p {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.4;
  color: var(--cream);
  opacity: 0.85;
}

/* Badges App Store / Google Play */
.maville-stores {
  position: absolute;
  bottom: 5rem;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  z-index: 3;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.store-badge {
  height: clamp(2.5rem, 6vw, 8rem);
  width: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.store-badge:hover {
  transform: scale(1.1);
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
  background: var(--red);
  border-top: 1px solid rgba(255, 245, 230, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem var(--pad);
}

.site-footer span {
  font-size: 0.8rem;
  color: var(--cream);
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  font-size: 0.8rem;
  color: var(--cream);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-nav a:hover {
  opacity: 1;
}

/* =============================================
   BOUTON RETOUR EN HAUT
============================================= */
.back-to-top {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 200;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: var(--cream);
  color: var(--red);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: scale(1.1);
}

/* =============================================
   RESPONSIVE — TABLETTE PAYSAGE (≤ 1024px)
============================================= */
@media (max-width: 64em) {
  .circle-app {
    width: clamp(18rem, 55vw, 50rem);
    left: 5vw;
  }

  .objectives-map {
    right: -8vw;
    width: clamp(13rem, 28vw, 22rem);
  }
}

/* =============================================
   RESPONSIVE — TABLETTE PORTRAIT (≤ 768px)
============================================= */
@media (max-width: 48em) {
  :root {
    --pad: 2rem;
  }

  .hero {
    grid-template-columns: 1fr 1.4fr;
  }

  /* Cercles décoratifs masqués */
  .circle-deco {
    display: none;
  }
  .circle-green {
    display: none;
  }

  .circle-app {
    width: clamp(16rem, 50vw, 40rem);
    top: 4rem;
    left: 2vw;
  }

  .objectives-cyclist {
    height: clamp(12rem, 30vw, 22rem);
  }

  .objectives-map {
    width: clamp(11rem, 24vw, 18rem);
    right: -5vw;
    bottom: -10rem;
  }

  .section-maville h2 {
    font-size: clamp(3rem, 18vw, 12rem);
    padding-top: 6rem;
  }
}

/* =============================================
   RESPONSIVE — TÉLÉPHONE (≤ 580px)
============================================= */
@media (max-width: 36.25em) {
  :root {
    --pad: 1.25rem;
  }

  /* Header */
  .logo-link img {
    height: 2.5rem;
  }
  nav {
    gap: 1rem;
  }
  nav a {
    font-size: 0.9rem;
  }

  /* Hero : empilé en colonne, pleine hauteur */
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: calc(100svh - var(--header-h));
    padding-right: var(--pad);
  }

  .hero-left {
    padding-bottom: 2rem;
  }

  /* Pas de débordement horizontal */
  .hero-left p {
    width: 100%;
  }

  .circle-deco {
    display: none;
  }
  .circle-green {
    display: none;
  }

  .hero-right {
    min-height: 22rem;
    justify-content: center;
    overflow: visible;
  }

  .circle-app {
    width: clamp(16rem, 85vw, 22rem);
    top: 0;
    left: 0;
  }

  /* Objectifs : pleine hauteur, contenu centré */
  .section-objectives {
    min-height: 100svh;
    padding-bottom: var(--pad);
    justify-content: center;
    gap: 3rem;
  }

  .objectives-title {
    text-align: center;
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .objectives-cyclist {
    display: none;
  }
  .objectives-map {
    display: none;
  }

  .objectives-keywords {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 2rem;
  }

  .keyword-icon {
    width: clamp(5rem, 18vw, 7rem);
  }

  .keyword-label {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }

  /* Popups : centrées dans le viewport au tap */
  .keyword-popup {
    position: fixed;
    bottom: 10svh;
    top: auto;
    left: var(--pad);
    right: var(--pad);
    width: auto;
    max-width: 22rem;
    margin-inline: auto;
  }

  /* Ma Ville */
  .section-maville {
    height: auto;
    min-height: 100svh;
  }

  .maville-text {
    top: 0;
    padding: 2rem var(--pad) 1.5rem;
  }

  .section-maville h2 {
    font-size: clamp(3rem, 18vw, 7rem);
    padding-top: 0;
    z-index: 5;
  }

  .maville-stores {
    bottom: 6rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .store-badge {
    height: clamp(7rem, 20vw, 7rem);
  }

  /* Footer : empilé */
  .site-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
    text-align: center;
    padding: 1.5rem var(--pad);
  }
}

/* =============================================
   RESPONSIVE — PETIT TÉLÉPHONE (≤ 380px)
============================================= */
@media (max-width: 23.75em) {
  .circle-app {
    width: 90vw;
  }

  .section-maville h2 {
    font-size: clamp(2.5rem, 16vw, 5rem);
  }

  .store-badge {
    height: clamp(5rem, 20vw, 7rem);
  }
}
