.section {
  position: relative;
  padding: var(--sp-7) var(--pad-x);
}

[data-splitting] .word {
  display: inline-block;
}

@media (max-width: 899px) {
  .section {
    padding-block: var(--sp-6);
  }
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 7rem var(--pad-x) var(--sp-4);
  overflow: clip;
  isolation: isolate;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  /* livello proprio: il titolo animato sopra non fa ridisegnare la foto */
  transform: translateZ(0);
  will-change: transform;
}

.hero--photo .hero-aura,
.hero--photo .hero-grain {
  display: none;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

/* Seconda foto del laboratorio che si alterna alla prima, in dissolvenza (solo opacità, livello proprio) */
.hero-photo .hero-photo-b {
  position: absolute;
  inset: 0;
  opacity: 0;
  object-position: 50% 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-photo .hero-photo-b {
    animation: hero-alterna 16s ease-in-out 0s infinite;
    will-change: opacity;
  }
}

@keyframes hero-alterna {
  0%, 40% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(255, 253, 249, 0.85) 28%, rgba(255, 253, 249, 0.3) 52%, rgba(255, 253, 249, 0) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(255, 253, 249, 0) 25%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.6) 0%, rgba(255, 253, 249, 0) 18%);
}

@media (max-width: 899px) {
  .hero-photo img {
    object-position: 60% 30%;
  }

  /* Da telefono la foto si vede quasi pulita: velo solo in alto (logo e menu) e in fondo (frase e Ordina); dietro al titolo c'è un alone a parte */
  .hero-photo::after {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(255, 253, 249, 0.85) 14%, rgba(255, 253, 249, 0) 30%),
      linear-gradient(180deg, rgba(255, 253, 249, 0.6) 0%, rgba(255, 253, 249, 0) 16%);
  }

  /* Titolo al suo posto, in basso a sinistra: un alone crema stretto dietro ogni riga, il resto della foto resta pulito */
  .hero--photo .ht-line {
    position: relative;
  }

  .hero--photo .ht-line::before {
    content: "";
    position: absolute;
    inset: -0.12em -0.35em -0.08em;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(255, 253, 249, 0.9) 50%, rgba(255, 253, 249, 0.6) 78%, rgba(255, 253, 249, 0) 100%);
    pointer-events: none;
  }
}

.hero-grain {
  position: absolute;
  inset: 0;
  background: url(../assets/grain.png) 0 0 / 160px 160px;
  opacity: 0.035;
  pointer-events: none;
  z-index: -1;
}

.hero-top {
  justify-self: end;
}

/* Sulla foto del laboratorio la scritta piccola sta su un fondo crema, altrimenti si perde */
.hero--photo .hero-top {
  padding: 0.45em 0.8em;
  border-radius: 4px;
  background: rgba(255, 253, 249, 0.85);
  color: var(--fg);
}

@media (max-width: 899px) {
  .hero--photo .hero-top {
    justify-self: start;
  }
}

.hero-title {
  align-self: end;
  margin-top: var(--sp-5);
  font-size: clamp(3.4rem, 13vw, 10.5rem);
  line-height: 0.92;
}

.ht-line {
  display: block;
  width: max-content;
  max-width: 100%;
}

.hero-title .char {
  font-variation-settings: 'wght' var(--w, var(--w0)), 'opsz' var(--op, 72), 'SOFT' var(--soft, 0);
}

.ht-lead {
  --w0: 400;
  --op: 30;
  margin-bottom: 0.08em;
  font-size: 0.42em;
  letter-spacing: -0.01em;
}

.ht-main {
  --w0: 400;
}

.ht-glaze {
  --w0: 400;
  position: relative;
  margin-left: 0.9em;
  font-family: 'Fraunces Display', var(--font-display);
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.ht-glaze .char {
  padding: 0.1em 0.12em 0.3em;
  margin: -0.1em -0.12em -0.3em;
  color: var(--accent);
}

.hero-shine .ht-glaze .char {
  background: linear-gradient(100deg, var(--accent) 0 38%, var(--gold) 46%, #F6DC97 50%, var(--gold) 54%, var(--accent) 62% 100%) var(--sx, 100%) 0 / 320% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ht-swash {
  position: absolute;
  left: 4%;
  right: -2%;
  bottom: -0.2em;
  width: 98%;
  height: 0.28em;
  overflow: visible;
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.js .ht-swash path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.hero-aura {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.aura {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
}

.aura--a {
  width: max(46vw, 420px);
  height: max(46vw, 420px);
  left: -8vw;
  bottom: -14vw;
  background: radial-gradient(closest-side, rgba(194, 154, 75, 0.22), transparent);
}

.aura--b {
  width: max(38vw, 360px);
  height: max(38vw, 360px);
  right: 4vw;
  top: 18%;
  background: radial-gradient(closest-side, rgba(201, 154, 59, 0.26), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .aura {
    will-change: transform;
  }

  .hero-off .aura,
  .is-opening .aura {
    animation-play-state: paused;
  }

  .aura--a {
    animation: aura-drift 18s ease-in-out infinite alternate;
  }

  .aura--b {
    animation: aura-drift 22s ease-in-out -7s infinite alternate-reverse;
  }
}

@keyframes aura-drift {
  to {
    transform: translate3d(12vw, -8vh, 0) scale(1.15);
  }
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.hero-sub {
  max-width: 24ch;
  font-size: var(--fs-lead);
  line-height: 1.35;
}

.spec {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-3);
  align-items: start;
}

.spec-text {
  grid-column: 1 / span 5;
  display: grid;
  gap: var(--sp-3);
}

.spec-text .title {
  margin-block: var(--sp-2) var(--sp-1);
}

.spec-text .rows {
  margin-top: var(--sp-4);
}

/* Senza foto accanto il testo prende più spazio */
.spec-text:only-child {
  grid-column: 1 / span 8;
}

.spec-photo {
  grid-column: 7 / -1;
  margin-top: var(--sp-6);
}

@media (max-width: 899px) {
  .hero {
    padding-top: 6rem;
  }

  .spec {
    display: block;
  }

  .spec-photo {
    margin: var(--sp-5) 0 0;
  }
}

@media (max-width: 599px) {
  .hero-title {
    font-size: clamp(2.9rem, 15vw, 4.5rem);
  }

  .ht-lead {
    font-size: 0.5em;
  }

  .ht-glaze {
    margin-left: 0.4em;
  }
}

.torte {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: var(--bg-2);
  overflow: clip;
}

.torte-head {
  position: absolute;
  top: 6.5rem;
  left: var(--pad-x);
  z-index: 3;
}

.torte-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.torte-track::-webkit-scrollbar {
  display: none;
}

.cat {
  position: relative;
  flex: 0 0 55vw;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  column-gap: var(--sp-4);
  padding: 9rem var(--pad-x) 5rem;
  scroll-snap-align: start;
}

.cat-n {
  position: absolute;
  inset: 0 var(--pad-x) 0 auto;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12vw;
  line-height: 1;
  color: var(--line);
  user-select: none;
  pointer-events: none;
}

.cat-ph,
.cat-body {
  position: relative;
  z-index: 1;
}

.cat-ph {
  width: min(100%, 24rem);
  max-height: 100%;
}

.cat-body {
  margin-left: -4vw;
}

.cat:nth-child(even) .cat-ph {
  order: 2;
  justify-self: end;
}

.cat:nth-child(even) .cat-body {
  order: 1;
  margin-left: 0;
  margin-right: -4vw;
  text-align: right;
}

.cat:nth-child(even) .cat-n {
  inset: 0 auto 0 var(--pad-x);
}

.cat-name {
  font-weight: 700;
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  line-height: 0.9;
}

.cat-price {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.torte-bar {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: 2.5rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 3;
}

.prev {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-3);
  align-items: start;
}

.prev-head {
  grid-column: 1 / span 5;
  position: sticky;
  top: 7rem;
  display: grid;
  gap: var(--sp-3);
}

.prev-head .title {
  margin-block: var(--sp-2);
}

.prev-form {
  grid-column: 7 / -1;
  display: grid;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
}

.prev-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

@media (max-width: 899px) {
  .torte {
    height: auto;
  }

  .torte-head {
    position: static;
    padding: var(--sp-6) var(--pad-x) 0;
  }

  .torte-track {
    display: block;
    height: auto;
    overflow: visible;
  }

  .torte-bar {
    display: none;
  }

  .cat {
    display: block;
    height: auto;
    padding: var(--sp-5) var(--pad-x);
    overflow: clip;
  }

  .cat-n {
    inset: var(--sp-3) var(--pad-x) auto auto;
    font-size: 32vw;
    align-items: flex-start;
  }

  .cat:nth-child(even) .cat-n {
    inset: var(--sp-3) auto auto var(--pad-x);
  }

  .cat-ph {
    width: 78%;
  }

  .cat:nth-child(even) .cat-ph {
    margin-left: auto;
  }

  .cat-body,
  .cat:nth-child(even) .cat-body {
    margin: var(--sp-3) 0 0;
    text-align: left;
  }

  .cat:nth-child(even) .cat-body {
    text-align: right;
  }

  .prev {
    display: block;
  }

  .prev-head {
    position: static;
  }

  .prev-form {
    padding-top: var(--sp-5);
  }

  .contact-list {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
}

@media (max-width: 560px) {
  .prev-pair {
    grid-template-columns: 1fr;
  }
}

.band {
  display: grid;
  gap: var(--sp-3);
  justify-items: start;
}

.band .title {
  margin-block: var(--sp-2);
  max-width: 14ch;
}

.band .cta {
  margin-top: var(--sp-2);
}

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-5) var(--pad-x) var(--sp-7);
}

.about-text {
  grid-column: 1 / span 5;
  display: grid;
  gap: var(--sp-3);
}

.about-text .title {
  margin-block: var(--sp-2) var(--sp-1);
}

.about-text .lead {
  max-width: 38ch;
}

.about-photo {
  grid-column: 7 / -1;
}

.about-photo .ph,
.spec-photo .ph {
  width: min(100%, 26rem);
  margin-left: auto;
}

/* Chi siamo: le due foto del laboratorio grandi, sotto il testo a tutta larghezza (affiancate da computer, una sotto l'altra da telefono) */
.about-photo.about-photo--duo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.about-photo--duo .ph,
.about-photo--duo .ph:last-child {
  width: 100%;
  margin: 0;
}

@media (max-width: 899px) {
  .about-photo.about-photo--duo {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
  }
}

.steps {
  background: var(--bg-2);
}

.steps-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-3);
  row-gap: var(--sp-4);
}

.steps-inner .title {
  grid-column: 1 / span 5;
  margin-top: var(--sp-2);
}

.steps-inner .rows {
  grid-column: 7 / -1;
  align-self: end;
}

.steps-inner .story-text {
  grid-column: 7 / -1;
  display: grid;
  gap: var(--sp-3);
}

.story-motto {
  font-style: italic;
}

.contact-block {
  padding: var(--sp-5) var(--pad-x) var(--sp-4);
}

.map {
  position: relative;
  min-height: clamp(22rem, 48vw, 34rem);
  margin: 0 var(--pad-x) var(--sp-7);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(229, 213, 188, 0.6) 14px 15px),
    linear-gradient(160deg, var(--surface), var(--bg-2));
}

.map-gate {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--sp-2);
  padding: var(--sp-4);
}

.map-text {
  max-width: 44ch;
  color: var(--fg);
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin-top: var(--sp-1);
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: sepia(0.15) saturate(0.85);
}

.map.is-loaded .map-gate {
  display: none;
}

.legal {
  padding: var(--sp-4) var(--pad-x) var(--sp-7);
}

.legal-body {
  max-width: 46rem;
  display: grid;
  gap: var(--sp-5);
}

.legal-sec {
  display: grid;
  gap: var(--sp-2);
}

.legal-sec h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.05;
}

.legal-sec p,
.legal-list li {
  max-width: 62ch;
}

.legal-list {
  counter-reset: item;
  display: grid;
  gap: var(--sp-2);
}

.legal-list li {
  display: flex;
  gap: var(--sp-2);
  counter-increment: item;
}

.legal-list li::before {
  content: counter(item, decimal-leading-zero);
  flex: none;
  padding-top: 0.2em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.7;
}

.legal-sec a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-sec button {
  justify-self: start;
}

@media (max-width: 899px) {
  .about {
    display: block;
    padding-top: var(--sp-4);
    padding-bottom: var(--sp-6);
  }

  .about-photo {
    margin: var(--sp-5) 0 0;
  }

  .steps-inner {
    display: block;
  }

  .steps-inner .rows,
  .steps-inner .story-text {
    margin-top: var(--sp-4);
  }

  .map {
    margin-bottom: var(--sp-6);
  }
}

@media (max-width: 400px) {
  .brand {
    font-size: 1.1rem;
  }
}

.listino {
  display: grid;
  gap: var(--sp-5);
  padding: var(--sp-4) var(--pad-x) var(--sp-7);
}

.price-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.price-row .row-t {
  flex: 0 1 auto;
  font-size: 1.05rem;
}

.price {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  white-space: nowrap;
}

.info-list .row-t {
  flex: 0 1 auto;
}

.price-row:hover .row-t {
  transform: none;
}

@media (min-width: 900px) {
  .price-group {
    max-width: 52rem;
  }
}

@media (max-width: 899px) {
  .page-home .hero {
    padding-top: 7.75rem;
  }

  /* Ordina allineato al pulsante WhatsApp fisso: stesso fondo (1rem) e stessa altezza (3.25rem) */
  .hero {
    padding-bottom: 1rem;
  }

  .hero-foot .cta--fill {
    display: inline-flex;
    align-items: center;
    min-height: 3.25rem;
    padding-block: 0;
  }
}

.faq {
  max-width: 52rem;
  padding: var(--sp-4) var(--pad-x) var(--sp-7);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding-block: 1.25rem;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex: none;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease-out);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.faq-n {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.5;
}

.faq-q {
  font-size: 1.125rem;
  font-weight: 500;
}

.faq-a {
  max-width: 60ch;
  padding: 0 2.5rem 1.5rem 2.2rem;
  color: var(--muted);
}

.faq-a a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fest-list {
  display: grid;
  gap: var(--sp-4);
  max-width: 52rem;
  padding: var(--sp-4) var(--pad-x) var(--sp-5);
}

.fest {
  display: grid;
  gap: 0.6rem;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.fest .lead {
  max-width: 52ch;
}

.field-hint a,
.page-head .lead a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
