/* Vitrine Meriz. Mêmes tokens que l'application : gris chauds,
   surfaces claires, un seul accent indigo, mono pour les données.
   Animations douces, toutes neutralisées en mouvement réduit. */

:root {
  --shell: #f7f7f5;
  --surface: #ffffff;
  --ink: #1c1c1e;
  --line: #e4e4e7;
  --muted: #52525b;
  --accent: #4338ca;
  --accent-dark: #3730a3;
  --sans: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Roboto Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--shell);
  line-height: 1.6;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 20;
}
.skip-link:focus-visible { left: 8px; }

/* Barre de navigation collante */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
}
.topnav-links a {
  color: var(--ink);
  text-decoration: none;
}
.topnav-links a:hover { color: var(--accent); }
.topnav-links a.button { color: #fff; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand-name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Bannière */
.hero {
  background: linear-gradient(180deg, var(--surface) 0%, #fbfbfa 100%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 64px;
  text-align: center;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.06rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.button:hover {
  background: var(--shell);
  border-color: #d4d4d8;
  color: var(--ink);
}
.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.25);
  /* Toujours blanc sur indigo : jamais indigo sur indigo. */
  color: #fff;
}
.button-small { padding: 7px 14px; font-size: 0.88rem; }
.via {
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0.85;
}

/* Les trois étapes */
.steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 30px 0 0;
  padding: 0;
  font-size: 0.94rem;
  color: var(--muted);
}
.steps li { display: flex; align-items: center; gap: 8px; }
.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 0.75rem var(--mono);
}

/* Vitrine : schéma animé + SQL généré */
.showcase {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  align-items: stretch;
  max-width: 1000px;
  margin: 44px auto 0;
  text-align: left;
}

.preview,
.sqlcard {
  margin: 0;
  background: #fbfbfa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px 10px;
  box-shadow: 0 1px 3px rgba(28, 28, 30, 0.06);
}
.preview svg { width: 100%; height: auto; display: block; }
.preview figcaption,
.sqlcard figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 4px 6px;
}
.sqlcard figcaption { padding-top: 0; }

.sqlcard pre {
  margin: 8px 0 6px;
  overflow-x: auto;
  font: 12px/1.7 var(--mono);
  color: var(--ink);
}
.sqlcard .kw { color: var(--accent); font-weight: 600; }

.svg-title { font: 650 14px var(--sans); fill: var(--ink); }
.svg-attr  { font: 12px var(--mono); fill: var(--ink); }
.svg-key   { font-weight: 600; }
.svg-type  { font: 11px var(--mono); fill: #71717a; }
.svg-card  { font: 12px var(--mono); fill: var(--ink); }

/* Animation du schéma : les entités arrivent, les pattes se
   dessinent, l'association et les cardinalités apparaissent. */
@media (prefers-reduced-motion: no-preference) {
  .anim-entity {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.5s ease-out forwards;
  }
  .anim-right { animation-delay: 0.15s; }
  .anim-assoc {
    opacity: 0;
    transform-origin: 320px 105px;
    transform: scale(0.85);
    animation: pop 0.4s ease-out 0.45s forwards;
  }
  .anim-leg {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: draw 0.45s ease-out 0.7s forwards;
  }
  .anim-leg2 { animation-delay: 0.85s; }
  .anim-pill {
    opacity: 0;
    animation: fade 0.35s ease-out 1.1s forwards;
  }
  .anim-pill2 { animation-delay: 1.25s; }

  @keyframes rise { to { opacity: 1; transform: translateY(0); } }
  @keyframes pop  { to { opacity: 1; transform: scale(1); } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* Sections */
main .container { padding-top: 64px; padding-bottom: 8px; }

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.cards li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(28, 28, 30, 0.05);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.cards li:hover {
  border-color: #c7d2fe;
  box-shadow: 0 6px 18px rgba(28, 28, 30, 0.08);
  transform: translateY(-2px);
}
.cards h3 { margin: 0 0 6px; font-size: 1.03rem; }
.cards p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.mono { font-family: var(--mono); font-size: 0.92em; }

.download { text-align: center; }
.download > p { color: var(--muted); max-width: 560px; margin: 0 auto 8px; }
.download .actions { margin-top: 20px; }
.note { color: var(--muted); font-size: 0.92rem; margin-top: 16px; }

.opensource p { color: var(--muted); max-width: 640px; }

/* Liens de contenu seulement : jamais les boutons, qui gèrent
   leurs propres couleurs (fond plein, texte blanc). */
main a:not(.button),
footer a,
.note a {
  color: var(--accent);
}
main a:not(.button):hover,
footer a:hover,
.note a:hover {
  color: var(--accent-dark);
}

/* Révélation au défilement (activée seulement si le JS tourne et
   si le mouvement n'est pas réduit). */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  }
  html.js .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
  html.js .cards .reveal:nth-child(2) { transition-delay: 0.07s; }
  html.js .cards .reveal:nth-child(3) { transition-delay: 0.14s; }
  html.js .cards .reveal:nth-child(4) { transition-delay: 0.21s; }
}

/* Pied de page */
footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* Écrans étroits */
@media (max-width: 860px) {
  .showcase { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 48px; }
  .topnav-links { gap: 12px; font-size: 0.88rem; }
  .actions .button { flex: 1 1 auto; text-align: center; }
}

/* Mouvement réduit : plus aucune animation ni défilement animé. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Page Télécharger */
.hero-small { padding: 44px 0 40px; }

.reco {
  margin-top: 26px;
}
.reco-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 10px;
}
.button-big {
  font-size: 1.05rem;
  padding: 14px 30px;
}

.os-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.os-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(28, 28, 30, 0.05);
}
.os-card.os-current { border-color: var(--accent); }
.os-card h3 { margin: 0 0 10px; font-size: 1.05rem; }

.dl-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.94rem;
}
.dl-list a { font-weight: 550; }
.dl-size { color: var(--muted); font: 12px var(--mono); }
.badge-reco {
  display: inline-block;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: var(--accent);
  border-radius: 5px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 1px;
}

.os-card details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}
.os-card summary {
  cursor: pointer;
  font-weight: 550;
  color: var(--ink);
}
.os-card details p { margin: 8px 0 0; }

@media (max-width: 860px) {
  .os-cards { grid-template-columns: 1fr; }
}

/* Avertissement de premier lancement : visible d'emblée, ton
   rassurant, jamais caché dans un menu dépliable. */
.dl-warn {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.dl-warn strong { color: var(--ink); }
