/* ==========================================================
   QPUC — Landing page
   Tokens
   ========================================================== */
:root {
  --violet: #7C3AED;
  --violet-light: #9D6BFF;
  --violet-deep: #3B1478;
  --navy: #170B2E;
  --yellow: #FFC933;
  --yellow-deep: #E6A800;
  --lavender: #F3EEFF;
  --lavender-deep: #E4D9FF;
  --white: #FFFFFF;
  --ink: #170B2E;
  --ink-soft: #4B3B70;

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  --wrap: 1180px;
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--lavender);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0 0 18px;
  font-weight: 700;
}
.eyebrow--light { color: var(--yellow); }

.display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  margin: 0 0 24px;
}
.ink-yellow {
  background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================
   Reveal on scroll
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================
   Buzzer buttons — signature element
   ========================================================== */
.btn.buzzer {
  --buzzer-size: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--violet-light) 0%, var(--violet) 55%, #5B21B6 100%);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow:
    0 6px 0 #4C1D95,
    0 14px 28px rgba(124, 58, 237, 0.35),
    inset 0 2px 0 rgba(255,255,255,0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn.buzzer:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 #4C1D95,
    0 18px 32px rgba(124, 58, 237, 0.4),
    inset 0 2px 0 rgba(255,255,255,0.4);
}
.btn.buzzer:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #4C1D95,
    0 6px 14px rgba(124, 58, 237, 0.3),
    inset 0 2px 0 rgba(255,255,255,0.3);
}
.btn.buzzer::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid var(--violet-light);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn.buzzer:hover::before {
  opacity: 0.5;
  transform: scale(1.04);
}
.buzzer--small { padding: 12px 24px; font-size: 14px; }
.buzzer--large { padding: 26px 56px; font-size: 18px; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

/* ==========================================================
   Intro splash — three buzzers become the "o"s of the title
   ========================================================== */
.intro {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(180deg, var(--lavender) 0%, var(--white) 100%);
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
.intro.is-active { display: flex; }
.intro.is-done { opacity: 0; pointer-events: none; }

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.intro-buzzer {
  position: fixed;
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(59, 20, 120, 0.35));
  opacity: 0;
  transform: scale(0.5);
  z-index: 2;
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    left 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    top 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    width 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    height 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.intro-buzzer.is-in { opacity: 1; transform: scale(1); }
.intro-buzzer.is-pressed { transform: scale(0.88); }
.intro-buzzer.is-arrived { opacity: 0; }

.intro-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 5.2vw, 58px);
  line-height: 1.1;
  color: var(--ink);
  text-align: center;
  margin: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.intro-title.is-visible { opacity: 1; transform: translateY(0); }
.intro-word { display: inline-block; }

.intro-o {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  object-fit: contain;
  vertical-align: -0.14em;
  filter: drop-shadow(0 0.03em 0.05em rgba(59, 20, 120, 0.35));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.intro-o.is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
}

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(243, 238, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(59, 20, 120, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.logo-dot { color: var(--violet); }
.main-nav { display: flex; gap: 32px; }
.main-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--violet); }

@media (max-width: 760px) {
  .main-nav { display: none; }
  .header-inner { padding-top: 12px; padding-bottom: 12px; }
  .logo { font-size: 19px; }
}

#comment-ca-marche,
#modes,
#resultats {
  scroll-margin-top: 96px;
}

/* ==========================================================
   Hero — full-bleed image with overlaid nav + title
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  animation: heroDrift 12s ease-in-out infinite;
}
@keyframes heroDrift {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.035) translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg img { animation: none; }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.14) 26%,
    rgba(255, 255, 255, 0) 50%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 96px 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-content .eyebrow { text-align: center; margin-bottom: 6px; }
.hero-content .display-xl {
  max-width: 22ch;
  font-size: clamp(32px, 4.2vw, 58px);
  line-height: 1.1;
  margin: 0;
}

/* Hero title: whole words animate in from the left, one block at a time */
.hero-content .word {
  display: inline-block;
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero-content .word.is-in {
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .hero-content .word { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 760px) {
  .hero { min-height: 92vh; }
  .hero-scrim {
    background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.28) 40%,
      rgba(255, 255, 255, 0) 62%
    );
  }
  .hero-content { padding: 82px 24px 16px; }
  .hero-content .eyebrow { font-size: 11.5px; margin-bottom: 4px; }
  .hero-content .display-xl { font-size: clamp(26px, 6.5vw, 40px); }
}

/* ==========================================================
   How it works
   ========================================================== */
.how {
  padding: 120px 0;
  background: var(--white);
}
.how-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
}
.how-sticky-col {
  position: sticky;
  top: 110px;
  align-self: start;
}
.how-portrait {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 700 / 933;
  margin-top: 32px;
}
.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.portrait-img.is-active {
  opacity: 1;
  transform: translateY(0);
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding-top: 8px;
}
.step {
  border-left: 3px solid var(--lavender-deep);
  padding-left: 28px;
  transition: border-color 0.3s ease;
}
.step-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--violet);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.step h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 10px 0 12px;
}
.step p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
  max-width: 46ch;
}

@media (max-width: 900px) {
  .how-inner { grid-template-columns: 1fr; }
  .how-sticky-col {
    position: static;
    /* Reserves the column's natural height so pinning the portrait
       (position:fixed, below) never shrinks this row — which would
       shift .how-steps and feed back into the observer watching it. */
    min-height: 556px;
  }
  .how-portrait { margin: 24px auto 0; }

  /* The shared portrait can't stay sticky in a single-column layout without
     overlaying the step text, so it pins as a small corner thumbnail instead,
     visible only while the "how it works" section is on screen. */
  .how.is-portrait-pinned .how-portrait {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: auto;
    top: auto;
    width: 92px;
    max-width: 92px;
    margin: 0;
    z-index: 40;
    box-shadow: 0 10px 24px rgba(59, 20, 120, 0.28);
    border-radius: var(--radius-md);
    background: var(--white);
    opacity: 0.96;
  }
}

/* ==========================================================
   Modes (Paris / Pouvoirs)
   ========================================================== */
.mode { padding: 120px 0; }
.mode--paris {
  background: linear-gradient(180deg, var(--violet-deep) 0%, var(--navy) 100%);
  color: var(--white);
}
.mode--pouvoirs { background: var(--lavender); }

.mode-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.mode-inner--reverse { grid-template-columns: 1.2fr 0.8fr; }
.mode-inner--reverse .mode-art { order: 2; }

.mode-art img {
  max-width: 320px;
  width: 100%;
  height: auto;
  aspect-ratio: 700 / 933;
  object-fit: contain;
  margin: 0 auto;
}
.mode-text {
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 50ch;
  margin: 0 0 28px;
  opacity: 0.9;
}
.mode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mode-list li {
  padding-left: 22px;
  position: relative;
  line-height: 1.55;
  max-width: 50ch;
}
.mode-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--yellow);
}
.mode--pouvoirs .mode-list li::before { background: var(--violet); }

@media (max-width: 900px) {
  .mode-inner, .mode-inner--reverse { grid-template-columns: 1fr; }
  .mode-inner--reverse .mode-art { order: -1; }
  .mode-art { order: -1; }
}

/* ==========================================================
   Results
   ========================================================== */
.results {
  padding: 120px 0;
  background: var(--white);
  text-align: center;
}
.results-title { margin-left: auto; margin-right: auto; }
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 56px;
  text-align: left;
}
.result-card {
  border-radius: var(--radius-lg);
  padding: 40px 36px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.result-card--win { background: var(--lavender); }
.result-card--lose { background: #FBF4F2; }
.result-card img {
  width: 60%;
  height: auto;
  aspect-ratio: 700 / 933;
  object-fit: contain;
  margin: 0 auto;
  align-self: center;
}
.result-card-copy { padding: 8px 4px 36px; }
.result-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 10px;
}
.result-card p {
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 760px) {
  .results-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   Final CTA
   ========================================================== */
.final-cta {
  background: var(--navy);
  color: var(--white);
  padding: 140px 0 60px;
  text-align: center;
}
.final-cta-inner { display: flex; flex-direction: column; align-items: center; }
.final-cta-title { color: var(--white); }
.eyebrow--light { text-align: center; }

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding-top: 40px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-credit p {
  max-width: 48ch;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0 0 12px;
  font-size: 14.5px;
}
.footer-credit a {
  color: var(--yellow);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
}
.footer-credit a:hover { text-decoration: underline; }
.logo--footer { color: var(--white); }

.footer-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.footer-badge img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(80px, 18vw, 220px);
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--violet-light) 0%, var(--violet-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  padding: 20px 0 10px;
  user-select: none;
}

/* subtle grain overlay for premium feel */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
