/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
  --accent: #5597e6;
  --accent-light: #74aff0;
  --accent-dark: #3a7bd5;
  --accent-cyan: #38c2d4;
  --accent-bg: #eef4fd;
  --text: #1a1a2e;
  --text-muted: #505070;
  --bg: #ffffff;
  --bg-alt: #f6f8fd;
  --border: #dde6f5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(85, 151, 230, 0.1);
  --shadow-hover: 0 8px 32px rgba(85, 151, 230, 0.22);
  --transition: 0.2s ease;
  --max-width: 1100px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

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

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

/* ===========================
   LAYOUT
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

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

a[target="_blank"]::after {
  content: '';
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.2em;
  vertical-align: 0.08em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  opacity: 0.6;
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 64px;
}

.nav-inner .logo       { grid-column: 1; }
.nav-inner #main-nav   { grid-column: 2; justify-content: center; }
.nav-inner .nav-hamburger { grid-column: 3; }

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo-tagline {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  line-height: 1;
}

.logo-img {
  height: 38px;
  width: auto;
  flex-shrink: 0;
}

.footer-logo-img {
  height: 28px;
}

.navbar nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--transition);
}

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

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.85rem;
}

.lang-switch:hover {
  border-color: var(--accent);
}

select.lang-switch {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  font-weight: 500;
}

select.lang-switch option {
  background-color: var(--bg);
  color: var(--text);
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #1a2a4a 0%, #2a4a8a 45%, #1e6fa0 100%);
  color: white;
  padding: 6rem 0 5rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(85, 151, 230, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(56, 194, 212, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  height: 120px;
  width: auto;
  margin-bottom: 1.5rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.3rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero h1 .accent {
  background: linear-gradient(90deg, #74aff0, #38c2d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

@keyframes accentIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes accentOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
.accent--out { animation: accentOut 0.4s ease-in forwards; }
.accent--in  { animation: accentIn  0.4s ease-out forwards; }

.tagline {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  opacity: 0.85;
  margin-bottom: 0;
  max-width: 580px;
  line-height: 1.65;
}

.hero-sep {
  text-align: center;
  margin: 1.25rem auto;
  font-size: 1.1rem;
  opacity: 0.5;
}

.hero-editions {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  opacity: 0.85;
  margin-bottom: 2.5rem;
  max-width: 580px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-version {
  font-size: 0.85rem;
  opacity: 0.65;
  letter-spacing: 0.01em;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 60px;
  display: block;
}

.hero-wave path {
  fill: var(--bg);
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 1.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(85, 151, 230, 0.4);
}

.btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.btn-outline-blue {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.72rem 1.65rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
}

.btn-outline-blue:hover {
  background: var(--accent-bg);
  color: var(--accent-dark);
  transform: translateY(-2px);
}

/* ===========================
   FEATURES
   =========================== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
}

.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===========================
   DOWNLOAD
   =========================== */
.download-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.download-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.release-notes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.release-notes li {
  font-size: 0.925rem;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.download-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dl-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dl-buttons-main {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.dl-buttons-main .btn,
.dl-buttons-main .btn-outline-blue {
  flex: 1;
  justify-content: center;
}

.checksum-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checksum-link:hover {
  color: var(--accent);
}

.sysreq {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
}

.sysreq-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.sysreq ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sysreq ul li {
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  gap: 0.4rem;
}

.sysreq ul li span {
  font-weight: 700;
  color: var(--accent);
  min-width: 70px;
}

.sysreq-tool {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.torrent-note {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===========================
   COMMUNITY
   =========================== */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.community-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.community-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
  color: var(--text);
}

.community-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.discord-icon  { background: #eef0ff; color: #5865f2; }
.matrix-icon   { background: #f0f0f0; color: #0d0d0d; }
.framagit-icon { background: #fff0e8; color: #e24329; }
.twitch-icon   { background: #f3eeff; color: #9147ff; }
.patreon-icon  { background: #fff5e8; color: #ff424d; }
.faq-icon      { background: var(--accent-bg); }

/* ===========================
   DARK MODE
   =========================== */

/* Logo swap */
.logo-img--dark { display: none; }

/* Via préférence OS (sans override explicite) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --accent-bg:    #0d1e35;
    --text:         #e2e8f4;
    --text-muted:   #8896b0;
    --bg:           #0f1117;
    --bg-alt:       #161b27;
    --border:       #1e2d45;
    --shadow:       0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 8px 32px rgba(85, 151, 230, 0.18);
  }
  html:not([data-theme="light"]) .navbar       { background: rgba(15, 17, 23, 0.92); }
  html:not([data-theme="light"]) .discord-icon  { background: #1a1d3a; color: #7289da; }
  html:not([data-theme="light"]) .matrix-icon   { background: #1e1e1e; color: #cccccc; }
  html:not([data-theme="light"]) .framagit-icon { background: #2a1510; color: #e24329; }
  html:not([data-theme="light"]) .patreon-icon  { background: #2a1010; color: #ff6467; }
  html:not([data-theme="light"]) .logo-img--dark  { display: block; }
  html:not([data-theme="light"]) .logo-img--light { display: none; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  html:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
}

/* Via toggle explicite */
html[data-theme="dark"] {
  --accent-bg:    #0d1e35;
  --text:         #e2e8f4;
  --text-muted:   #8896b0;
  --bg:           #0f1117;
  --bg-alt:       #161b27;
  --border:       #1e2d45;
  --shadow:       0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 8px 32px rgba(85, 151, 230, 0.18);
}
html[data-theme="dark"] .navbar       { background: rgba(15, 17, 23, 0.92); }
html[data-theme="dark"] .discord-icon  { background: #1a1d3a; color: #7289da; }
html[data-theme="dark"] .matrix-icon   { background: #1e1e1e; color: #cccccc; }
html[data-theme="dark"] .framagit-icon { background: #2a1510; color: #e24329; }
html[data-theme="dark"] .patreon-icon  { background: #2a1010; color: #ff6467; }
html[data-theme="dark"] .logo-img--dark  { display: block; }
html[data-theme="dark"] .logo-img--light { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* Bouton toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all var(--transition);
  line-height: 0;
}

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

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

.community-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.community-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.community-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.community-card:hover .community-link {
  color: var(--accent-dark);
}

/* ===========================
   DONATEURS
   =========================== */
.matrix-heart {
  color: #e53e3e;
  font-size: 0.85em;
  filter: drop-shadow(0 2px 6px rgba(229, 62, 62, 0.55)) drop-shadow(0 1px 2px rgba(229, 62, 62, 0.35));
}

.donor-heart {
  text-align: center;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 10px rgba(85, 151, 230, 0.45)) drop-shadow(0 1px 2px rgba(58, 123, 213, 0.3));
}

.donors-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.donor-chip {
  background: var(--accent-bg);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.donate-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.donate-cta p {
  color: var(--text-muted);
  text-align: center;
}

html[data-theme="dark"] .donor-chip {
  background: rgba(85, 151, 230, 0.12);
  color: var(--accent-light);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: #111827;
  color: rgba(255, 255, 255, 0.65);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.footer-copy {
  font-size: 0.875rem;
}

.footer-copy a {
  color: var(--accent-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

/* ===========================
   HAMBURGER
   =========================== */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  color: var(--text);
  transition: border-color var(--transition);
}

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

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .download-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    display: flex;
    justify-content: space-between;
  }

  .nav-hamburger {
    display: flex;
  }

  .navbar nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }

  .navbar nav.open {
    display: flex;
  }

  .navbar nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text);
  }

  .navbar nav .lang-switch {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
  }

  .navbar nav .theme-toggle {
    margin-top: 0.25rem;
    border: none;
    border-radius: 0;
    padding: 0.75rem 0;
    justify-content: flex-start;
    width: 100%;
    color: var(--text-muted);
    gap: 0.5rem;
  }

  .hero {
    padding: 4rem 0 3.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .features,
  .community-grid {
    grid-template-columns: 1fr;
  }

  .dl-buttons-main {
    flex-direction: column;
  }

  .footer-links {
    gap: 1rem;
  }
}
