/* ========================================================================== */
/* DESIGN TOKENS                                                               */
/* ========================================================================== */

:root {
  /* Colors */
  --c-primary: #3f0d1d;
  --c-secondary: #d81b60;
  --c-accent: #f59e0b;
  --c-bg: #f7f2ea;
  --c-border: rgba(14, 14, 14, 0.08);
  --c-text: #0e0e0e;
  --c-muted: #6b7280;
  --c-white: #ffffff;
  --c-focus: rgba(216, 27, 96, 0.24);

  /* Spacing */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 24px;
  --space-5: 36px;

  /* Layout */
  --radius: 16px;
  --maxw: 1120px;
  --maxw-editorial: 860px;

  /* Typography */
  --font-body: "Corps_de_texte", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "HeroDisplay", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Section sizing */
  --section-padding: clamp(24px, 4vw, 64px);
  --hero-title-size: clamp(84px, 15vw, 240px);
  --story-step-offset: 24px;
}

/* ========================================================================== */
/* FONTS                                                                       */
/* ========================================================================== */

@font-face {
  src: url("fonts/CabinetGrotesk-Extrabold.ttf") format("truetype");
  font-family: "HeroDisplay";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  src: url("fonts/SourceSans3-VariableFont_wght.ttf") format("truetype");
  font-family: "Corps_de_texte";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

/* ========================================================================== */
/* BASE                                                                        */
/* ========================================================================== */

/* Box model */

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

/* Root and body */

html,
body {
  height: 100%;
  cursor: crosshair;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow: hidden;
  margin: 0;
  background: var(--c-primary);
  color: var(--c-text);
  font-family: var(--font-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Media */

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

/* Links and focus */

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
}

/* Text helpers */

strong {
  font-weight: inherit;
}

b {
  position: relative;
  top: 0.06em;
  font-size: 1.2em;
}

/* ========================================================================== */
/* GLOBAL LAYOUT                                                               */
/* ========================================================================== */

/* Scroller */

.page__scroller {
  height: 100vh;
  overflow-x: clip;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.page__scroller::-webkit-scrollbar {
  display: none;
}

/* Generic sections */

.section {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: var(--section-padding);
  scroll-snap-align: start;
}

.section__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.section__inner--wide {
  max-width: none;
}

.section__inner--editorial {
  max-width: var(--maxw-editorial);
  margin: 0 auto;
  padding-left: 7vw;
  padding-right: 7vw;
}

.section__title {
  margin: 10px 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

/* Results-specific section layout */

#results.section--story {
  padding-left: 0;
  padding-right: 0;
}

#results .section__inner--editorial {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* ========================================================================== */
/* SHARED COMPONENTS AND STATES                                                */
/* ========================================================================== */

/* Reveal */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-primary);
  box-shadow: 0 12px 28px rgba(207, 18, 78, 0.18);
  color: var(--c-white);
  font-family: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 0.5s ease, filter 0.5s ease, box-shadow 0.5s ease;
}

.btn:hover {
  filter: brightness(1.03);
  transform: translateY(-5px);
}

.btn:active {
  filter: brightness(0.98);
  transform: translateY(0);
}

.btn--ghost {
  background: color-mix(in srgb, var(--c-white) 68%, transparent);
  box-shadow: 0 10px 24px rgba(14, 14, 14, 0.08);
  color: var(--c-text);
}

.btn--accent {
  border-color: transparent;
  background: var(--c-secondary);
  box-shadow: 0 14px 30px rgba(216, 27, 96, 0.28);
  color: var(--c-white);
}

/* Scroll cue */

.scrollcue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.52);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.scrollcue svg {
  width: 26px;
  height: 26px;
}

/* ========================================================================== */
/* HERO                                                                        */
/* ========================================================================== */

/* Hero section */

.section--hero {
  background-image: linear-gradient(
    180deg,
    var(--c-primary) 0%,
    color-mix(in srgb, var(--c-primary) 94%, var(--c-secondary)) 36%,
    color-mix(in srgb, var(--c-primary) 80%, var(--c-secondary)) 54%,
    color-mix(in srgb, var(--c-primary) 60%, var(--c-secondary)) 68%,
    color-mix(in srgb, var(--c-secondary) 74%, white) 94%,
    color-mix(in srgb, var(--c-secondary) 70%, white) 100%
  );
  color: var(--c-white);
}

/* Hero layout */

.hero {
  display: grid;
  align-items: end;
  min-height: calc(100vh - (2 * var(--section-padding)));
  grid-template-columns: minmax(0, 1fr) minmax(280px, 32vw);
  column-gap: clamp(24px, 4vw, 48px);
}

.hero__main {
  min-width: 0;
}

/* Hero title */

.hero__title {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - (2 * var(--section-padding)));
  margin: 0;
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: var(--hero-title-size);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.08em;
  opacity: var(--hero-title-opacity, 1);
  transform: translate3d(0, var(--hero-title-y, 0px), 0);
  will-change: transform, opacity;
}

.hero__title-line {
  display: block;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Hero aside */

.hero__aside {
  display: flex;
  align-self: end;
  justify-self: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 5vh;
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.8s ease;
}

.hero__aside:hover,
.hero__aside:focus-visible,
.hero__aside:focus-within {
  opacity: 1;
}

.hero__aside:active {
  opacity: 0.3;
}

.hero__subtitle {
  max-width: 18ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.3;
  letter-spacing: 0.01em;
  transition: color 0.5s ease, transform 0.5s ease, opacity 0.5s ease;
}

.hero__aside:hover .hero__subtitle,
.hero__aside:focus-visible .hero__subtitle,
.hero__aside:focus-within .hero__subtitle {
  color: rgba(255, 255, 255, 0.95);
  transform: translateX(20px);
}

.hero__aside:hover .scrollcue,
.hero__aside:focus-visible .scrollcue,
.hero__aside:focus-within .scrollcue {
  opacity: 0;
  transform: translateX(-20px);
}

/* ========================================================================== */
/* STORY SECTIONS                                                              */
/* ========================================================================== */

/* Shared story section */

.section--story {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 400vh;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--c-white);
}

/* Story backgrounds */

#problem.section--story {
  background-image: linear-gradient(
    180deg,
    color-mix(in srgb, var(--c-secondary) 70%, white) 0%,
    color-mix(in srgb, var(--c-secondary) 75%, white) 12%,
    color-mix(in srgb, var(--c-secondary) 80%, var(--c-text)) 35%,
    color-mix(in srgb, var(--c-secondary) 60%, var(--c-text)) 60%,
    color-mix(in srgb, var(--c-secondary) 30%, var(--c-text)) 82%,
    var(--c-text) 100%
  );
}

#resolution.section--story {
  background-image: linear-gradient(
    180deg,
    var(--c-text) 0%,
    color-mix(in srgb, var(--c-text) 98%, var(--c-bg)) 12%,
    color-mix(in srgb, var(--c-text) 94%, var(--c-bg)) 24%,
    color-mix(in srgb, var(--c-text) 88%, var(--c-bg)) 36%,
    color-mix(in srgb, var(--c-text) 80%, var(--c-bg)) 46%,
    color-mix(in srgb, var(--c-text) 68%, var(--c-bg)) 56%,
    color-mix(in srgb, var(--c-text) 52%, var(--c-bg)) 64%,
    color-mix(in srgb, var(--c-text) 34%, var(--c-bg)) 72%,
    color-mix(in srgb, var(--c-text) 18%, var(--c-bg)) 80%,
    color-mix(in srgb, var(--c-text) 8%, var(--c-bg)) 88%,
    var(--c-bg) 100%
  );
}

#results.section--story {
  background: var(--c-bg);
  color: var(--c-text);
}

/* Story structure */

.story {
  position: relative;
  min-height: 400vh;
}

.story__sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.story__header {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(60px, 10vh, 130px);
  margin-bottom: clamp(20px, 3vh, 30px);
}

.story__header .section__title {
  display: inline-block;
  opacity: var(--story-title-opacity, 1);
  text-align: right;
  transform: translate3d(var(--story-title-x, 0%), 0, 0);
  will-change: transform, opacity;
}

.story__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  width: 100%;
  min-height: clamp(300px, 40vh, 350px);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 18%,
    black 82%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 18%,
    black 82%,
    transparent 100%
  );
}

/* Story steps */

.story__step {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
  padding-bottom: 12px;
  opacity: 0;
  filter: blur(30px);
  pointer-events: none;
  transform: translate3d(0, var(--story-step-offset), 0);
  will-change: transform, opacity, filter;
}

.story__step.is-active {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.story--interactive .story__step {
  transition: opacity 0.1s ease, transform 0.1s ease, filter 0.1s ease;
}

.story--interactive.is-intro-phase .story__step {
  transition: none;
}

.story--interactive .story__step.is-intro-active {
  opacity: var(--story-step-opacity, 0);
  filter: blur(var(--story-step-blur, 0px)) brightness(var(--story-step-brightness, 1));
  pointer-events: auto;
  transform: translate3d(
    var(--story-step-x, 0%),
    var(--story-step-y, 0px),
    0
  ) scale(var(--story-step-scale, 1));
}

.story--interactive.is-carousel-phase .story__step {
  z-index: var(--story-step-z, 1);
  opacity: var(--story-step-opacity, 0);
  filter: blur(var(--story-step-blur, 0px)) brightness(var(--story-step-brightness, 1));
  pointer-events: none;
  transform: translate3d(
    0,
    var(--story-step-y, 0px),
    0
  ) scale(var(--story-step-scale, 1));
  transition: none;
}

.story--interactive.is-carousel-phase .story__step.is-active {
  pointer-events: auto;
}

/* Story text */

.story__text {
  max-width: 45ch;
  margin: 0;
  margin-right: auto;
  color: var(--c-white);
  text-align: left;
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

#dark__title {
  color: var(--c-text);
  opacity: 0.7;
}

/* ========================================================================== */
/* RESULTS                                                                     */
/* ========================================================================== */

/* Shared sizing */

.section--results,
.results {
  min-height: 220vh;
}

/* Results structure */

.results {
  position: relative;
}

.results__sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
}

.results__stage {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  grid-template-columns: 1fr 1fr;
}

/* Results columns */

.results__media,
.results__actions {
  min-height: 100vh;
  opacity: 0;
  will-change: transform, opacity;
}

.results__media {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  box-shadow: var(--results-media-shadow, 0 0 0 rgba(0, 0, 0, 0));
  transform: translate3d(0, var(--results-media-y, 80px), 0);
}

.results__actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px);
  overflow: hidden;
  transform: translate3d(var(--results-actions-x, 80px), 0, 0);
}

/* CTA */

.results__cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  gap: var(--space-5);
}

/* Media */

.results__gif {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Buttons */

.results__btn {
  min-width: 240px;
  padding-left: 24px;
  padding-right: 24px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.results__btn[data-results-link="contribute"] {
  padding-top: 16px;
  padding-right: 28px;
  padding-bottom: 16px;
  padding-left: 28px;
  font-size: 1.5rem;
}

.results__btn:active {
  transform: translateY(1px) scale(0.985);
}

.results__btn.btn--ghost:hover {
  background: color-mix(in srgb, var(--c-white) 82%, transparent);
}

.results__btn.btn--accent:hover {
  filter: brightness(1.06);
}

/* Footer band */

.results__footerband {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 18px 28px;
  gap: 14px 20px;
  border: 0;
  background: transparent;
  opacity: 0.5;
}

.results__footerlink {
  color: rgba(14, 14, 14, 0.56);
  white-space: nowrap;
  font-size: 0.94rem;
  line-height: 1;
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.results__footerlink:hover,
.results__footerlink:focus-visible {
  color: rgba(14, 14, 14, 0.9);
  transform: translateY(-1px);
}

.results__footerlink:active {
  transform: translateY(0);
}

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

@media (max-width: 780px) {
  /* Global flow */

  html,
  body {
    overflow: auto !important;
    height: auto !important;
  }

  .page__scroller {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  /* Sections */

  .section {
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    scroll-snap-align: none !important;
  }

  .section__inner--editorial {
    max-width: 100% !important;
    padding: 60px 24px !important;
  }

  .section--hero {
    display: flex !important;
    min-height: 100svh !important;
    height: 100vh !important;
    padding: 60px 24px 60px 24px !important;
  }

  #results.section--story {
    min-height: auto !important;
    padding-top: 5vh !important;
  }

  /* Hero */

  .hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0;
  }

  .hero__main {
    width: 100% !important;
    height: auto !important;
  }

  .hero__main,
  .hero__title {
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
  }

  .hero__title {
    width: 80vw !important;
    height: auto !important;
    margin: 0 !important;
    padding: 5vh 2vw 20vh 2vw !important;
    text-align: left !important;
    font-size: 18vw !important;
    line-height: 0.8 !important;
  }

  .hero__aside,
  .scrollcue {
    display: none !important;
  }

  .hero__subtitle {
    max-width: 100% !important;
    margin-left: 0 !important;
    text-align: left !important;
    font-size: 1.25rem !important;
  }

  /* Story */

  .section--story {
    min-height: auto !important;
    height: auto !important;
    padding-top: 40px !important;
  }

  .story,
  .story__sticky {
    position: static !important;
    display: block !important;
    min-height: auto !important;
    height: auto !important;
  }

  .story__header {
    justify-content: flex-start !important;
    margin: 0 0 40px 0 !important;
  }

  .story__header .section__title {
    opacity: 1 !important;
    text-align: left !important;
    font-size: 32px !important;
    transform: none !important;
  }

  .story__track {
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .story__step {
    position: static !important;
    padding: 0 0 40px 0 !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .story__text {
    max-width: 100% !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  /* Results */

  #results,
  #results.section--story,
  .results,
  .results__sticky,
  .results__stage,
  .results__actions {
    position: static !important;
    min-height: auto !important;
    height: auto !important;
  }

  .results__actions {
    padding-top: 0 !important;
  }

  .results__stage {
    display: flex !important;
    flex-direction: column !important;
  }

  .results__media {
    display: none !important;
  }

  .results__actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .results__cta {
    width: 100% !important;
    max-width: 100% !important;
    gap: 20px !important;
  }

  .results__btn {
    width: 100% !important;
    margin-bottom: 0 !important;
    padding: 18px !important;
  }

  .results__footerband {
    position: static !important;
    justify-content: center !important;
    margin-top: 10vh !important;
    padding-top: 20px !important;
    padding-bottom: 0 !important;
  }

  /* Forced visible states */

  .reveal {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

/* ========================================================================== */
/* LEGAL / EDITORIAL PAGE                                                      */
/* ========================================================================== */

/* Page shell */

.page--legal {
  overflow: auto;
  background: var(--c-bg);
  color: var(--c-text);
}

.page--legal .page__scroller {
  height: auto;
  min-height: 100vh;
  overflow: visible;
  scroll-snap-type: none;
}

.page--legal .section {
  display: block;
  align-items: stretch;
  min-height: auto;
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(56px, 8vw, 96px);
  scroll-snap-align: none;
}

.page--legal .section__inner--editorial {
  padding-left: max(24px, 7vw);
  padding-right: max(24px, 7vw);
}

/* Intro */

.legal__eyebrow {
  margin: 0 0 var(--space-4) 0;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.legal__intro {
  max-width: 65ch;
  margin: 0;
  padding-top: var(--space-2);
  font-size: clamp(1.05rem, 1.5vw, 1.16rem);
  line-height: 1.5;
}

/* Main content */

.legal__content {
  display: grid;
  padding-top: var(--space-3);
  gap: var(--space-5);
}

.legal__block {
  display: grid;
  gap: var(--space-3);
}

/* Headings */

.legal__block h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.legal__block h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.35;
}

/* Text */

.legal__block p,
.legal__block li {
  max-width: 65ch;
  margin: 0;
  color: color-mix(in srgb, var(--c-text) 92%, white);
  font-size: 1.02rem;
  line-height: 1.75;
}

.legal__block ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* FAQ */

.legal__faq {
  display: grid;
  gap: var(--space-4);
}

.legal__faq-item {
  display: grid;
  gap: var(--space-1);
}

/* Footer */

.legal__footer {
  position: static;
  justify-content: flex-start;
  margin-top: var(--space-2);
  padding: var(--space-1) 0 0 0;
  gap: var(--space-2) var(--space-3);
  opacity: 1;
}

/* Links */

.page--legal a {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
}

.page--legal a:hover,
.page--legal a:focus-visible {
  color: var(--c-secondary);
}

.page--legal .results__footerlink {
  text-decoration: none;
}

/* Reveal neutralization */

.page--legal .reveal,
.page--legal .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ========================================================================== */
/* LEGAL PAGE RESPONSIVE                                                       */
/* ========================================================================== */

@media (max-width: 780px) {
  .page--legal .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .page--legal .section__inner--editorial {
    padding-left: 24px;
    padding-right: 24px;
  }

  .legal__content {
    padding-top: var(--space-4);
    gap: var(--space-5);
  }

  .legal__block {
    gap: var(--space-3);
  }

  .legal__block p,
  .legal__block li {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.68;
  }

  .legal__faq {
    gap: var(--space-3);
  }

  .legal__footer {
    justify-content: flex-start;
    margin-top: 0;
    padding-top: var(--space-1);
  }
}