/*
 * Landing "Trova & Vinci" (servita su `/` dall'host root). CSS statico, scritto a mano: non passa da
 * webpack e non fa parte del bundle dell'app, così la landing non carica nulla del gioco.
 *
 * Mobile first, un solo breakpoint a 768px (Figma ARC-19709, nodo 320:2151: artboard 375 e 1440).
 *
 * Tutte le misure sono in rem e valgono `px del Figma / 16`: 1rem = 16px dell'artboard. È il font-size
 * di `html` a scalare l'intera pagina, ed è l'unica manopola:
 *  - mobile: segue la larghezza, 16px a 375px (come il gioco);
 *  - desktop: segue il più piccolo tra larghezza e altezza della finestra, così su un portatile la
 *    hero entra nello schermo e non si vede tutto alla scala "da artboard" di 1440px.
 * I limiti del clamp sono in rem, quindi rispettano la dimensione del testo scelta nel browser.
 *
 * Le sezioni sono a tutta larghezza, il contenuto sta in un container centrato. Gradiente e spalla
 * sinistra arrivano sempre al bordo della finestra.
 */

@font-face {
  font-family: 'Omnes';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src:
    url('/assets/fonts/omnes/Omnes-Medium.woff2') format('woff2'),
    url('/assets/fonts/omnes/Omnes-Medium.woff') format('woff');
}

/* Il Figma chiama "Bold" il peso più pesante disponibile: nel repo è Omnes Black. */
@font-face {
  font-family: 'Omnes';
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src:
    url('/assets/fonts/omnes/Omnes-Black.woff2') format('woff2'),
    url('/assets/fonts/omnes/Omnes-Black.woff') format('woff');
}

:root {
  --font-footer: 'DM Sans', 'Omnes', 'Trebuchet MS', Arial, sans-serif;

  --blue: #304d74;
  --red: #a11512;
  --orange: #ee7f00;
  --ink: #202020;

  /* Larghezza dell'artboard, del container e del testo del regolamento. */
  --canvas: 23.4375rem;
  --wrap: 20.9375rem;
  --rules: 19.6875rem;
  --gutter: 1.25rem;
  --rules-gutter: 2.5rem;

  /* Scala tipografica. */
  --fs-date: 1.3125rem;
  --fs-hero: 1.25rem;
  --fs-title: 1.625rem;
  --fs-small: 1.5rem;
  --fs-big: 2.75rem;
  --fs-rules-title: 1.5rem;
  --fs-body: 0.9375rem;
  --fs-legal: 0.625rem;
  --fs-cookie: 0.75rem;
}

html {
  font-size: clamp(0.75rem, 4.2667vw, 1.1875rem);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: #fff;
  color: var(--blue);
  font-family: 'Omnes', 'Trebuchet MS', Arial, sans-serif;
  font-weight: 500;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: none;
}

p,
h1,
h2,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

strong {
  font-weight: 900;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.d-only {
  display: none;
}

.page {
  position: relative;
  overflow-x: clip;
  background: #fff;
}

/* Tutto ciò che non è la spalla sta sopra di essa. */
.page > :not(.side) {
  position: relative;
  z-index: 1;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.side {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3.5rem;
  background: linear-gradient(to left, rgba(209, 217, 159, 0), #d1d99f);
  pointer-events: none;
}

.side img {
  position: absolute;
  height: auto;
}

/* Il tracciato è l'SVG del Figma, allungato sull'altezza della pagina. */
.side .path {
  left: 8%;
  top: -0.85%;
  width: 41.6%;
  height: 94.3%;
}

.side .m1a { left: 0; top: 11.96%; width: 48%; }
.side .m2a { left: 7%; top: 33.15%; width: 59.5%; }
.side .m1b { left: 18%; top: 49%; width: 48%; }
.side .m2b { left: 7%; top: 62.96%; width: 59.5%; }

.side .x {
  top: auto;
  bottom: 8.0625rem;
  left: 9%;
  width: 53.6%;
}

.date {
  padding-top: 2.125rem;
  font-size: var(--fs-date);
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.8125rem;
}

.logo {
  position: relative;
  flex: none;
  aspect-ratio: 520 / 484;
}

.logo > picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.hero .logo {
  width: 14.375rem;
}

.hero-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.hero-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-list img {
  flex: none;
  width: 1.75rem;
  height: auto;
}

.hero-list span {
  max-width: 15.625rem;
  font-size: var(--fs-hero);
  line-height: 1.15;
  font-weight: 900;
}

.stores {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.125rem;
  margin-top: 2.4375rem;
}

.stores h2 {
  font-size: var(--fs-title);
  line-height: 1.27;
  font-weight: 900;
  text-align: center;
}

.stores h2 .red {
  color: var(--red);
}

.stores .store-logo {
  width: 10.625rem;
  height: auto;
}

.stores .strip {
  display: block;
  width: 100%;
}

.stores .strip img {
  width: 100%;
  height: auto;
}

.heading {
  position: relative;
  z-index: 2;
  text-align: center;
  line-height: 0.905;
  font-weight: 900;
}

.heading span {
  display: block;
}

.heading .small,
.heading .da {
  font-size: var(--fs-small);
}

.heading .small {
  color: var(--red);
}

.heading .big {
  margin-top: 0.5rem;
  font-size: var(--fs-big);
}

.heading .da {
  margin-top: 0.5rem;
}

/* Visual con le proporzioni del Figma; gli elementi stanno in percentuale. */
.visual {
  position: relative;
  width: 100%;
  max-width: var(--canvas);
  margin-inline: auto;
  margin-top: 0.5rem;
}

.visual .bg {
  position: absolute;
  inset: 0;
  display: block;
}

.visual .bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual .logo {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: var(--lw);
}

.buoni {
  margin-top: 2.875rem;
}

.buoni .visual {
  aspect-ratio: 375 / 248.137;
  --lx: 74.4%;
  --ly: 65.1%;
  --lw: 21.3%;
}

/* L'immagine sporge di un soffio a destra, come nel Figma. */
.buoni .visual .bg {
  inset: 0 auto 0 1.87%;
  width: 103.7%;
}

.super {
  margin-top: 2.5rem;
}

.super .visual {
  aspect-ratio: 375 / 238;
  --lx: 74.4%;
  --ly: 63.5%;
  --lw: 21.3%;
}

.super .cart {
  position: absolute;
  left: 11.2%;
  top: -1.65%;
  width: 77.3%;
  aspect-ratio: 290 / 241;
}

/*
 * Ancorato in basso e senza ritaglio. Il Figma mobile ritaglia 15px in alto, ma è tarato sul
 * carrello precedente: con quello nuovo il manico arriva al bordo e verrebbe tagliato.
 */
.super .cart img {
  position: absolute;
  left: 0;
  inset-block: auto 0;
  width: 100.09%;
  height: auto;
}

.desc {
  margin-top: 2.375rem;
}

.rules {
  width: min(100% - 2 * var(--rules-gutter), var(--rules));
  margin-inline: auto;
  font-size: var(--fs-body);
  line-height: 1.4;
}

.rules h2 {
  color: var(--orange);
  font-size: var(--fs-rules-title);
  line-height: 1.5;
  font-weight: 900;
}

.legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  margin-top: 4.8125rem;
}

.legal p {
  width: min(100% - 2 * var(--gutter), 80.3125rem);
  font-size: var(--fs-legal);
  text-align: center;
}

.legal a {
  color: inherit;
  text-decoration: underline;
}

.cookie {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.125rem;
  background: #fff;
}

.cookie a {
  color: var(--ink);
  font-family: var(--font-footer);
  font-size: var(--fs-cookie);
  font-weight: 600;
  font-variation-settings: 'opsz' 14;
  text-decoration: underline;
  text-underline-position: from-font;
}

@media (min-width: 768px) {
  :root {
    --canvas: 90rem;
    --wrap: 76.4375rem;
    --rules: 69.75rem;
    --gutter: 1.5rem;
    --rules-gutter: 9rem;

    --fs-date: 3.8125rem;
    --fs-hero: 3.375rem;
    --fs-title: 3.8125rem;
    --fs-small: 3.8125rem;
    --fs-big: 9.76rem;
    --fs-rules-title: 4rem;
    --fs-body: 2.5rem;
    --fs-legal: 1rem;
    --fs-cookie: 1.125rem;
  }

  /*
   * Il più piccolo tra larghezza e altezza: 9px come minimo (a 768px il layout deve ancora
   * entrare), 12px come massimo, cioè 0,75 della scala dell'artboard. Su un MacBook Air da 13"
   * (viewport 1440x~750) viene circa 12px, a 1280x650 circa 11.
   */
  html {
    font-size: clamp(0.5625rem, min(0.9vw, 1.75vh), 0.75rem);
  }

  .d-only {
    display: initial;
  }

  .m-only {
    display: none;
  }

  .side {
    width: 13.3125rem;
  }

  .side .path { left: 9.9%; top: -1.7%; width: 44.5%; height: 94.6%; }
  .side .m1a { left: -0.5%; top: 11.97%; width: 39.9%; }
  .side .m2a { left: 12.7%; top: 38.06%; width: 48.8%; }
  .side .m1b { left: -2.8%; top: 58.79%; width: 39.9%; }
  .side .m2b { left: 23%; top: 77.49%; width: 48.8%; }
  .side .x { bottom: 14.25rem; left: 13.6%; width: 58.2%; }

  .date {
    padding-top: 3.125rem;
    line-height: normal;
  }

  .hero {
    flex-direction: row;
    justify-content: center;
    gap: 2.4375rem;
    margin-top: 4.0625rem;
  }

  .hero .logo {
    width: 32.5rem;
  }

  .hero-list {
    gap: 1.875rem;
  }

  .hero-list li {
    align-items: flex-start;
    gap: 1.375rem;
  }

  .hero-list img {
    width: 3.8125rem;
    margin-top: 0.25rem;
  }

  .hero-list span {
    max-width: none;
    line-height: 1.17;
    white-space: nowrap;
  }

  .stores {
    gap: 2.625rem;
    margin-top: 3.8125rem;
  }

  .stores h2 {
    line-height: 1.246;
  }

  .stores .store-logo {
    width: 20.375rem;
  }

  .heading .big,
  .heading .da {
    margin-top: 0;
  }

  .buoni {
    margin-top: 5.0625rem;
  }

  /* L'immagine parte a metà del titolo, che le resta sopra. */
  .buoni .visual {
    aspect-ratio: 1440 / 953;
    margin-top: -6.4375rem;
    --lx: 75.1%;
    --ly: 59.9%;
    --lw: 18.1%;
  }

  .super {
    margin-top: 2rem;
  }

  .super .visual {
    aspect-ratio: 1440 / 937;
    margin-top: -7.1875rem;
    --lx: 75.1%;
    --ly: 53.1%;
    --lw: 18.1%;
  }

  .super .cart {
    left: 7.78%;
    top: 0;
    width: 73.54%;
    height: 100%;
    aspect-ratio: auto;
  }

  .super .cart img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .desc {
    margin-top: 7.375rem;
  }

  .rules h2 {
    line-height: 1.4;
  }

  .legal {
    gap: 1.125rem;
    margin-top: 7.125rem;
  }

  /* Su desktop il testo legale è in DM Sans come il link; su mobile resta Omnes (Figma). */
  .legal p {
    font-family: var(--font-footer);
    font-weight: 600;
    font-variation-settings: 'opsz' 14;
  }
}
