/* Pignora, landing.
   Direzione: leggera e amichevole. Lilla chiaro, inchiostro viola scuro, un accento viola.
   L'elemento forte è l'illustrazione: un atto che si compila da solo al caricamento. */

:root {
  --bg: #f4f2fb;
  --ink: #1d1838;
  --muted: #625c7e;
  --accent: #6a4cf0;
  --accent-soft: #e6e0ff;
  --paper: #ffffff;
  --bar: #ebe8f4;
  --ok: #1f8a5b;
  --ok-soft: #dcf3e8;
  --ease: cubic-bezier(.2, .9, .25, 1);
  --gutter: clamp(16px, 4vw, 72px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, p, figure { margin: 0; }

.wrap { width: 100%; max-width: 1600px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Top ---------- */
.top { display: flex; justify-content: space-between; align-items: center; padding-block: 26px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; font-size: clamp(28px, 1.2rem + 1vw, 36px); letter-spacing: -0.04em; line-height: 1; }
.brand__mark { width: clamp(44px, 2rem + 1vw, 54px); height: clamp(44px, 2rem + 1vw, 54px); overflow: visible; }
/* la "p" riprende la sfumatura dei petali, un filo più pesante */
.brand__p {
  font-weight: 850;
  background: linear-gradient(135deg, #6a4cf0 10%, #ff7fb0 60%, #ffbe55 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: .02em;
}
.petal { opacity: .68; transform-origin: 16px 16px; transform: rotate(var(--r)); }
.brand__orbit { transform-origin: 16px 16px; transition: transform 1s var(--ease); }
.brand:hover .brand__orbit { transform: rotate(90deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px clamp(32px, 6vw, 120px);
  padding-block: clamp(32px, 8vh, 96px) clamp(56px, 10vh, 120px);
}
h1 {
  font-size: clamp(3rem, 1rem + 6vw, 8rem);
  font-weight: 750;
  line-height: .98;
  letter-spacing: -0.045em;
}
.lead { margin: 28px 0 36px; font-size: clamp(19px, 1rem + .5vw, 24px); color: var(--muted); max-width: 26em; }

.btn {
  display: inline-block;
  padding: 16px 30px;
  border-radius: 999px;
  /* stessa sfumatura del marchio, in toni più profondi perché il testo bianco resti leggibile */
  background: linear-gradient(120deg, #6a4cf0 0%, #d94b94 60%, #ee8a3c 100%);
  background-size: 180% 100%;
  background-position: 0% 50%;
  color: #fff;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 12px 28px -12px rgba(217, 75, 148, .65);
  transition: background-position .5s var(--ease), box-shadow .3s, transform .15s;
}
.btn:hover { background-position: 70% 50%; box-shadow: 0 16px 32px -12px rgba(217, 75, 148, .8); }
.btn:active { transform: translateY(1px); }

/* ---------- Illustrazione: il foglio ---------- */
.sheet { position: relative; width: min(100%, 520px); margin-left: auto; padding: 24px 0 48px; }
.sheet__paper {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  aspect-ratio: 1 / 1.2;
  padding: clamp(28px, 4vw, 48px);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(29, 24, 56, .06), 0 30px 60px -20px rgba(70, 50, 160, .25);
  transform: rotate(2deg);
}
.bar { display: block; width: 100%; height: 12px; border-radius: 6px; background: var(--bar); }
.bar--title { width: 55%; height: 18px; margin-bottom: 10px; background: #dcd7ee; }
.bar--short { width: 62%; }

.chip {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: clamp(13px, .7rem + .3vw, 16px);
  font-weight: 600;
  white-space: nowrap;
}
.sheet__sign { margin-top: auto; align-self: flex-end; }
.chip--ok { background: var(--ok-soft); color: var(--ok); }

/* compilazione a ciclo (vedi main.js): senza JS il foglio resta già compilato */
.js .sheet .fill {
  opacity: 0;
  transform: translateY(6px) scale(.95);
  transition: opacity .3s, transform .3s;
}
.js .sheet .bar.fill { transform: scaleX(0); transform-origin: left center; }
.js .sheet.is-filling .fill {
  opacity: 1;
  transform: none;
  transition: opacity .35s var(--ease) var(--d), transform .7s var(--ease) var(--d);
}
.js .sheet.is-filling .chip.fill { animation: glow 1.2s ease-out calc(var(--d) + .2s) both; }
@keyframes glow {
  from { box-shadow: 0 0 0 0 rgba(106, 76, 240, .35); }
  to   { box-shadow: 0 0 0 10px rgba(106, 76, 240, 0); }
}

.note {
  position: absolute; left: -48px; bottom: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  background: var(--ink); color: #fff;
  border-radius: 16px;
  font-size: 15px; line-height: 1.35;
  box-shadow: 0 20px 40px -16px rgba(29, 24, 56, .45);
}
.note strong { font-weight: 650; }
.note > span:last-child { color: #c9c3e6; }
.note strong { color: #fff; }
.note__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ffb547; box-shadow: 0 0 0 5px rgba(255, 181, 71, .2); }

/* ---------- Punti ---------- */
.points {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px);
  padding-block: clamp(32px, 6vh, 72px) clamp(56px, 9vh, 104px);
}
.point {
  padding: 14px 14px 28px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(29, 24, 56, .05), 0 24px 48px -28px rgba(70, 50, 160, .28);
}
.point h2 { margin: 26px 14px 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.point p { margin-inline: 14px; color: var(--muted); }

/* riquadro illustrato in cima a ogni punto, stesso linguaggio del foglio in alto */
.point__art {
  position: relative;
  height: 172px;
  border-radius: 16px;
  background: var(--accent-soft);
  overflow: hidden;
}
.mini-bar { display: block; height: 9px; border-radius: 5px; background: rgba(106, 76, 240, .16); }
.mini-bar--short { width: 60%; }

.art-fill { display: flex; flex-direction: column; justify-content: center; gap: 11px; padding: 0 clamp(24px, 3vw, 44px); }
.mini-chip {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 20px -8px rgba(106, 76, 240, .6);
}
.mini-chip svg { width: 14px; height: 14px; color: #ffd98a; }

.art-date { display: flex; align-items: center; justify-content: center; gap: 18px; background: #efeaff; }
.date {
  display: grid; width: 82px; overflow: hidden;
  border-radius: 14px; background: var(--paper); text-align: center;
  box-shadow: 0 12px 24px -12px rgba(70, 50, 160, .35);
}
.date__month { padding: 4px 0; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.date__day { padding: 6px 0 8px; font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.mini-note {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink); color: #fff;
  font-size: 15px; font-weight: 600;
}

.art-stack { display: grid; place-items: center; }
.mini-sheet {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; gap: 9px;
  width: 112px; height: 132px; padding: 22px 16px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 10px 22px -12px rgba(70, 50, 160, .4);
}
.mini-sheet:nth-child(1) { transform: translate(-34px, 10px) rotate(-10deg); background: #f7f5ff; }
.mini-sheet:nth-child(2) { transform: translate(34px, 8px) rotate(9deg); background: #fbfaff; }
.mini-sheet:nth-child(3) { transform: translateY(-4px); }

/* ---------- Footer ---------- */
.foot { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px 36px; font-size: 15px; color: var(--muted); }
.foot a { text-decoration: none; }
.foot { align-items: center; }
.foot p a { color: var(--ink); font-weight: 600; white-space: nowrap; }
.foot__vat { flex: none; font-size: 12px; letter-spacing: .01em; opacity: .8; white-space: nowrap; }
.foot a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .sheet { margin-inline: auto; }
  .note { left: 16px; }
  .points { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .btn { width: 100%; text-align: center; }
  .sheet__paper { aspect-ratio: auto; transform: rotate(1deg); }
  .sheet__sign { margin-top: 12px; }
  .note { right: 16px; }
  .foot { flex-direction: column; }
}

/* ---------- Movimento: entrata del foglio, poi fluttua piano ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: float 7s ease-in-out .8s infinite; }
  .sheet__paper { animation: lift .8s var(--ease) both; }
  .note__dot { animation: pulse 1.8s ease-in-out infinite; }
  /* il marchio sboccia: i petali partono chiusi e si aprono a ventaglio */
  .petal { animation: bloom 1.2s var(--ease) both; }
  @keyframes bloom { from { transform: rotate(0deg) scale(.3); opacity: 0; } }
  @keyframes lift { from { opacity: 0; transform: translateY(24px) rotate(4deg); } }
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
  }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 181, 71, .25); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 181, 71, .08); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .js .sheet .fill, .js .sheet.is-filling .fill { transition: none; animation: none; }
}
