/*
 * PSH – Prevenzione e Salute Holding · pagina "sito in costruzione"
 * Solo HTML e CSS: font, colori e gesti del sito (Distrampler per il titolo, corsivo aqua come la "e" del marchio).
 */

@font-face { font-family: "Distrampler"; src: url("fonts/Distrampler.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Helixa"; src: url("fonts/Helixa-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Helixa"; src: url("fonts/Helixa-Book.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Helixa"; src: url("fonts/Helixa-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #1b215e;
  --primary: #003ba0;
  --accent: #4354e4;
  --blue: #3b68fa;
  --aqua: #81e4e2;
  --white: #fff;
  --muted: rgb(255 255 255 / 0.68);
  --line: rgb(255 255 255 / 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--navy);
  color: var(--white);
  font-family: "Helixa", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ fondo */

/* Aloni sfocati che si spostano lentamente: danno profondità al blu pieno */
.aura {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}
.aura--accent {
  width: 62vmax; height: 62vmax;
  top: -24vmax; right: -14vmax;
  background: var(--accent);
  opacity: 0.55;
  animation: drift-a 22s ease-in-out infinite alternate;
}
.aura--aqua {
  width: 40vmax; height: 40vmax;
  bottom: -22vmax; left: -12vmax;
  background: var(--aqua);
  opacity: 0.16;
  animation: drift-b 26s ease-in-out infinite alternate;
}

/* Pittogramma a contorno: si disegna (pathLength = 1), poi si riempie appena e ondeggia */
.mark {
  position: fixed;
  z-index: 0;
  right: max(-8vw, -6rem);
  top: 50%;
  width: min(68vw, 60rem);
  translate: 0 -50%;
  fill: var(--white);
  fill-opacity: 0;
  stroke: var(--white);
  stroke-width: 0.35;
  stroke-opacity: 0.35;
  pointer-events: none;
  animation: float 28s ease-in-out infinite; /* parte subito da 0°: nessuno scatto quando finisce il disegno */
}
.mark > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 3.2s var(--ease) forwards, fill 2.4s ease 2.6s forwards;
}
.mark > :nth-child(2) { animation-delay: 0.15s, 2.7s; }
.mark > :nth-child(3) { animation-delay: 0.3s, 2.8s; }
.mark > :nth-child(4) { animation-delay: 0.45s, 2.9s; }
.mark > :nth-child(5) { animation-delay: 0.6s, 3s; }
.mark > :nth-child(6) { animation-delay: 0.75s, 3.1s; }
.mark > :nth-child(7) { animation-delay: 0.9s, 3.2s; }

/* ------------------------------------------------------------ impaginato */

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  max-width: 90rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(2rem, 4vw, 3rem);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: block;
  width: auto;
  height: clamp(3.25rem, 6vw, 4.75rem);
  opacity: 0;
  animation: rise 1.1s var(--ease) 0.2s forwards;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: rise 1.1s var(--ease) 0.35s forwards;
}
.status__dot {
  position: relative;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--aqua);
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--aqua);
  animation: pulse 2.2s ease-out infinite;
}

.hero {
  align-self: center;
  padding: clamp(2rem, 6vh, 4.5rem) 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--aqua);
  opacity: 0;
  animation: rise 1s var(--ease) 0.55s forwards;
}
.eyebrow em { margin: 0 0.35em 0 0.1em; font-family: "Distrampler", Georgia, serif; font-size: 1.2em; letter-spacing: 0; text-transform: none; }

.claim {
  margin: 1.25rem 0 0;
  font-family: "Distrampler", Georgia, serif;
  font-weight: 400;
  font-size: clamp(3.4rem, min(7.6vw, 13vh), 8rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  word-spacing: -0.12em; /* Distrampler ha spazi tra le parole molto larghi */
}
/* Ogni riga entra dal basso dentro una maschera (padding per non tagliare discendenti e corsivo) */
.claim__line {
  display: block;
  overflow: hidden;
  padding: 0.04em 0.1em 0.14em 0;
  margin: -0.04em 0 -0.14em;
}
.claim__line > span {
  display: inline-block;
  transform: translateY(115%);
  animation: line-up 1.3s var(--ease) forwards;
}
.claim__line:nth-child(1) > span { animation-delay: 0.7s; }
.claim__line:nth-child(2) > span { animation-delay: 0.85s; }
.claim em { font-style: italic; color: var(--aqua); }

.lead {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--muted);
  opacity: 0;
  animation: rise 1.1s var(--ease) 1.2s forwards;
}

.bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: rise 1.1s var(--ease) 1.45s forwards;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem clamp(2rem, 5vw, 4rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.contacts a {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--white);
  text-decoration: none;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}
.contacts a span { display: flex; flex-direction: column; gap: 0.25rem; }
.contacts small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.contacts .icon {
  flex: none;
  width: 2.9rem; height: 2.9rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--aqua);
  overflow: visible;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.contacts a:hover .icon,
.contacts a:focus-visible .icon { background: var(--aqua); border-color: var(--aqua); color: var(--navy); }
.contacts a:focus-visible { outline: 2px solid var(--aqua); outline-offset: 6px; border-radius: 999px; }

.legal {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.5);
}

/* Linea aqua che scorre lungo il bordo basso, come la barra del loader del sito */
.progress {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  height: 2px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.08);
}
.progress span {
  display: block;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--aqua), transparent);
  animation: sweep 3.6s ease-in-out infinite;
}

/* ------------------------------------------------------------ mobile */

@media (max-width: 640px) {
  .status { padding: 0.55rem 0.9rem; font-size: 0.62rem; letter-spacing: 0.12em; }
  .mark { width: 120vw; right: -45vw; top: 58%; stroke-opacity: 0.25; }
  .bottom { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------ animazioni */

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes line-up { to { transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill { to { fill-opacity: 0.06; stroke-opacity: 0.18; } }
@keyframes float { 0%, 100% { rotate: 0deg; scale: 1; } 25% { rotate: 3deg; scale: 1.04; } 75% { rotate: -2deg; scale: 0.98; } }
@keyframes drift-a { to { transform: translate(-8vmax, 10vmax) scale(1.1); } }
@keyframes drift-b { to { transform: translate(10vmax, -6vmax) scale(1.15); } }
@keyframes pulse { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.2); opacity: 0; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* Movimento ridotto: tutto visibile subito, niente animazioni continue */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo, .status, .eyebrow, .lead, .bottom { opacity: 1; }
  .claim__line > span { transform: none; }
  .mark > * { stroke-dashoffset: 0; fill-opacity: 0.06; }
  .mark { stroke-opacity: 0.18; }
}
