/* Polaris – homepage dell'associazione.
   Stessi colori, carattere e sfondo animato dell'app, sempre in versione notte ("Notte stellata"). */
:root {
  --navy: #0B2350;
  --text: #EEF3FA;
  --soft: #C4D2E6;
  --accent: #8ED2F5;
  --accent-hover: #B5E1F8;
  --on-accent: #0B2350;
  --line: rgba(142, 210, 245, .28);
  --panel: rgba(11, 35, 80, .62);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
}
/* Immagine ferma: resta se il mare animato non parte o se si riduce il movimento */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--navy) url("img/sfondo.webp") center bottom / cover no-repeat;
}
@media (max-width: 600px) { body::before { background-image: url("img/sfondo-small.webp"); } }
/* Mare in movimento (js/sea.js): quando parte, sostituisce l'immagine */
#sea-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; }
html.sea-on body::before { display: none; }

/* Una sola lingua alla volta */
html[data-lang="it"] [lang="en"],
html[data-lang="en"] [lang="it"] { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Barra in alto */
.bar {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem clamp(1.25rem, 5vw, 3.5rem);
}
.bar-home { display: block; line-height: 0; border-radius: 6px; }
.bar-name { display: block; height: 2.75rem; width: auto; }
.bar-nav { margin-left: auto; display: flex; gap: .25rem; }
.bar-nav a {
  color: var(--soft); text-decoration: none; font-size: .9375rem;
  padding: .5rem .75rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.bar-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

.lang { display: flex; gap: .25rem; }
.lang button {
  font: inherit;
  font-size: .9375rem;
  color: var(--soft);
  background: none;
  border: 0;
  padding: .5rem .75rem;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); font-weight: 500; }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }

/* Prima schermata */
main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3.5rem); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(2rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem);
}
h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.125rem, 5.2vw, 3.75rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.lead { margin: 0 0 2.25rem; max-width: 34rem; color: var(--soft); font-size: 1.1875rem; }

.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.button {
  display: inline-block;
  padding: .9rem 1.6rem;
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .15s;
}
.button:hover { background: var(--accent-hover); }
.note { margin: 0; color: var(--soft); font-size: .9375rem; }

/* Il logo è già un oblò: lo teniamo grande e basta */
.porthole { margin: 0; justify-self: center; width: min(100%, 26rem); }
.porthole img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .4));
  animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Sezioni: ogni blocco è un pannello di vetro, così il testo resta leggibile sul mare */
html { scroll-behavior: smooth; }
.block, .closing { scroll-margin-top: 1rem; }
.block {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.block-head { max-width: 40rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
h2 { margin: 0 0 .75rem; font-size: clamp(1.625rem, 3.4vw, 2.375rem); line-height: 1.15; font-weight: 600; letter-spacing: -.015em; }
.block-head p { margin: 0; color: var(--soft); font-size: 1.125rem; }

/* Una funzione: schermata dell'app e spiegazione, a lati alterni */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
}
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); }
.feature:nth-of-type(even) .phone { order: 2; }
.feature-text h3 { margin: 0 0 .6rem; font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.2; font-weight: 500; }
.feature-text p { margin: 0; max-width: 34rem; color: var(--soft); }

.phone { margin: 0; justify-self: center; width: 100%; max-width: 17rem; }
.phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1520;
  background: #0B2350;
  border: 7px solid #060f24;
  border-radius: 34px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px rgba(0, 0, 0, .4);
}

.facts { margin: 0; padding: 0; list-style: none; max-width: 44rem; }
.facts li { padding: 1rem 0; border-top: 1px solid var(--line); color: var(--soft); }
.facts li:first-child { border-top: 0; padding-top: 0; }

/* Invito finale */
.closing {
  margin-bottom: clamp(3rem, 8vw, 6rem);
  padding: clamp(1rem, 3vw, 2rem) 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
}
.closing h2 { margin: 0; }

footer {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 5vw, 3.5rem) 2rem;
  color: var(--soft);
  font-size: .9375rem;
}

@media (max-width: 900px) { .bar-nav { display: none; } .bar-home { margin-right: auto; } }
@media (max-width: 760px) {
  .bar-name { height: 2rem; }
  .hero { grid-template-columns: 1fr; }
  .porthole { order: -1; width: min(70%, 15rem); justify-self: start; }
  .feature, .feature:nth-of-type(even) { grid-template-columns: 1fr; gap: 1.25rem; }
  .feature:nth-of-type(even) .phone { order: 0; }
  .phone { max-width: 15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .porthole img { animation: none; }
  .button { transition: none; }
}
