:root {
  --bg: #0b1020;
  --surface: #131a2e;
  --elevated: #1b2440;
  --overlay: rgba(7, 10, 21, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --glow-indigo: 0 6px 18px rgba(99, 102, 241, 0.32);
  --glow-indigo-lg: 0 8px 24px rgba(99, 102, 241, 0.45);
  --glow-cyan: 0 0 12px rgba(34, 211, 238, 0.4);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

/* [hidden] must win over component display rules (display:inline-flex etc.) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.halo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 15% 5%, rgba(99, 102, 241, 0.10), transparent 45%);
  z-index: 0;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.625rem; }
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.3));
}
.brand-name { font-weight: 600; font-size: 1rem; }

.version-pill {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
}

/* Layout */
.container {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* Hero */
.hero { text-align: center; margin-bottom: 3rem; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Platform grid */
.platforms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--border-strong);
}
.card.recommended {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.card-header { display: flex; align-items: center; gap: 0.875rem; }
.card-icon {
  width: 48px; height: 48px;
  border-radius: 0.75rem;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
  flex-shrink: 0;
}
.card-title { font-size: 1.25rem; font-weight: 600; }
.card-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.125rem; }
.card-warning {
  font-size: 0.8125rem;
  color: var(--accent-amber);
  line-height: 1.45;
  padding: 0.625rem 0.875rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 0.5rem;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--grad-brand);
  color: white;
  box-shadow: var(--glow-indigo);
}
.btn-primary:hover {
  box-shadow: var(--glow-indigo-lg);
  transform: translateY(-2px);
}

/* Status pill (Windows unavailable) */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--elevated);
  border-radius: 0.5rem;
  align-self: flex-start;
}

/* Auto-highlight pill */
.recommend-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 9999px;
  align-self: flex-start;
}

/* Release notes */
.notes {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  padding: 1.75rem;
}
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.notes-title { font-size: 1.125rem; font-weight: 600; }
.notes-meta { display: flex; gap: 0.75rem; align-items: baseline; }
.notes-version {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-indigo);
}
.notes-date { font-size: 0.8125rem; color: var(--text-muted); }

.notes-content { color: var(--text-secondary); line-height: 1.6; }
.notes-content h1, .notes-content h2, .notes-content h3 {
  color: var(--text-primary);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.notes-content h3 { font-size: 1rem; }
.notes-content ul, .notes-content ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.notes-content li { margin: 0.25rem 0; }
.notes-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.125rem 0.375rem;
  background: var(--elevated);
  border-radius: 0.25rem;
}
.notes-content a { color: var(--accent-indigo); }
.notes-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.25rem 0;
}

/* Historique des versions */
.history { margin-top: 1.5rem; }
.history-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.history-list {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  overflow: hidden;
}
.history-item + .history-item { border-top: 1px solid var(--border-subtle); }
.history-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}
.history-summary::-webkit-details-marker { display: none; }
.history-summary:hover { background: var(--elevated); }
.history-summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.history-item[open] > .history-summary::after { transform: rotate(-135deg); }
.history-body { padding: 0 1.75rem 1.25rem; }

/* Error banner */
.error-banner {
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.5rem;
  color: var(--accent-amber);
  font-size: 0.9375rem;
}
.error-banner a { color: var(--accent-amber); text-decoration: underline; }

/* Skeleton loading */
.card-skeleton {
  height: 180px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--elevated) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: pulse 1.4s ease-in-out infinite;
  border-radius: 0.875rem;
}
@keyframes pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-subtle);
}
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--text-primary); }

/* Responsive */
@media (max-width: 720px) {
  .platforms { grid-template-columns: 1fr; }
  .container { padding: 2rem 1rem 3rem; }
  .hero { margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
