/* =========================================================
   Octaivo — stile Apple: tanto spazio, movimenti fluidi,
   tipografia grande, transizioni morbide.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --accent: #6a3df5;
  --accent-soft: rgba(106, 61, 245, 0.12);
  --line: rgba(0, 0, 0, 0.08);
  --card-bg: #ffffff;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #0d0d10;
    --text: #f5f5f7;
    --text-dim: #a1a1a6;
    --accent: #a78bfa;
    --accent-soft: rgba(167, 139, 250, 0.16);
    --line: rgba(255, 255, 255, 0.12);
    --card-bg: #151517;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-soft), background 0.4s var(--ease-soft);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(0, 0, 0, 0.6); }
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.8;
  transition: opacity 0.25s var(--ease-soft);
}
.main-nav a:hover { opacity: 1; }
.main-nav a.nav-cta {
  background: var(--text);
  color: var(--bg);
  padding: 7px 16px;
  border-radius: 999px;
  opacity: 1;
}
.main-nav a.nav-cta:hover { background: var(--accent); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + 64px) 24px 40px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 20px;
}

.hero-sub {
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}

.hero-stage { margin-top: 56px; }

.hero-image-wrap {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.35);
  background: #a9c4de;
}

.hero-img { width: 100%; height: auto; user-select: none; pointer-events: none; }
.hero-img-base { filter: saturate(0.55) brightness(0.88); }
.hero-img-highlight {
  position: absolute;
  inset: 0;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.6s var(--ease);
}
.hero-image-wrap.spotlight-on .hero-img-highlight {
  clip-path: circle(var(--spot-r, 12%) at var(--spot-x, 50%) var(--spot-y, 50%));
}

/* Hotspots */
.hotspot {
  position: absolute;
  left: var(--hx);
  top: var(--hy);
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.hotspot-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  animation: pulse 2.6s ease-in-out infinite;
}
.hotspot-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  opacity: 0.9;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.hotspot:hover .hotspot-dot,
.hotspot:focus-visible .hotspot-dot,
.hotspot.active .hotspot-dot {
  transform: scale(1.35);
  background: var(--accent);
}
.hotspot:hover .hotspot-dot::after,
.hotspot:focus-visible .hotspot-dot::after,
.hotspot.active .hotspot-dot::after {
  transform: scale(1.25);
  border-color: var(--accent);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

/* ---------- Section shell ---------- */
section { padding: 100px 24px; }
.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
}
.section-sub { color: var(--text-dim); font-size: 17px; margin: 0; }

/* ---------- Regole del progetto ---------- */
.rules-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rules-list li {
  counter-increment: rule;
  position: relative;
  padding: 4px 0 4px 52px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  min-height: 36px;
  display: flex;
  align-items: center;
}
.rules-list li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Community ---------- */
.community { background: var(--bg-alt); }
.community-grid {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-card {
  padding: 36px 16px;
}
.stat-number {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat-label {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .community-grid { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Entrate e uscite ---------- */
.finance-panel {
  max-width: 780px;
  margin: 0 auto;
}
.finance-empty {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}
.finance-empty code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
  margin-bottom: 32px;
}
.finance-summary .num {
  display: block;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.finance-summary .lbl {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.finance-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-dim);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-entrate { background: var(--accent); }
.dot-uscite { background: #ff6b6b; }
.finance-scroll { overflow-x: auto; }
.finance-scroll svg { display: block; margin: 0 auto; }
.bar-entrate { fill: var(--accent); }
.bar-uscite { fill: #ff6b6b; }
.bar-label { fill: var(--text-dim); font-size: 12px; }

/* ---------- Suggerisci un metodo ---------- */
.suggest-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.suggest-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.25s var(--ease-soft);
}
.suggest-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.suggest-form .btn-primary {
  align-self: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.suggest-form .btn-primary:disabled { opacity: 0.6; cursor: default; }
.suggest-status {
  min-height: 20px;
  text-align: center;
  font-size: 14px;
  margin: 0;
}
.suggest-status-ok { color: #1a8a3d; }
.suggest-status-error { color: #ff6b6b; }
@media (prefers-color-scheme: dark) {
  .suggest-status-ok { color: #4ade80; }
}

/* ---------- Roadmap ---------- */
.roadmap-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.roadmap-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.roadmap-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.22);
}
.roadmap-card h3 { font-size: 18px; margin: 0 0 8px; letter-spacing: -0.01em; }
.roadmap-card p { margin: 0 0 16px; color: var(--text-dim); font-size: 14px; line-height: 1.5; }

.status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}
.status-testato { background: rgba(52, 199, 89, 0.15); color: #1a8a3d; }
.status-in-corso { background: rgba(255, 159, 10, 0.15); color: #b5750a; }
.status-in-arrivo { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .status-testato { color: #4ade80; }
  .status-in-corso { color: #fbbf24; }
}

/* ---------- CTA ---------- */
.cta-section {
  text-align: center;
  background: var(--text);
  color: var(--bg);
  border-radius: 32px;
  max-width: 1100px;
  margin: 0 auto 100px;
}
.cta-section h2 { font-size: clamp(26px, 3.6vw, 38px); margin: 0 0 12px; letter-spacing: -0.02em; }
.cta-section .section-sub { color: rgba(255, 255, 255, 0.65); margin-bottom: 32px; }
@media (prefers-color-scheme: dark) {
  .cta-section { background: var(--bg-alt); color: var(--text); }
  .cta-section .section-sub { color: var(--text-dim); }
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px -12px var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-contact { margin-top: 8px; }
.footer-contact a {
  color: var(--accent);
  text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-soft);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--card-bg);
  color: var(--text);
  max-width: 460px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 40px 32px;
  position: relative;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.4s var(--ease);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
}
.modal-close:hover { background: var(--line); transform: rotate(90deg); }

.modal h3 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 16px 0; margin-top: 8px; }
.modal-body p { color: var(--text-dim); line-height: 1.6; font-size: 15px; }
.modal-body ul { margin: 0; padding-left: 20px; color: var(--text-dim); line-height: 1.8; font-size: 15px; }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.modal-stats div { text-align: center; }
.modal-stats .num { font-size: 20px; font-weight: 800; color: var(--accent); }
.modal-stats .lbl { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.modal-method-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.modal-method-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 14px;
  font-size: 14px;
}
.modal-method-list .m-name { display: flex; align-items: center; gap: 10px; }

.modal-cta {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}
.modal-cta:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  section { padding: 72px 20px; }
  .main-nav { gap: 16px; }
  .main-nav a:not(.nav-cta) { display: none; }
}
