/* ============================================================
   CTC-Velay — Mini-site landing + pages légales
   Mobile-first, system fonts (zéro requête réseau pour les fonts),
   palette accessible (contraste AA), prefers-color-scheme dark.
   ============================================================ */

:root {
  --brand: #E25C2C;
  --brand-dark: #B84520;
  --brand-tint: #FDEFE7;
  --fg: #1A1A1A;
  --fg-muted: #555555;
  --bg: #FFFFFF;
  --bg-soft: #F7F7F7;
  --stroke: #E4E4E7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --container-max: 880px;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #FF7A47;
    --brand-dark: #FF9069;
    --brand-tint: #2A1810;
    --fg: #F5F5F5;
    --fg-muted: #A8A8AA;
    --bg: #111114;
    --bg-soft: #1B1B1E;
    --stroke: #2D2D31;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* Reset minimal mais propre */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
  margin: 0 0 0.5em 0;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-top: 1.5em; }
h3 { font-size: 1.1rem; margin-top: 1.25em; }

p { margin: 0 0 1em 0; }
ul { margin: 0 0 1em 0; padding-left: 1.25em; }
li { margin: 0.25em 0; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--stroke);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
}
.brand:hover { color: var(--fg); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-name { font-size: 1rem; }

.site-header nav { display: flex; gap: 16px; }
.site-header nav a {
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--brand); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 56px 0 32px;
  text-align: left;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--fg-muted);
  max-width: 60ch;
  margin-bottom: 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.1s ease;
}
.cta:active { transform: translateY(1px); }
.cta-primary {
  background: var(--brand);
  color: #fff;
}
.cta-primary:hover { background: var(--brand-dark); color: #fff; }
.cta-secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--stroke);
}
.cta-secondary:hover {
  background: var(--brand-tint);
  border-color: var(--brand);
}

/* ============================================================
   Sections
   ============================================================ */
.install, .features {
  padding: 40px 0;
  border-top: 1px solid var(--stroke);
}
.install p { max-width: 60ch; color: var(--fg-muted); }

.features-grid {
  list-style: none;
  padding: 0;
  margin: 24px 0 0 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.features-grid li {
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  margin: 0;
}
.features-grid h3 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  color: var(--brand);
}
.features-grid p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* ============================================================
   Pages légales (politique de confidentialité, mentions légales)
   ============================================================ */
.legal-page {
  padding: 40px 0 80px;
}
.legal-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 32px;
}
.legal-header h1 {
  margin-bottom: 8px;
}
.legal-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.legal-page section {
  margin-bottom: 32px;
}
.legal-page section h2 {
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  margin-top: 0;
}
.legal-page section:first-of-type h2 {
  border-top: none;
  padding-top: 0;
}

/* ============================================================
   Pages d'erreur (404, 500, 403)
   ============================================================ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px); /* header + footer ~= 200px */
  padding: 40px 0;
}
.error-wrap {
  text-align: center;
  max-width: 560px;
}
.error-code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}
.error-page h1 {
  margin-top: 0;
  margin-bottom: 12px;
}
.error-lede {
  color: var(--fg-muted);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 28px;
}
.error-page .cta-row {
  justify-content: center;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 24px 0;
  background: var(--bg-soft);
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
}
.site-footer a {
  color: var(--fg-muted);
  text-decoration: underline;
}
.site-footer a:hover { color: var(--brand); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-header nav {
    width: 100%;
    justify-content: flex-start;
  }
  .hero { padding-top: 32px; }
  .cta { width: 100%; justify-content: center; }
  .cta-row { flex-direction: column; }
}

/* Réduction des animations pour les personnes sensibles */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
