/* ==========================================================================
   Gar.Meats — Link in bio
   Layout: struttura e spaziature di campanapet.it/link.
   Stile:  design system di garmeats.it — stessi colori, font (Bourbon + Inter),
           bottoni squadrati, eyebrow gialli, grana e cursore personalizzato.

    1. Font
    2. Design token (da garmeats.it)
    3. Reset & base
    4. Layout pagina
    5. Sfondo: foto, velatura, grana
    6. Brand: logo + payoff
    7. Bottoni (CTA)
    8. Contatti
    9. Footer
   10. Cursore personalizzato (desktop)
   11. Animazioni d'ingresso
   12. Accessibilità: movimento ridotto

   Performance: le animazioni muovono solo `transform` e `opacity`
   (composite su GPU → 60fps). Nessun `filter` animato.
   ========================================================================== */

/* 1. Font ------------------------------------------------------------------ */

/* Bourbon — il font dei titoli di garmeats.it (file del sito convertito in WOFF2).
   Contiene solo lettere, numeri e , - . : il resto lo copre Oswald qui sotto. */
@font-face {
  font-family: "Bourbon";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/bourbon.woff2") format("woff2");
}

/* Oswald ridotto ai soli caratteri che mancano a Bourbon (apostrofi, accentate…),
   come fa il sito con lo stack 'Bourbon', 'Oswald'. Licenza: fonts/OFL-Oswald.txt */
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/oswald-subset.woff2") format("woff2");
}

/* Inter variabile — testi. Licenza: fonts/OFL-Inter.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Design token (valori identici a garmeats.it) ---------------------------- */

:root {
  /* Fondi */
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --bg-footer: #050505;
  --border: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.14);

  /* Brand (dal catalogo) */
  --yellow: #f4b63b; /* giallo senape del brand */
  --yellow-2: #e8a620;
  --yellow-dim: rgb(244 182 59 / 0.15);

  /* Testo */
  --text: #fafafa;
  --text-soft: #d4d4d4;
  --text-muted: #a3a3a3;

  --font-display: "Bourbon", "Oswald", Impact, "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* partenza decisa, atterraggio morbido */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --reveal-delay: 0.08s; /* attesa prima del primo elemento */
  --reveal-stagger: 0.1s; /* ritardo tra un elemento e il successivo */
}

/* 3. Reset & base ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none; /* niente grassetti "finti" su Bourbon, come sul sito */
  -webkit-tap-highlight-color: transparent;
}

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

img {
  height: auto;
}

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

ul {
  list-style: none;
}

address {
  font-style: normal;
}

h1,
h2 {
  font-size: inherit;
  font-weight: inherit;
}

::selection {
  background-color: var(--yellow);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

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

/* 4. Layout pagina ----------------------------------------------------------- */

.page {
  position: relative;
  isolation: isolate; /* lo sfondo (z-index: -1) resta sopra il fondo pagina e sotto i contenuti */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
}

.main {
  flex: 1;
}

/* Colonna centrale a tutta altezza, contenuto centrato in verticale */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 80rem;
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding-block: 4rem;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
  text-align: center;
}

@media (min-width: 40rem) {
  .hero {
    padding-block: 6rem;
    padding-inline: max(2rem, env(safe-area-inset-left)) max(2rem, env(safe-area-inset-right));
  }
}

/* 5. Sfondo: foto, velatura, grana ------------------------------------------- */

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Foto hero del sito: entra dal nero con uno zoom lento (come lo slider di garmeats.it) */
.backdrop__photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  object-fit: cover;
  object-position: 50% 30%;
  transform-origin: 50% 30%;
  animation: photo-in 9s var(--ease-out) both;
}

/* Velatura: tiene leggibili logo e testi e sfuma la foto nel nero */
.backdrop__shade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background:
    radial-gradient(ellipse 85% 65% at 50% 38%, rgb(10 10 10 / 0.2) 0%, rgb(10 10 10 / 0.65) 100%),
    linear-gradient(180deg, rgb(10 10 10 / 0.3) 0%, rgb(10 10 10 / 0.55) 40%, rgb(10 10 10 / 0.9) 75%, var(--bg) 100%);
}

/* Grana "pellicola" del sito (stesso rumore SVG, stessa opacità) */
.backdrop__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: scale(1.12);
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 6. Brand: logo + payoff ---------------------------------------------------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand__logo {
  width: min(74vw, 18rem);
}

.brand__logo img {
  width: 100%;
}

/* Come i titoli di garmeats.it: Bourbon maiuscolo, interlinea stretta, 2ª riga gialla */
.payoff {
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 12.2vw, 3.5rem);
  line-height: 0.92;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--text);
}

/* Ogni riga è una "maschera": il testo sale da sotto (animazione hero del sito).
   Il padding evita di tagliare la virgola, il margine negativo lo compensa. */
.payoff__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.payoff__line > span {
  display: inline-block;
}

.payoff__line--accent {
  color: var(--yellow);
}

@media (min-width: 40rem) {
  .brand__logo {
    width: 24rem;
  }

  .payoff {
    margin-top: 2.25rem;
    font-size: 4.5rem;
  }
}

@media (min-width: 64rem) {
  .brand__logo {
    width: 28rem;
  }

  .payoff {
    font-size: 5rem;
  }
}

/* 7. Bottoni (CTA) -------------------------------------------------------------
   Stile .btn di garmeats.it: squadrati, Bourbon maiuscolo spaziato, freccia che
   scorre all'hover, sollevamento di 2px.
   .cta            link
   ├ .cta__halo    bagliore giallo dietro al bottone: appare all'hover
   └ .cta__box     il bottone: cambio colore 0.3s, scale(0.96) al click
     ├ .cta__shine riflesso di luce (una volta, dopo l'ingresso)
     └ etichetta + freccia
   ---------------------------------------------------------------------------- */

.links {
  width: 100%;
  max-width: 24rem;
  margin-top: 2.5rem;
}

@media (min-width: 40rem) {
  .links {
    margin-top: 3rem;
  }
}

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

.cta {
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.cta__halo {
  position: absolute;
  inset: -35% -6%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(244 182 59 / 0.4), transparent);
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
  pointer-events: none;
}

.cta__box {
  position: relative;
  isolation: isolate; /* ritaglia il riflesso anche su Safari */
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  overflow: hidden;
  border: 1.5px solid transparent;
  padding: 1.375rem 1.75rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.2;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition:
    transform 0.3s var(--ease-out),
    background-color 0.3s ease-in-out,
    border-color 0.3s ease-in-out,
    color 0.3s ease-in-out;
}

@media (min-width: 40rem) {
  .cta__box {
    padding: 1.5rem 2.25rem;
    font-size: 1.25rem;
  }
}

.cta__arrow {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s var(--ease-out);
}

/* Primario — giallo pieno, testo nero (come "Il nostro metodo" sul sito) */
.cta--primary .cta__box {
  border-color: var(--yellow);
  background-color: var(--yellow);
  color: var(--bg);
}

/* Secondario — contorno sottile, testo bianco (come "Linee Slovera & Croasa") */
.cta--outline .cta__box {
  border-color: var(--border-strong);
  background-color: transparent;
  color: var(--text);
}

/* Riflesso di luce: attraversa il bottone giallo una volta, dopo l'ingresso */
.cta__shine {
  position: absolute;
  inset-block: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.55), transparent);
  transform: translateX(0) skewX(-18deg);
  pointer-events: none;
  animation: shine 1.2s var(--ease-out) calc(var(--reveal-delay) + var(--i, 0) * var(--reveal-stagger) + 0.7s)
    backwards;
}

.cta__label {
  position: relative;
}

/* Hover: solo su dispositivi con puntatore (su touch l'hover resterebbe "incollato") */
@media (hover: hover) {
  .cta:hover .cta__box {
    transform: translateY(-2px);
  }

  .cta:hover .cta__arrow {
    transform: translateX(6px);
  }

  .cta:hover .cta__halo {
    opacity: 1;
    transform: none;
  }

  /* giallo → bianco, come sul sito */
  .cta--primary:hover .cta__box {
    border-color: var(--text);
    background-color: var(--text);
  }

  /* contorno → giallo pieno, come sul sito */
  .cta--outline:hover .cta__box {
    border-color: var(--yellow);
    background-color: var(--yellow);
    color: var(--bg);
  }
}

/* Da tastiera: stesso bagliore dell'hover */
.cta:focus-visible .cta__halo {
  opacity: 1;
  transform: none;
}

/* Feedback tattile al click/tap (dopo l'hover, così vince sempre) */
.cta:active .cta__box {
  transform: scale(0.96);
  transition-duration: 0.12s;
}

@keyframes shine {
  from {
    transform: translateX(0) skewX(-18deg);
  }
  to {
    transform: translateX(400%) skewX(-18deg);
  }
}

/* 8. Contatti ---------------------------------------------------------------- */

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

@media (min-width: 40rem) {
  .contacts {
    margin-top: 3rem;
  }
}

/* Eyebrow del sito: Bourbon giallo spaziato con filetto (qui su entrambi i lati) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  line-height: 1;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--yellow);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--yellow);
}

.eyebrow::after {
  margin-left: -3px; /* compensa la spaziatura dopo l'ultima lettera */
}

/* Mobile: impilati e centrati. Da 640px: su una riga */
.contacts__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

@media (min-width: 40rem) {
  .contacts__list {
    flex-flow: row wrap;
    justify-content: center;
  }
}

/* Come i contatti della top bar e i quadrati social del sito */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px; /* area di tocco comoda */
  border: 1px solid var(--border-strong);
  background-color: rgb(255 255 255 / 0.02);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
  touch-action: manipulation;
  transition:
    transform 0.3s var(--ease-out),
    background-color 0.3s ease-in-out,
    border-color 0.3s ease-in-out,
    color 0.3s ease-in-out;
}

.chip__icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--yellow);
  transition: color 0.3s ease-in-out;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--yellow);
    background-color: var(--yellow);
    color: var(--bg);
    transform: translateY(-3px);
  }

  .chip:hover .chip__icon {
    color: var(--bg);
  }
}

.chip:active {
  transform: scale(0.96);
  transition-duration: 0.12s;
}

/* 9. Footer ------------------------------------------------------------------- */

.footer {
  position: relative;
  border-top: 1px solid var(--border);
  background-color: var(--bg-footer);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 80rem;
  margin-inline: auto;
  padding: 2.5rem 1.25rem calc(2.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 40rem) {
  .footer__inner {
    padding-inline: 2rem;
  }
}

.footer__brand {
  transition: opacity 0.3s var(--ease-out);
}

.footer__logo {
  width: auto;
  height: 1.75rem;
}

.footer__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted);
  text-align: center;
}

/* Pallino giallo: il separatore del sito (marquee, "GAR • MEATS") */
.footer__sep {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
}

@media (min-width: 40rem) {
  .footer__meta {
    flex-direction: row;
    gap: 0.75rem;
  }

  .footer__sep {
    display: block;
  }
}

.footer__link {
  font-weight: 600;
  color: var(--text);
  transition: color 0.25s var(--ease-out);
}

@media (hover: hover) {
  .footer__brand:hover {
    opacity: 0.82;
  }

  .footer__link:hover {
    color: var(--yellow);
  }
}

/* 10. Cursore personalizzato (desktop) -------------------------------------------
   Lo crea main.js solo con mouse e schermo > 860px, come su garmeats.it.
   Senza JavaScript resta il cursore normale.
   ---------------------------------------------------------------------------- */

.has-cursor,
.has-cursor a,
.has-cursor button {
  cursor: none;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: difference;
  transition: opacity 0.2s;
}

/* Posizione: proprietà `translate` (da JS). Hover: proprietà `scale` / dimensioni (da CSS). */
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #fff;
  transition:
    scale 0.15s var(--ease-out),
    opacity 0.2s;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid rgb(255 255 255 / 0.45);
  transition:
    width 0.3s var(--ease-out),
    height 0.3s var(--ease-out),
    margin 0.3s var(--ease-out),
    border-color 0.3s,
    opacity 0.2s;
}

.cursor-dot.is-hover {
  scale: 0;
}

.cursor-ring.is-hover {
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border-color: var(--yellow);
}

.cursor-dot.is-hidden,
.cursor-ring.is-hidden {
  opacity: 0;
}

/* 11. Animazioni d'ingresso ------------------------------------------------------
   Cascata: logo → payoff (riga 1, riga 2) → bottone 1 → bottone 2 → contatti.
   Ogni elemento ha `--i` (0, 1, 2…) nell'HTML: ritardo = 0.08s + i × 0.1s.
   ---------------------------------------------------------------------------- */

/* Fade-in-up */
.reveal {
  animation: reveal-up 0.8s var(--ease-out) both;
  animation-delay: calc(var(--reveal-delay) + var(--i, 0) * var(--reveal-stagger));
}

/* Payoff: ogni riga sale dalla sua maschera (come il titolo hero del sito) */
.payoff__line > span {
  animation: line-up 1s var(--ease-out) both;
  animation-delay: calc(var(--reveal-delay) + var(--i, 0) * var(--reveal-stagger));
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes line-up {
  from {
    opacity: 0;
    transform: translate3d(0, 110%, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 12. Accessibilità: movimento ridotto -------------------------------------------
   Restano solo le dissolvenze e il feedback al tocco: niente zoom, scorrimenti
   o sollevamenti.
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .payoff__line > span {
    animation-name: fade-in;
    animation-duration: 0.5s;
  }

  .backdrop__photo {
    animation-name: fade-in;
    animation-duration: 0.8s;
  }

  .cta__shine {
    display: none;
  }

  .cta:hover .cta__box,
  .cta:hover .cta__arrow,
  .chip:hover {
    transform: none;
  }

  .cta:active .cta__box,
  .chip:active {
    transform: scale(0.96);
  }
}
