/* La Piada della Rò · landing di lancio
   Palette e font da identity.txt */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-900.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --nero: #0b0b0b;
  --bianco: #ffffff;
  --crema: #fef3dc;      /* giallo sfondo */
  --giallo: #ddc94a;     /* arancio bandana */
  --rosa: #e6bcbf;       /* rosso labbra */

  --font-titoli: "Fraunces", Georgia, "Times New Roman", serif;
  --font-testi: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --durata: 1100ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--nero);
  color: var(--crema);
  font-family: var(--font-testi);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- Struttura pagina: nastro + slideshow + fascia apertura + striscia indirizzo ---------- */
.stage {
  display: grid;
  grid-template-rows: auto minmax(min(46vh, 520px), 1fr) auto auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Slideshow ---------- */
.slideshow {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.slides { position: absolute; inset: 0; }

.slide {
  --bg: var(--giallo);
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 8vh, 4.5rem);
  background: var(--bg);
  background-image: radial-gradient(110% 85% at 50% 38%,
    color-mix(in srgb, var(--bg) 78%, #fff) 0%, var(--bg) 68%);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--durata) var(--ease), visibility 0s linear var(--durata);
}
.slide--giallo { --bg: var(--giallo); }
.slide--crema  { --bg: var(--crema); }
.slide--bianco { --bg: var(--bianco); }

/* grana di carta, molto leggera */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--durata) var(--ease), visibility 0s;
  z-index: 1;
}

.slide__img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transform: translateY(18px) scale(.94);
  transition: opacity .9s var(--ease) .15s, transform 1.2s var(--ease) .15s;
  filter: drop-shadow(0 18px 26px rgba(40, 28, 0, .16));
}
.slide.is-active .slide__img {
  opacity: 1;
  transform: none;
  animation: respiro 9s ease-in-out 1.4s infinite alternate;
}

.slide__img--tondo    { max-width: min(88vw, 760px); max-height: 100%; }
.slide__img--scudetto { max-width: min(90vw, 980px); max-height: 100%; }

/* JPG con sfondo bianco: lo fondo con lo sfondo della slide, senza ombra rettangolare.
   Da rimuovere quando avremo il PNG trasparente di "senza scritta". */
.slide--bianco .slide__img { mix-blend-mode: multiply; filter: none; }

@keyframes respiro {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.025) translateY(-5px); }
}

/* ---------- Puntini di navigazione ---------- */
.dots {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(.9rem, 3vh, 1.5rem);
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: .25rem;
}

.dot {
  position: relative;
  width: 2.75rem;          /* area di tocco comoda */
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dot::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: .6rem; height: .6rem;
  border-radius: 999px;
  background: var(--nero);
  opacity: .28;
  transform: translate(-50%, -50%);
  transition: width .45s var(--ease), opacity .3s;
}
.dot:hover::before { opacity: .6; }
.dot.is-active::before { width: 1.9rem; opacity: .9; }
.dot:focus-visible { outline: 3px solid var(--nero); outline-offset: -4px; border-radius: 8px; }

/* ---------- Striscia indirizzo ---------- */
.address {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.75rem, 2.5vw, 1.25rem);
  padding: clamp(.9rem, 2.4vh, 1.4rem) clamp(1rem, 4vw, 2rem);
  padding-bottom: calc(clamp(.9rem, 2.4vh, 1.4rem) + env(safe-area-inset-bottom));
  background: var(--nero);
  color: var(--crema);
  border-top: 4px solid var(--rosa);
  text-align: left;
}

.address__pin { flex: none; color: var(--giallo); }

.address__text { display: grid; gap: .15rem; }

.address__label {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--giallo);
}

.address__street {
  font-family: var(--font-titoli);
  font-style: normal;
  font-weight: 900;
  font-size: clamp(1.15rem, 3.8vw, 2rem);
  line-height: 1.15;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.address__br { display: none; }
.address__link { color: inherit; text-decoration: none; }
.address__link:hover, .address__link:focus-visible { color: var(--giallo); }

@media (max-width: 520px) {
  .address__sep { display: none; }
  .address__br  { display: inline; }
}

/* ---------- Link legali nella striscia indirizzo (niente stili in linea: CSP style-src 'self') ---------- */
.address__legal {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: .85rem;
  font-weight: 700;
}
.address__legal a { color: var(--giallo); text-decoration: none; }
.address__legal a:hover, .address__legal a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) {
  .address { flex-wrap: wrap; }
  .address__legal { margin-left: 0; width: 100%; justify-content: center; }
}

/* ---------- Apertura pop anni 90: nastro, adesivi e bottone arcade (solo CSS, palette del marchio) ---------- */
.ticker {
  position: relative;
  z-index: 5;
  overflow: hidden;
  background: var(--nero);
  color: var(--giallo);
  border-bottom: 3px solid var(--giallo);
  font-weight: 800;
  font-size: clamp(.82rem, 2.6vw, .95rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker__track {
  display: inline-flex;
  padding: .6rem 0;
  animation: ticker-scroll 52s linear infinite;
}
.ticker__group { flex: none; display: inline-flex; align-items: center; }
.ticker__item { padding: 0 clamp(1.4rem, 4vw, 2.6rem); }
.ticker__sep { color: var(--rosa); font-size: 1.15em; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.sticker {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: var(--nero);
  border: 3px solid var(--nero);
  box-shadow: 5px 5px 0 var(--nero);
  font-weight: 800;
  line-height: 1.1;
  pointer-events: none;
}
.sticker--date {
  top: clamp(.8rem, 3vh, 1.6rem);
  left: clamp(.6rem, 3vw, 2rem);
  max-width: 46%;
  padding: .55rem .8rem .6rem;
  border-radius: 14px;
  background: var(--giallo);
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: clamp(1.05rem, 4vw, 1.7rem);
  transform: rotate(-7deg);
  animation: sticker-in .7s cubic-bezier(.34, 1.56, .64, 1) .2s both;
}
.sticker__small {
  display: block;
  font-family: var(--font-testi);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sticker--count {
  right: clamp(.6rem, 3vw, 2rem);
  bottom: clamp(3.2rem, 9vh, 4.6rem);
  max-width: 46%;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--rosa);
  font-size: clamp(.9rem, 3vw, 1.1rem);
  transform: rotate(5deg);
  animation: sticker-in .7s cubic-bezier(.34, 1.56, .64, 1) .4s both;
}
@keyframes sticker-in {
  from { opacity: 0; transform: scale(.4) rotate(-18deg); }
}

.launch-band {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: .7rem;
  padding: clamp(1.3rem, 4vh, 2rem) clamp(1rem, 5vw, 2rem) clamp(1.5rem, 4vh, 2.2rem);
  background: var(--crema);
  color: var(--nero);
  border-top: 3px solid var(--nero);
  text-align: center;
}
.launch-band__kicker {
  margin: 0;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--nero);
  color: var(--giallo);
  font-size: clamp(.84rem, 2.6vw, .92rem);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.launch-band__title {
  margin: 0;
  max-width: 24ch;
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: clamp(1.55rem, 5.4vw, 2.6rem);
  line-height: 1.08;
}
.launch-band__text {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(1rem, 3.2vw, 1.1rem);
  font-weight: 600;
  line-height: 1.5;
}
.arcade-btn {
  display: inline-grid;
  justify-items: center;
  gap: .15rem;
  margin-top: .4rem;
  padding: .85rem 1.6rem .9rem;
  border: 3px solid var(--nero);
  border-radius: 16px;
  background: var(--giallo);
  color: var(--nero);
  text-decoration: none;
  box-shadow: 6px 6px 0 var(--nero);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.arcade-btn__label {
  font-family: var(--font-titoli);
  font-weight: 900;
  font-size: clamp(1.25rem, 4.4vw, 1.6rem);
  line-height: 1.1;
}
.arcade-btn__sub { font-weight: 800; font-size: .95rem; }
.arcade-btn:hover { background: #e6d35c; transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--nero); }
.arcade-btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--nero); }
.arcade-btn:focus-visible { outline: 3px solid var(--nero); outline-offset: 4px; }
.nowrap { white-space: nowrap; }

/* Telefoni: il conto alla rovescia sale in alto a destra, così non copre mai la scritta del logo */
@media (max-width: 700px) {
  .sticker--date { max-width: 44%; }
  .sticker--count { top: clamp(.8rem, 3vh, 1.6rem); bottom: auto; max-width: 40%; }
}

/* ---------- Preferenze utente ---------- */
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.is-active { transition: none; }
  .slide__img, .slide.is-active .slide__img { transition: none; animation: none; transform: none; opacity: 1; }
  .dot::before { transition: none; }
  .ticker__track { animation: none; }
  .sticker { animation: none; }
  .arcade-btn { transition: none; }
}

/* telefoni in orizzontale: meno altezza, immagini più piccole */
@media (max-height: 460px) {
  .stage { grid-template-rows: auto minmax(300px, 1fr) auto auto; }
  .slide { padding-bottom: 2.6rem; }
  .address__label { display: none; }
}

/* ---------- Blocco 3H: tipografia, «Lavora con noi», controllo campi e banner cookie ---------- */
h1, h2, h3, p, li { text-wrap: pretty; }
.launch-band__title { text-wrap: balance; }

.jobs-btn, .address__linkbtn {
  font: inherit;
  cursor: pointer;
}
.jobs-btn {
  margin-top: .3rem;
  padding: .55rem 1.2rem;
  border: 2px solid var(--nero);
  border-radius: 999px;
  background: transparent;
  color: var(--nero);
  font-weight: 800;
  font-size: .98rem;
  transition: background-color .15s ease, transform .12s ease;
}
.jobs-btn:hover { background: var(--rosa); }
.jobs-btn:active { transform: translateY(2px); }
.jobs-btn:focus-visible { outline: 3px solid var(--nero); outline-offset: 3px; }
.address__legal { flex-wrap: wrap; justify-content: flex-end; }
.address__linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--giallo);
  font-weight: 700;
  font-size: .85rem;
}
.address__linkbtn:hover, .address__linkbtn:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* Finestra «Lavora con noi» */
html.has-dialog { overflow: hidden; }
.jobs-dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-height: min(92vh, 92dvh);
  padding: 0;
  border: 3px solid var(--nero);
  border-radius: 20px;
  background: var(--crema);
  color: var(--nero);
  box-shadow: 8px 8px 0 var(--nero);
  overflow: hidden;
}
.jobs-dialog[open] { display: flex; animation: sticker-in .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.jobs-dialog::backdrop { background: rgba(11, 11, 11, .6); }
.jobs-form { display: flex; flex-direction: column; width: 100%; max-height: min(92vh, 92dvh); }
.jobs-head {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: 1rem 1.2rem .6rem;
}
.jobs-title { margin: 0; font-family: var(--font-titoli); font-weight: 900; font-size: clamp(1.5rem, 5vw, 1.9rem); }
.jobs-close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 2px solid var(--nero); border-radius: 50%; background: var(--bianco); color: var(--nero); cursor: pointer;
}
.jobs-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: .95rem; padding: .2rem 1.2rem 1rem;
}
.jobs-sub { margin: 0; font-weight: 600; }
.jfield { display: flex; flex-direction: column; gap: .35rem; min-width: 0; border-radius: 12px; }
.jlabel { font-weight: 800; font-size: .96rem; }
.jinput {
  width: 100%; min-height: 48px; padding: .7rem .85rem;
  border: 2px solid var(--nero); border-radius: 12px; background: var(--bianco); color: var(--nero);
  font: inherit; font-size: max(1rem, 16px);
}
.jinput:focus { outline: none; box-shadow: 0 0 0 4px rgba(221, 201, 74, .55); }
.jarea { min-height: 96px; resize: vertical; margin-top: .4rem; }
.jcontact, .jtwo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .6rem .9rem; border-radius: 12px; }
.jcontact > .jhint, .jcontact > .jerror { grid-column: 1 / -1; }
.jhint { font-size: .9rem; font-weight: 600; color: #4a443d; }
.jhint a { color: var(--nero); }
.jchips { display: flex; flex-wrap: wrap; gap: .5rem; }
.jchip {
  min-height: 42px; padding: .4rem .9rem; border: 2px solid var(--nero); border-radius: 999px;
  background: var(--bianco); color: var(--nero); font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
}
.jchip[aria-pressed="true"] { background: var(--nero); color: var(--crema); }
.jfile {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 64px; padding: .8rem 1rem;
  border: 2px dashed var(--nero); border-radius: 12px; background: var(--bianco); font-weight: 800; text-align: center; cursor: pointer;
}
.jfile input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.jfile:focus-within { outline: 3px solid var(--nero); outline-offset: 2px; }
.has-file .jfile { border-style: solid; background: #f7efc4; }
.jhp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.jmsg { margin: 0; min-height: 1.2em; color: #d92d20; font-weight: 800; }
.jobs-foot { flex: none; display: flex; justify-content: center; padding: .9rem 1.2rem 1.2rem; border-top: 2px solid var(--nero); background: var(--crema); }
.jobs-submit { margin-top: 0; border-width: 3px; font: inherit; cursor: pointer; }
.jobs-submit:disabled { opacity: .6; cursor: wait; }
.is-hidden { display: none !important; }

/* Blocco CV oppure esperienza */
.jchoice {
  display: flex; flex-direction: column; gap: .75rem;
  padding: .95rem 1rem; border: 2px solid var(--nero); border-radius: 16px; background: #fff9ec;
}
.jchoice__head { margin: 0; font-weight: 800; font-size: .96rem; line-height: 1.4; color: var(--nero); }
.jdivider {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin: .1rem 0; font-size: .84rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #4a443d;
}
.jdivider::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(11, 11, 11, .18); }
.jdivider span { position: relative; padding: .15rem .75rem; border-radius: 999px; background: var(--giallo); color: var(--nero); border: 2px solid var(--nero); }

/* Schermata di conferma candidatura */
.jobs-dialog.is-done .jobs-head { justify-content: flex-end; padding-bottom: 0; }
.jobs-dialog.is-done .jobs-title { display: none; }
.jobs-dialog.is-done .jobs-foot { border-top: 0; padding-top: .2rem; padding-bottom: 1.4rem; }
.jdone {
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  padding: .5rem .6rem 1rem; text-align: center;
}
.jdone__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--giallo); color: var(--nero);
  border: 3px solid var(--nero); box-shadow: 4px 4px 0 var(--nero);
}
.jdone__title { margin: .25rem 0 0; font-family: var(--font-titoli); font-weight: 900; font-size: clamp(1.6rem, 5.5vw, 2rem); line-height: 1.1; }
.jdone__text { margin: 0; max-width: 34ch; font-size: 1.04rem; font-weight: 700; line-height: 1.5; }
.jdone__sub { margin: .15rem 0 0; max-width: 36ch; font-size: .92rem; font-weight: 600; color: #4a443d; line-height: 1.45; }

/* Campo obbligatorio mancante: scossa, alone rosso corallo che pulsa, messaggio sotto */
.is-invalid { animation: jshake .5s cubic-bezier(.36, .07, .19, .97) both; }
.is-invalid .jinput, .is-invalid .jfile, .jcontact.is-invalid .jinput {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, .28);
  animation: jglow 1.1s ease-out 2;
}
.is-invalid > .jchips .jchip { border-color: #d92d20; }
.jerror { display: block; color: #d92d20; font-weight: 800; font-size: .95rem; }
@keyframes jshake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
@keyframes jglow {
  0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .6); }
  70% { box-shadow: 0 0 0 12px rgba(217, 45, 32, 0); }
  100% { box-shadow: 0 0 0 3px rgba(217, 45, 32, .28); }
}

/* Banner cookie */
.cmp-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(11, 11, 11, .55);
  animation: cmp-fade .3s ease both;
  cursor: pointer;
}
.cmp-banner {
  position: fixed; z-index: 91; left: 1rem; bottom: 1rem;
  width: min(440px, calc(100vw - 2rem));
  padding: 1.2rem 1.25rem 1.1rem;
  border: 3px solid var(--nero); border-radius: 18px;
  background: var(--crema); color: var(--nero);
  box-shadow: 7px 7px 0 var(--nero);
  animation: cmp-up .45s cubic-bezier(.16, 1, .3, 1) both;
}
.cmp-title { margin: 0 0 .5rem; font-family: var(--font-titoli); font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.cmp-text { margin: 0 0 .6rem; font-size: .98rem; font-weight: 600; line-height: 1.5; }
.cmp-links { margin: 0 0 .9rem; font-size: .9rem; font-weight: 700; }
.cmp-links a { color: var(--nero); }
.cmp-actions { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
.cmp-accept {
  min-height: 50px; border: 3px solid var(--nero); border-radius: 14px; background: var(--giallo); color: var(--nero);
  font: inherit; font-weight: 900; font-size: 1.05rem; box-shadow: 4px 4px 0 var(--nero); cursor: pointer;
}
.cmp-accept:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--nero); }
.cmp-reject {
  align-self: center; padding: .4rem; border: 0; background: none; color: #4a443d;
  font: inherit; font-weight: 700; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cmp-banner.is-leaving, .cmp-overlay.is-leaving { opacity: 0; transition: opacity .3s ease; }
@keyframes cmp-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes cmp-fade { from { opacity: 0; } }
@media (max-width: 520px) {
  .cmp-banner { left: .6rem; right: .6rem; bottom: .6rem; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .jobs-dialog[open], .cmp-banner, .cmp-overlay, .is-invalid, .is-invalid .jinput { animation: none; }
}
