/* ═══════════════════════════════════════════════════════════════════
   Armur — pagina Agenzia
   Stessi token di style.css e contatti.css; la novità sono le sezioni
   "agganciate": lo scorrimento si ferma e la rotella guida l'animazione.
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────── motore delle sezioni agganciate ─────────────────────────
   La sezione è alta N schermi, il suo palco è alto uno schermo e resta fermo
   mentre la sezione scorre. Con lo scroll virtuale lo trattiene agenzia.js,
   con lo scroll nativo (touch) basta position: sticky.                    */
[data-pin] {
  position: relative;
  height: calc(var(--pin-len, 3) * 100vh);
  overflow: clip;              /* non "hidden": sticky deve continuare a funzionare */
}
/* il filo di separazione va sul palco, così il palco combacia al pixel col bordo */
[data-pin].ct-section { border-top: 0; }
[data-pin].ct-section .ag-pin { border-top: 1px solid #292929; }
.ag-pin {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  will-change: transform;
}
html.is-native-scroll .ag-pin { position: sticky; top: 0; }

/* ───────────────────────── hero: la finestra ad arco ───────────────────────── */
.ag-hero { background: #080808; }
.ag-hero__window {
  position: absolute;
  inset: 0;
  isolation: isolate;
  clip-path: inset(50% 35% 50% 35%);
  will-change: clip-path;
}
html:not(.js) .ag-hero__window { clip-path: none; }
.ag-hero__liquid::after { background: linear-gradient(0deg, rgba(8, 8, 8, 0.35), transparent 40%); }
.ag-hero__shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #080808;
  opacity: 0;
  pointer-events: none;
}

.ag-hero__eyebrow {
  position: absolute;
  top: calc(17vh - 40px);
  left: 0;
  right: 0;
  z-index: 4;
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #bdbdbd;
}

.ag-hero__title {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: 0;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(88px, 13.4vw, 250px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #f2f2f2;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}
.ag-hero__w1,
.ag-hero__w2 {
  position: absolute;
  display: block;
  white-space: nowrap;
  will-change: transform, opacity;
}
/* "Chi" morde il bordo sinistro della finestra, "siamo." quello destro */
.ag-hero__w1 { top: 30%; right: calc(50% + min(15vw, 280px) - 0.32em); }
.ag-hero__w2 { top: 52%; left: calc(50% + min(15vw, 280px) - 0.42em); font-style: italic; color: #dcdcdc; }

.ag-hero__foot {
  position: absolute;
  left: var(--box-pad);
  right: var(--box-pad);
  bottom: 28px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #b9b9b9;
}
.ag-hero__foot p { margin: 0; }
.ag-hero__foot .is-right { text-align: right; }
.ag-hero__cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ddd;
}
.ag-hero__cue i {
  position: relative;
  display: block;
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}
.ag-hero__cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #eee;
  transform: translateY(-100%);
  animation: ag-cue 2s var(--ease-out-quart) infinite;
}
@keyframes ag-cue {
  0% { transform: translateY(-100%); }
  60% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

.ag-hero__manifesto {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 100px var(--box-pad) 60px;
  opacity: 0;
  pointer-events: none;
}
.ag-manifesto {
  max-width: 1120px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.3vw, 74px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}
.ag-manifesto .w { color: rgba(242, 242, 242, 0.16); transition: color 0.4s ease; }
.ag-manifesto .w.is-lit { color: #f2f2f2; }
.ag-manifesto__sign {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a9a9a;
}

/* ───────────────────────── storia: scorrimento orizzontale ───────────────────────── */
.ag-story { background: #080808; }
.ag-story__head {
  position: absolute;
  top: 50%;
  left: var(--box-pad);
  z-index: 3;
  width: 34vw;
  transform: translateY(-58%);
}
.ag-story__head .c-eyebrow { margin-bottom: 26px; }
.ag-story__head .ct-title { font-size: clamp(54px, 6vw, 104px); }

/* l'anno: lo stesso contatore del loader, in grande e a contorno */
.ag-story__year {
  position: absolute;
  right: var(--box-pad);
  bottom: 40px;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(130px, 19vw, 340px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.26);
  pointer-events: none;
}
.ag-story__year-in { display: block; }
.ag-story__year-in.is-rolling { animation: ag-roll 0.75s var(--ease-out-quart); }
@keyframes ag-roll {
  from { transform: translateY(70%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.ag-story__rail {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  /* le carte svaniscono passando sotto al titolo */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 30vw, #000 44vw);
  mask-image: linear-gradient(90deg, transparent 0, transparent 30vw, #000 44vw);
}
.ag-story__track {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 40px var(--box-pad) 0 46vw;
  list-style: none;
  will-change: transform;
}
.ag-mile {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: clamp(280px, 25vw, 400px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 8, 8, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.6s ease, background-color 0.6s ease, transform 0.9s var(--ease-out-quart);
}
.ag-mile.is-active { border-color: rgba(255, 255, 255, 0.5); background: rgba(8, 8, 8, 0.55); transform: translateY(-14px); }
.ag-mile.is-now { border-color: rgba(255, 255, 255, 0.4); }
.ag-mile__media {
  display: block;
  height: clamp(140px, 24vh, 230px);
  margin: -28px -28px 6px;
  overflow: hidden;
}
.ag-mile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  will-change: transform;
}
.ag-mile__year {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #aaa;
}
.ag-mile__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 2.6vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #f2f2f2;
}
.ag-mile__text { margin: 0; font-size: 15px; line-height: 1.55; color: #bdbdbd; }
.ag-mile__link {
  align-self: flex-start;
  margin-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #777;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #eee;
}

.ag-story__bar {
  position: absolute;
  left: var(--box-pad);
  right: var(--box-pad);
  bottom: 28px;
  z-index: 3;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}
.ag-story__bar span {
  position: absolute;
  inset: 0;
  background: #eee;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ───────────────────────── cosa facciamo: carte impilate ───────────────────────── */
.ag-stack { background: #080808; }
.ag-stack__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(40px, 5vw, 96px);
  height: 100%;
  max-width: calc(var(--box-max) + var(--box-pad) * 2);
  margin: 0 auto;
  padding: 110px var(--box-pad) 56px;
}
.ag-stack__aside .c-eyebrow { margin-bottom: 26px; }
.ag-stack__aside .ct-title { font-size: clamp(44px, 4.8vw, 86px); }
.ag-stack__aside .ct-lead { margin-top: 28px; }
.ag-stack__count {
  margin: 40px 0 14px;
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: #f2f2f2;
  font-variant-numeric: tabular-nums;
}
.ag-stack__count i { font-style: normal; font-size: 0.45em; color: #8f8f8f; }
.ag-stack__dots { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ag-stack__dots li { width: 34px; height: 1px; background: rgba(255, 255, 255, 0.22); transition: background-color 0.4s ease; }
.ag-stack__dots li.is-on { background: #eee; }

.ag-stack__deck {
  position: relative;
  height: min(64vh, 580px);
}
.ag-disc {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 20px;
  overflow: hidden;
  padding: clamp(28px, 3.4vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 12, 0.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transform-origin: 50% 0;
  will-change: transform, filter;
}
.ag-disc__glyph {
  position: absolute;
  top: -0.14em;
  right: 0.04em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(160px, 16vw, 290px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}
.ag-disc__index {
  margin: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #bdbdbd;
}
.ag-disc__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 4vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: #f2f2f2;
}
.ag-disc__title em { color: #c9c9c9; }
.ag-disc__text { max-width: 560px; margin: 0; font-size: 17px; line-height: 1.6; color: #bdbdbd; }
.ag-disc__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.ag-disc__tags li {
  padding: 7px 14px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  font-size: 13px;
  color: #d0d0d0;
  white-space: nowrap;
}

/* ───────────────────────── valori: lista con immagine al cursore ───────────────────────── */
.ag-values { padding: 140px var(--box-pad) 150px; }
.ag-values__inner { max-width: var(--box-max); margin: 0 auto; }
.ag-values__head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 80px;
}
.ag-values__head .c-eyebrow { margin-bottom: 26px; }
.ag-values__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.ag-value {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) minmax(0, 420px);
  align-items: center;
  gap: 32px;
  padding: 34px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  transition: opacity 0.5s ease;
}
.ag-value__scan {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: #eee;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.9s var(--ease-out-quart);
}
.ag-value__num {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #9a9a9a;
  font-variant-numeric: tabular-nums;
}
.ag-value__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(52px, 7.4vw, 128px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: #f2f2f2;
  transition: transform 0.9s var(--ease-out-quart), color 0.5s ease;
}
.ag-value__text { margin: 0; font-size: 17px; line-height: 1.6; color: #bdbdbd; }
@media (hover: hover) {
  .ag-values__list:hover .ag-value { opacity: 0.32; }
  .ag-values__list .ag-value:hover { opacity: 1; }
  .ag-value:hover .ag-value__scan { transform: scaleX(1); }
  .ag-value:hover .ag-value__name { transform: translateX(28px); font-style: italic; }
}

.ag-float {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: clamp(220px, 19vw, 320px);
  aspect-ratio: 4 / 5;
  margin: calc(clamp(220px, 19vw, 320px) * -0.625) 0 0 calc(clamp(220px, 19vw, 320px) * 0.12);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  will-change: transform, opacity;
}
.ag-float.is-on { opacity: 1; }
.ag-float img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(100% 0 0 0);
  transform: scale(1.15);
  transition: clip-path 0.75s var(--ease-out-quart), transform 1.1s var(--ease-out-quart);
}
.ag-float img.is-on { clip-path: inset(0 0 0 0); transform: scale(1); z-index: 1; }
@media (hover: none) { .ag-float { display: none; } }

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 1100px) {
  .ag-story__head { width: 40vw; }
  .ag-stack__grid { gap: 40px; }
  .ag-value { grid-template-columns: 56px minmax(0, 1fr); }
  .ag-value__text { grid-column: 2; }
  .ag-values__head { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 767px) {
  .ag-hero__eyebrow { top: 104px; padding: 0 20px; font-size: 9px; line-height: 1.6; }
  .ag-hero__title { font-size: 21vw; }
  .ag-hero__w1 { top: 26%; right: auto; left: 20px; }
  .ag-hero__w2 { top: auto; bottom: 21%; left: auto; right: 20px; }
  .ag-hero__foot { grid-template-columns: 1fr 1fr; font-size: 11px; bottom: 22px; }
  .ag-hero__cue { display: none; }
  .ag-manifesto { font-size: 8.4vw; text-align: left; }
  .ag-hero__manifesto { align-items: flex-start; gap: 24px; }

  .ag-story__head { top: 96px; width: auto; right: 20px; transform: none; }
  .ag-story__head .ct-title { font-size: 13vw; }
  .ag-story__head .c-eyebrow { margin-bottom: 16px; }
  .ag-story__rail { align-items: flex-end; padding-bottom: 76px; -webkit-mask-image: none; mask-image: none; }
  .ag-story__track { padding: 0 20px; gap: 14px; }
  .ag-mile { width: 76vw; padding: 22px; }
  .ag-mile__media { height: 18svh; margin: -22px -22px 4px; }
  .ag-mile.is-active { transform: none; }
  .ag-mile__text { font-size: 14px; }
  .ag-story__year { font-size: 26vw; bottom: auto; top: 214px; right: 20px; opacity: 0.55; }
  .ag-disc { background: rgba(10, 10, 12, 0.88); }

  .ag-stack__grid { grid-template-columns: 1fr; align-content: start; gap: 20px; padding: 92px 20px 24px; }
  .ag-stack__aside .c-eyebrow { margin-bottom: 14px; }
  .ag-stack__aside .ct-title { font-size: 10.4vw; }
  .ag-stack__aside .ct-lead { display: none; }
  .ag-stack__count { display: none; }
  .ag-stack__dots { margin-top: 18px; }
  .ag-stack__deck { height: min(58svh, 520px); }
  .ag-disc { padding: 24px; gap: 14px; }
  .ag-disc__title { font-size: 9.6vw; }
  .ag-disc__text { font-size: 14px; }
  .ag-disc__tags li { font-size: 11px; padding: 6px 11px; }
  .ag-disc__glyph { font-size: 150px; }

  .ag-values { padding: 88px 20px 96px; }
  .ag-values__head { margin-bottom: 48px; }
  .ag-value { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .ag-value__text { grid-column: auto; font-size: 15px; }
  .ag-value__name { font-size: 15vw; }
}

/* ───────────────────────── movimento ridotto: tutto disteso, niente aggancio ───────────────────────── */
.ag-static [data-pin] { height: auto !important; }
.ag-static .ag-pin { height: auto; position: relative; transform: none !important; }
.ag-static .ag-hero .ag-pin { min-height: 100svh; padding: 180px var(--box-pad) 120px; }
.ag-static .ag-hero__window { clip-path: none !important; }
.ag-static .ag-hero__shade { opacity: 0.55 !important; }
.ag-static .ag-hero__title,
.ag-static .ag-hero__w1,
.ag-static .ag-hero__w2 { position: relative; inset: auto; top: auto; left: auto; right: auto; bottom: auto; transform: none !important; opacity: 1 !important; }
.ag-static .ag-hero__title { z-index: 6; display: flex; flex-wrap: wrap; gap: 0 0.3em; }
.ag-static .ag-hero__manifesto { position: relative; inset: auto; opacity: 1 !important; padding: 60px 0 0; z-index: 6; }
.ag-static .ag-manifesto .w { color: #f2f2f2; }
.ag-static .ag-hero__foot { display: none; }
.ag-static .ag-story .ag-pin,
.ag-static .ag-stack .ag-pin { padding: 120px var(--box-pad); }
.ag-static .ag-story__head { position: relative; top: auto; left: auto; width: auto; transform: none; }
.ag-static .ag-story__rail { position: relative; -webkit-mask-image: none; mask-image: none; }
.ag-static .ag-story__track { flex-wrap: wrap; padding: 40px 0 0; transform: none !important; }
.ag-static .ag-story__year,
.ag-static .ag-story__bar { display: none; }
.ag-static .ag-stack__grid { height: auto; padding: 0; align-items: start; }
.ag-static .ag-stack__deck { height: auto; display: grid; gap: 16px; }
.ag-static .ag-disc { position: relative; inset: auto; min-height: 420px; transform: none !important; filter: none !important; }
.ag-static .ag-stack__count,
.ag-static .ag-stack__dots { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ag-hero__cue i::after { animation: none; }
  .ag-float { display: none; }
}
