/* Palette e font Own Italy */
:root {
  --navy: #212942;
  --navy-deep: #171d30;
  --gold: #e8cca7;
  --gold-soft: rgba(232, 204, 167, 0.62);
  --gold-line: rgba(232, 204, 167, 0.2);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--navy);
}

body {
  color: var(--gold);
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

em {
  font-style: italic;
}

h1,
h2 {
  font-family: "Cardo", Georgia, serif;
  font-weight: 400;
}

.kicker {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Apertura: testo a sinistra, grande arco a destra */
.hello {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1240px, 100% - 48px);
  margin: 0 auto;
  padding: 7rem 0 4rem;
}

.hello-copy {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hello h1 {
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

.hello-note {
  font-size: 0.95rem;
  color: var(--gold-soft);
}

.hello-arch {
  position: relative;
  justify-self: end;
  width: min(100%, 400px);
  aspect-ratio: 400 / 540;
}

.hello-arch-photo {
  position: absolute;
  inset: 7% 7.5% 0;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  clip-path: inset(100% 0% 0% 0%);
}

.hello-arch-photo img {
  transform: scale(1.3);
}

.hello-arch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  overflow: visible;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

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

/* Percorso orizzontale */
.journey-pin {
  position: relative;
  height: 100svh;
  overflow: hidden;
  border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
}

.journey-track {
  position: relative;
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
}

/* Percorso dorato: disegnato una volta, poi scoperto con una "finestra"
   che scorre (solo transform, nessun ridisegno durante lo scroll) */
.route {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.route-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.route path {
  fill: none;
}

.route-base {
  stroke: rgba(232, 204, 167, 0.18);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.route-mask {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  will-change: transform;
}

.route-gold-svg {
  will-change: transform;
}

.route-line {
  stroke: var(--gold);
  stroke-width: 1.6;
}

.route-stops circle {
  fill: var(--navy);
  stroke: rgba(232, 204, 167, 0.4);
  stroke-width: 1;
}

.route-stops circle.is-lit {
  fill: var(--gold);
  stroke: var(--gold);
}

.route-dot,
.route-glow {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.route-dot {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #f6f1e8;
}

.route-glow {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  background: radial-gradient(circle, rgba(232, 204, 167, 0.45) 0%, rgba(232, 204, 167, 0) 70%);
}

.step > * {
  position: relative;
  z-index: 1;
}


.step {
  position: relative;
  flex: none;
  width: min(78vw, 980px);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 34%);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 0 clamp(2rem, 5vw, 5rem);
  border-right: 1px solid var(--gold-line);
}

.step-intro {
  width: min(56vw, 640px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.step-intro-text {
  font-family: "Cardo", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.3;
}

/* Numero gigante solo contorno */
.step-num {
  position: absolute !important;
  top: 50%;
  left: clamp(1rem, 3vw, 3rem);
  transform: translateY(-58%);
  font-family: "Cardo", serif;
  font-size: clamp(12rem, 30vw, 26rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232, 204, 167, 0.22);
  pointer-events: none;
  user-select: none;
}

/* Riempimento dorato del numero */
/* Riempimento: maschera che scorre da sinistra (solo transform) */
.step-num .fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}

.step-num .fill-in {
  display: block;
  color: rgba(232, 204, 167, 0.16);
  -webkit-text-stroke: 1px var(--gold);
  will-change: transform;
}

.step-body h2 .w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  vertical-align: top;
}

.step-body h2 .c {
  display: inline-block;
}

.step-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 18svh;
}

.step-body h2 {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1.05;
}

.step-body p:not(.kicker) {
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gold-soft);
}

.step-media {
  position: relative;
  height: min(58svh, 520px);
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  will-change: transform;
}

.step-media img {
  width: 140%;
  max-width: none;
  margin-left: -20%;
  will-change: transform;
}

/* Barra di avanzamento */
.journey-progress {
  position: absolute;
  left: 50%;
  bottom: 2.25rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(420px, 100% - 64px);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: rgba(232, 204, 167, 0.14);
  overflow: hidden;
}

.progress-current {
  font-family: "Cardo", serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  min-width: 1.6em;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}

/* Chiusura */
.bye {
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  text-align: center;
  padding: 6rem 1.5rem;
  background: var(--navy-deep);
}

.bye-key {
  width: 150px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  filter: drop-shadow(0 0 14px rgba(232, 204, 167, 0.35));
}

.bye h2 {
  font-size: clamp(2.2rem, 5.5vw, 4.4rem);
  line-height: 1.1;
}

.bye-btn {
  position: relative;
  padding: 1.1rem 2.6rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.6s var(--ease);
}

.bye-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.7s var(--ease);
  z-index: -1;
}

.bye-btn:hover,
.bye-btn:focus-visible {
  color: var(--navy);
}

.bye-btn:hover::before,
.bye-btn:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* Telefono: stesso scorrimento orizzontale del computer, tappe impaginate in verticale */
@media (max-width: 768px) {
  .hello {
    grid-template-columns: 1fr;
    padding: 6.5rem 0 3rem;
    gap: 3rem;
  }

  .hello-arch {
    justify-self: center;
    width: min(78%, 320px);
  }

  .step {
    width: 88vw;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 1.4rem;
    padding: 232px 22px 7rem;
  }

  .step-intro {
    width: 82vw;
    padding: 0 22px;
  }

  .step-intro-text {
    font-size: 1.6rem;
  }

  .step-num {
    top: 76px;
    left: 14px;
    transform: none;
    font-size: 8.5rem;
  }

  .step-body {
    padding-top: 0;
    gap: 0.9rem;
  }

  .step-body h2 {
    font-size: 2.2rem;
  }

  .step-body p:not(.kicker) {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .step-media {
    height: 28svh;
    max-height: 280px;
  }

  .journey-progress {
    bottom: 1.25rem;
    width: calc(100% - 64px);
  }
}
