/* Thème shadcn (oklch) — clair par défaut, sombre via préférences ou .dark */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.147 0.004 49.25);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.147 0.004 49.25);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.147 0.004 49.25);
  --primary: oklch(0.216 0.006 56.043);
  --primary-foreground: oklch(0.985 0.001 106.423);
  --secondary: oklch(0.97 0.001 106.424);
  --secondary-foreground: oklch(0.216 0.006 56.043);
  --muted: oklch(0.97 0.001 106.424);
  --muted-foreground: oklch(0.553 0.013 58.071);
  --accent: oklch(0.97 0.001 106.424);
  --accent-foreground: oklch(0.216 0.006 56.043);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.923 0.003 48.717);
  --input: oklch(0.923 0.003 48.717);
  --ring: oklch(0.709 0.01 56.259);
  --chart-1: oklch(0.869 0.005 56.366);
  --chart-2: oklch(0.553 0.013 58.071);
  --chart-3: oklch(0.444 0.011 73.639);
  --chart-4: oklch(0.374 0.01 67.558);
  --chart-5: oklch(0.268 0.007 34.298);
  --radius: 0.375rem;
  --sidebar: oklch(0.985 0.001 106.423);
  --sidebar-foreground: oklch(0.147 0.004 49.25);
  --sidebar-primary: oklch(0.216 0.006 56.043);
  --sidebar-primary-foreground: oklch(0.985 0.001 106.423);
  --sidebar-accent: oklch(0.97 0.001 106.424);
  --sidebar-accent-foreground: oklch(0.216 0.006 56.043);
  --sidebar-border: oklch(0.923 0.003 48.717);
  --sidebar-ring: oklch(0.709 0.01 56.259);

  /* Alias utilisés par les styles du site */
  --bg: var(--background);
  --surface: var(--card);
  --text: var(--foreground);
  --text-muted: var(--muted-foreground);
  --primary-hover: oklch(0.268 0.007 34.298);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.06);
  --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --background: oklch(0.147 0.004 49.25);
    --foreground: oklch(0.985 0.001 106.423);
    --card: oklch(0.216 0.006 56.043);
    --card-foreground: oklch(0.985 0.001 106.423);
    --popover: oklch(0.216 0.006 56.043);
    --popover-foreground: oklch(0.985 0.001 106.423);
    --primary: oklch(0.923 0.003 48.717);
    --primary-foreground: oklch(0.216 0.006 56.043);
    --secondary: oklch(0.268 0.007 34.298);
    --secondary-foreground: oklch(0.985 0.001 106.423);
    --muted: oklch(0.268 0.007 34.298);
    --muted-foreground: oklch(0.709 0.01 56.259);
    --accent: oklch(0.268 0.007 34.298);
    --accent-foreground: oklch(0.985 0.001 106.423);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.553 0.013 58.071);
    --chart-1: oklch(0.869 0.005 56.366);
    --chart-2: oklch(0.553 0.013 58.071);
    --chart-3: oklch(0.444 0.011 73.639);
    --chart-4: oklch(0.374 0.01 67.558);
    --chart-5: oklch(0.268 0.007 34.298);
    --sidebar: oklch(0.216 0.006 56.043);
    --sidebar-foreground: oklch(0.985 0.001 106.423);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0.001 106.423);
    --sidebar-accent: oklch(0.268 0.007 34.298);
    --sidebar-accent-foreground: oklch(0.985 0.001 106.423);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.553 0.013 58.071);
    --primary-hover: oklch(0.985 0.001 106.423);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.35);
  }
}

html.dark {
  color-scheme: dark;
  --background: oklch(0.147 0.004 49.25);
  --foreground: oklch(0.985 0.001 106.423);
  --card: oklch(0.216 0.006 56.043);
  --card-foreground: oklch(0.985 0.001 106.423);
  --popover: oklch(0.216 0.006 56.043);
  --popover-foreground: oklch(0.985 0.001 106.423);
  --primary: oklch(0.923 0.003 48.717);
  --primary-foreground: oklch(0.216 0.006 56.043);
  --secondary: oklch(0.268 0.007 34.298);
  --secondary-foreground: oklch(0.985 0.001 106.423);
  --muted: oklch(0.268 0.007 34.298);
  --muted-foreground: oklch(0.709 0.01 56.259);
  --accent: oklch(0.268 0.007 34.298);
  --accent-foreground: oklch(0.985 0.001 106.423);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.553 0.013 58.071);
  --primary-hover: oklch(0.985 0.001 106.423);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.35);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

.wrap {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklch, var(--background) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-tld {
  color: var(--muted-foreground);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

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

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

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.hero h1 em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted-foreground);
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 34ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground) !important;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: var(--background);
  color: var(--foreground) !important;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground) !important;
}

.hero-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-badges li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Demo window */
.demo-window {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.demo-titlebar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.demo-titlebar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.demo-titlebar span:first-child {
  background: var(--destructive);
}
.demo-titlebar span:nth-child(2) {
  background: var(--chart-1);
}
.demo-titlebar span:nth-child(3) {
  background: var(--chart-2);
}

.demo-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  padding: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.demo-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.demo-pane {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--muted);
}

.demo-after {
  background: var(--secondary);
}

.demo-arrow {
  align-self: center;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
}

mark.pii {
  background: color-mix(in oklch, var(--destructive) 18%, transparent);
  color: var(--destructive);
  padding: 0 2px;
  border-radius: var(--radius);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

h1,
h2,
h3,
.section h2,
.types h2,
.cta-bottom h2,
.card h3,
.download-card h3,
.requirements h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.card h3,
.download-card h3,
.requirements h3 {
  font-size: 1.125rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 55ch;
  margin: 0 0 2.5rem;
}

.features {
  background: var(--surface);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

/* Lucide */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  flex-shrink: 0;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-lg {
  width: 1.75rem;
  height: 1.75rem;
}

.icon-xl {
  width: 2.5rem;
  height: 2.5rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

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

/* Types */
.types {
  background: var(--primary);
  color: var(--primary-foreground);
}

.types h2 {
  color: var(--primary-foreground);
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-list li {
  padding: 0.45rem 1rem;
  background: oklch(1 0 0 / 0.08);
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: 999px;
  font-size: 0.9rem;
}

.disclaimer {
  font-size: 0.9rem;
  opacity: 0.85;
  max-width: 60ch;
}

.disclaimer a {
  color: var(--primary-foreground);
}

/* Register / access */
.access {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.register-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.register-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.register-row input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.register-row input[type="email"]:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.register-result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.register-result-new {
  background: var(--muted);
}

.register-result-existing {
  background: var(--secondary);
}

.register-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.5;
}

.register-success-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.register-hint {
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.license-key {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  user-select: all;
}

.register-error {
  color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 12%, transparent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* Download */
.download {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.download-card:hover {
  border-color: var(--ring);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.download-soon {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  color: var(--foreground);
  font-size: 0.9rem;
}

.download-card-soon {
  opacity: 0.75;
  cursor: not-allowed;
  pointer-events: none;
}

.download-grid-disabled .download-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.download-card h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.35rem;
}

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

.os-icon {
  color: var(--primary);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.requirements-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.requirements-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.requirements-list li:last-child {
  margin-bottom: 0;
}

.file-meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.download-latest-hint {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.download-latest-hint a {
  font-weight: 500;
}

.requirements {
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.requirements h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.requirements .requirements-list {
  color: var(--text-muted);
}

.build-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1rem;
  background: var(--muted);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.build-note code {
  font-size: 0.8em;
}

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
}

.faq p {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
}

/* CTA bottom */
.cta-bottom {
  background: var(--primary);
  color: var(--primary-foreground);
  text-align: center;
}

.cta-bottom h2 {
  color: var(--primary-foreground);
}

.cta-bottom-inner p {
  color: color-mix(in oklch, var(--primary-foreground) 85%, transparent);
  max-width: 50ch;
  margin: 0 auto 1.5rem;
}

.cta-bottom .btn-primary {
  background: var(--primary-foreground);
  color: var(--primary) !important;
}

.cta-bottom .btn-primary:hover {
  background: color-mix(in oklch, var(--primary-foreground) 90%, transparent);
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0.25rem 0;
}

.footer-small {
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .cards,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .demo-body {
    grid-template-columns: 1fr;
  }

  .demo-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .nav {
    display: none;
  }

  .lead {
    max-width: none;
  }
}
