/* ===================================================================
   Terremoto — landing page
   Brand palette from the iOS app (Colors.xcassets):
   olive #647848 · dark olive #323B24 · lime #8ED937 · green #629625
   Dark theme over an animated seismic-map background.
   =================================================================== */

:root {
  --olive: #647848;
  --olive-dark: #323B24;
  --bg-deep: #242A1A;      /* app dark-mode tableBackground */
  --bg-deepest: #10130B;   /* app dark-mode detailCardBackground */
  --lime: #8ED937;
  --green: #629625;

  --text: #ecf0e3;
  --text-muted: #b4bfa2;
  --border: rgba(174, 191, 149, 0.16);
  --surface: rgba(44, 53, 32, 0.82);
  --veil: rgba(10, 14, 5, 0.26);           /* darkens sections over the map */

  --accent: var(--lime);

  --radius: 16px;
  --container: 1120px;
}

/* app-name wordmark font, same as the iOS app */
@font-face {
  font-family: "WeblySleek UI";
  src: url("../fonts/weblysleekuisl.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-deep);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Animated map background ===== */

.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 800px at 70% 8%, var(--olive-dark) 0%, var(--bg-deep) 52%, var(--bg-deepest) 100%);
}

/* content sits above the fixed background layer */
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.bg-scene svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bg-grid { opacity: 0.05; }

.bg-sea {
  fill: #000000;
  opacity: 0.13;
}

.bg-coast {
  fill: none;
  stroke: #aebf95;
  stroke-width: 1.4;
  opacity: 0.14;
}

.bg-contour path {
  fill: none;
  stroke: #aebf95;
  stroke-width: 1;
  opacity: 0.09;
}

.bg-river {
  fill: none;
  stroke: #9fc9c0;
  stroke-width: 1;
  opacity: 0.10;
}

.bg-town circle {
  fill: #cfe0b8;
  opacity: 0.16;
}

/* seismic waves — radius, speed and brightness set per-event via custom props */
.quake .epi {
  fill: var(--qc, var(--lime));
  opacity: 0.45;
}

.quake .ring {
  fill: none;
  stroke: var(--qc, var(--lime));
  animation: quakeRing var(--dur, 5s) linear infinite;
}

@keyframes quakeRing {
  0% {
    r: 3px;
    opacity: var(--op, 0.25);
    stroke-width: 2.5px;
  }
  /* opacity dies at 55% of the cycle; the ring keeps expanding invisibly,
     so expansion speed is unchanged */
  55% {
    opacity: 0;
  }
  100% {
    r: var(--rmax, 120px);
    opacity: 0;
    stroke-width: 0.6px;
  }
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(35, 43, 22, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand img {
  border-radius: 9px;
  display: block;
}

.brand .brand-title {
  height: 22px;
  width: auto;
  border-radius: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
}

.site-nav a:hover { color: #fff; }

/* ===== Buttons ===== */

.btn {
  display: inline-block;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--lime);
  color: #1d2410 !important;
  box-shadow: 0 4px 14px rgba(142, 217, 55, 0.35);
}

.btn-small { padding: 8px 18px; font-size: 0.92rem; }

/* ===== Hero ===== */

.hero {
  position: relative;
  color: #fff;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 40px;
  padding-top: 72px;
  padding-bottom: 96px;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.3rem);
  line-height: 1.12;
  margin: 0 0 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.hero-sub {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 28px;
  max-width: 34em;
}

.hero-sub strong { color: var(--lime); }

.store-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.store-badges img {
  display: block;
  width: auto;
  height: 46px;
}

.hero .store-badges img { height: 42px; }

.hero-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero-qr img {
  border-radius: 10px;
  background: #fff;
  padding: 5px;
}

.hero-visual img {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}

/* ===== Stats ===== */

.stats {
  background: var(--veil);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  padding-top: 44px;
  padding-bottom: 44px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-star { font-size: 1.4rem; vertical-align: 6px; }

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== Sections ===== */

section { scroll-margin-top: 76px; }

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 0 0 14px;
}

.section-title .accent { color: var(--accent); }

.section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 46em;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

/* ===== App screenshots ===== */

.screens { padding: 76px 0 0; }

.screens-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* legacy Edge/IE */
}

.screens-row::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.screen-tile {
  margin: 0;
  flex: 0 0 267px;
  scroll-snap-align: center;
  /* edges fade toward the page background instead of a hard border */
  background: radial-gradient(120% 120% at 50% 30%,
    rgba(44, 53, 32, 0.85) 25%,
    rgba(44, 53, 32, 0.35) 65%,
    rgba(44, 53, 32, 0) 95%);
  border-radius: var(--radius);
  padding: 20px 10px 0;
  overflow: hidden;
  aspect-ratio: 267 / 358;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* matches App Store screenshot typography: SF Pro Display on Apple
   devices, closest system equivalents elsewhere */
.screen-tile figcaption {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, sans-serif;
  font-weight: 500;
  font-size: 1.16rem;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: #ffffff;
  text-align: center;
  margin-bottom: 16px;
}

/* mockups ship with the bezel baked in (transparent corners) — no CSS frame */
.phone-frame {
  width: 94%;
  flex: none;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.4));
}

.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Features ===== */

.features { padding: 84px 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(142, 217, 55, 0.14);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--accent);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.features-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 46em;
  margin: 40px auto 0;
}

.badge-pro {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--lime);
  color: #1d2410;
}

/* ===== Reviews ===== */

.reviews {
  padding: 84px 0;
  background: var(--veil);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rating-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stars {
  color: #f5a623;
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  /* second row fades out, fully transparent ~halfway down */
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
}

.review-card {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 17px 16px 20px;
  min-height: 250px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.review-title {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}

.review-card blockquote {
  margin: 0 0 14px;
  font-size: 0.97rem;
  font-style: italic;
  color: var(--text-muted);
}

.review-card figcaption {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.review-stars {
  flex: none;
  color: #f5a623;
  letter-spacing: 1px;
  font-size: 0.82rem;
}

/* ===== Data sources ===== */

.data-sources { padding: 84px 0; }

.data-cols {
  max-width: 56em;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.data-cols strong { color: var(--text); }

/* ===== FAQ ===== */

.faq { padding: 40px 0 84px; }

.faq-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}

.faq-title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.faq-list details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: #fff;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: #ffffff;
  flex: none;
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::after {
  content: "\2212";
  color: var(--accent);
}

.faq-answer {
  padding: 0 28px 20px 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.faq-answer p { margin: 0 0 10px; }

.faq-answer a { color: var(--accent); }

/* ===== Download CTA ===== */

.download-cta {
  background:
    radial-gradient(900px 400px at 15% 110%, rgba(142, 217, 55, 0.14), transparent 60%),
    var(--veil);
  border-top: 1px solid var(--border);
  color: #fff;
  text-align: center;
  padding: 84px 0;
}

.cta-inner h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  margin: 0 0 8px;
}

.cta-inner h2 img {
  width: 280px;
  max-width: 80%;
  height: auto;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 28px;
}

.cta-icon {
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.download-cta .store-badges {
  justify-content: center;
  gap: 26px;
}

/* ===== Footer ===== */

.site-footer {
  background: rgba(12, 16, 6, 0.5);
  border-top: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.footer-disclaimer {
  padding-top: 16px;
  padding-bottom: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.42);
}

.footer-disclaimer p { margin: 0 0 10px; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 0;
  padding-bottom: 32px;
}

.footer-nav {
  display: flex;
  gap: 22px;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.footer-nav a:hover { color: var(--lime); }

/* ===== Privacy page ===== */

.privacy { padding: 56px 0 84px; }

.privacy-title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

.privacy-content { max-width: 58em; }

/* dark-theme restyle of the iubenda-injected policy container
   (visual styling only; the policy text itself is untouched) */
#iubenda_policy {
  background: transparent !important;
  color: var(--text-muted) !important;
  font-family: inherit !important;
}

#iubenda_policy .iub_container {
  background: transparent !important;
  color: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

#iubenda_policy .iub_content {
  background: transparent !important;
  padding: 0 !important;
}

#iubenda_policy h1,
#iubenda_policy h2,
#iubenda_policy h3,
#iubenda_policy h4,
#iubenda_policy strong {
  color: var(--text) !important;
}

#iubenda_policy a {
  color: var(--accent) !important;
}

#iubenda_policy .iub_footer {
  background: transparent !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border) !important;
}

/* iubenda's expandable "Dettagli sul trattamento" boxes ship with a white
   background; restyle them to the site's dark surface */
#iubenda_policy .box_primary,
#iubenda_policy .expand-click,
#iubenda_policy .expand-content {
  background: transparent !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

#iubenda_policy .box_primary {
  background: var(--surface) !important;
  border-radius: 12px !important;
}

/* ===== Reveal animation ===== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .quake .ring {
    animation: none;
    opacity: 0;
  }
}

/* ===== Responsive ===== */

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 56px;
    padding-bottom: 80px;
    text-align: center;
  }

  .hero-copy h1 br { display: none; }

  .hero-sub { margin-left: auto; margin-right: auto; }

  .store-badges { justify-content: center; }

  .hero-qr { display: none; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .screen-tile { flex-basis: 58vw; }

  .faq-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .feature-grid,
  .review-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav a:not(.btn) { display: none; }

  .screen-tile { flex-basis: 74vw; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  .feature-grid,
  .review-grid { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
