:root {
  color-scheme: light dark;
  --moon: 0;
  /* Tema Chiaro: pulito e arioso, con accenti Blu e Oro */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-subtle: #eef2f9;
  --fg: #0f172a;
  --muted: #526077;
  --accent: #1e4b8f;
  --on-accent: #ffffff;
  --accent-2: #b88428;
  --border: #e1e7f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --header-bg: rgba(245, 247, 251, 0.85);
  --title-grad: linear-gradient(100deg, #0b172a 10%, #1e4b8f 58%, #b58021 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --moon: 1;
    /* Tema Scuro: Midnight Royal sobrio e riposante */
    --bg: #09101e;
    --surface: #111b2e;
    --surface-subtle: #162238;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --accent: #68a6f8;
    --on-accent: #09101e;
    --accent-2: #e5c178;
    --border: #1e2d47;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
    --header-bg: rgba(9, 16, 30, 0.85);
    --title-grad: linear-gradient(100deg, #ffffff 10%, #93c5fd 55%, #e8c983 100%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --moon: 1;
  --bg: #09101e;
  --surface: #111b2e;
  --surface-subtle: #162238;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --accent: #68a6f8;
  --on-accent: #09101e;
  --accent-2: #e5c178;
  --border: #1e2d47;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(9, 16, 30, 0.85);
  --title-grad: linear-gradient(100deg, #ffffff 10%, #93c5fd 55%, #e8c983 100%);
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER MINIMALE
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-link:hover {
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-right: 6px;
  font-size: 14px;
  font-weight: 500;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--fg);
  text-decoration: none;
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
}

/* ==========================================================================
   CONTENUTO PRINCIPALE E HERO SOBRIA
   ========================================================================== */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 48px) 84px;
}

.hero-section {
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 44px;
}

h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 12px;
  background: var(--title-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(17px, 2vw, 19.5px);
  color: var(--muted);
  max-width: 38em;
  margin: 0 0 20px;
  line-height: 1.5;
}

.subtitle strong {
  color: var(--fg);
  font-weight: 600;
}

.hero-lead {
  max-width: 68ch;
  margin: 20px 0 0;
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.65;
}

h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 52px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}

h2::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose {
  max-width: 740px;
}

.nav {
  margin-bottom: 14px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
}

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

/* ==========================================================================
   PULSANTI DI DOWNLOAD E DONAZIONE
   ========================================================================== */
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 8px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  background: var(--fg);
  color: var(--bg);
  padding: 12px 22px 12px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  opacity: 0.94;
  text-decoration: none;
}

.download-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent-2);
}

.download-btn .dl-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.download-btn .dl-text strong {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.download-btn .dl-text small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.78;
}

.download-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.donate-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
  text-decoration: none;
}

/* ==========================================================================
   LISTE NORMALI
   ========================================================================== */
ul, ol {
  padding-left: 24px;
  margin: 0 0 16px;
}

li {
  margin-bottom: 6px;
}

/* ==========================================================================
   CARD GENERALI
   ========================================================================== */
.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--fg);
}

.notice-card {
  border-left: 4px solid var(--accent-2);
  margin: 20px 0 8px;
  max-width: 740px;
}

/* ==========================================================================
   FUNZIONALITÀ (GRID 3 COLONNE)
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.feature-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.feature-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--fg);
}

.feature-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  flex-grow: 1;
}

/* ==========================================================================
   COME INIZIARE (STEPS GRID 3 COLONNE)
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 20%, transparent);
  color: var(--accent-2);
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 12px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.35;
}

.step-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  flex-grow: 1;
}

/* ==========================================================================
   FAQ COLLASSABILI (ACCORDION)
   ========================================================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.faq-item[open] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.15s ease;
}

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

.faq-summary:hover {
  background: var(--surface-subtle);
}

.faq-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.faq-item[open] > .faq-summary .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 22px 20px;
  font-size: 15px;
  color: var(--fg);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  line-height: 1.65;
}

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

.faq-answer p:last-child {
  margin-bottom: 0;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 680px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

.tech-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 14px;
}

.tech-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--fg);
  font-size: 14.5px;
}

.tech-box p {
  margin: 0 0 8px;
  line-height: 1.55;
}

.tech-box p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   ASSISTENZA E SOSTEGNO (SUPPORT GRID 2 COLONNE)
   ========================================================================== */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 680px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
}

.support-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  margin: 0;
  padding: 22px 24px;
}

.support-card .card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.support-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--fg);
}

.support-card p {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  flex-grow: 1;
}

.support-action {
  margin-top: auto;
  display: flex;
  align-items: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: var(--surface-subtle);
  color: var(--fg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 999px;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ==========================================================================
   PAGINA DOWNLOAD (RELEASE GRID 2X2 & ISTRUZIONI)
   ========================================================================== */
.release-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 16px;
}

@media (max-width: 680px) {
  .release-grid {
    grid-template-columns: 1fr;
  }
}

.release-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.release-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.release-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.release-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge-beta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
}

.release-req {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.release-desc {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 18px;
  flex-grow: 1;
}

.release-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.release-actions .download-btn {
  width: 100%;
  justify-content: flex-start;
  margin: 0;
}

.release-links {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 0;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

@media (max-width: 680px) {
  .install-grid {
    grid-template-columns: 1fr;
  }
}

.install-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  font-size: 14.5px;
  line-height: 1.6;
}

.install-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15.5px;
  color: var(--fg);
}

.install-card p {
  margin: 0;
  color: var(--muted);
  flex-grow: 1;
}

/* ==========================================================================
   PRIVACY LIST (RETE ED ELABORAZIONE)
   ========================================================================== */
.privacy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.privacy-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
}

.privacy-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--fg);
  font-size: 15.5px;
}

/* ==========================================================================
   CONTROLLI LINGUA, TEMA E FOOTER
   ========================================================================== */
footer {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
}

.lang-toggle button.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
}

.theme-core, .theme-rays, .theme-cut {
  transform-origin: 12px 12px;
  transition: transform 0.35s ease;
}

.theme-core { transform: scale(calc(1 + 0.6 * var(--moon))); }
.theme-rays { transform: rotate(calc(90deg * var(--moon))) scale(calc(1 - var(--moon))); }
.theme-cut {
  fill: var(--surface);
  transform: translate(calc((1 - var(--moon)) * 14px), calc((var(--moon) - 1) * 14px));
}

@media (prefers-reduced-motion: reduce) {
  .theme-core, .theme-rays, .theme-cut { transition: none; }
}

[data-lang="en"] { display: none; }
:root[lang="en"] [data-lang="it"] { display: none; }
:root[lang="en"] [data-lang="en"] { display: block; }
