/*
 * Site public de Dixit (accueil, pages légales, aide, pages de partage).
 * Thème unique sombre, aux couleurs de l'app :
 *   noir #0A0A0A, blanc cassé #F4F3EF, accent lime #E4FF4A (liens et éléments
 *   actifs seulement), gris #8A8A86.
 * Polices (Google Fonts, chargées dans chaque page) : Instrument Serif pour les
 * titres, Geist pour le texte, Geist Mono pour les étiquettes.
 * Mobile d'abord : les règles de base visent un téléphone, les @media élargissent.
 * Après une modification, incrémenter ?v= dans les balises <link> des pages
 * (les assets sont mis en cache 30 jours par nginx).
 */

:root {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #1c1c1c;
  --border: #2a2a2a;
  --text: #f4f3ef;
  --text-soft: #a3a39e;
  --muted: #8a8a86;
  --accent: #e4ff4a;
  --on-accent: #0a0a0a;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --maxw: 760px;

  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  /* Adresses e-mail et URL longues : retour à la ligne plutôt que débordement */
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

strong {
  font-weight: 600;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Étiquette en capitales espacées (Geist Mono) */

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Logo : bulle lime + x italique, et mot « dixit » */

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 14%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  line-height: 1;
}

.logo-mark span {
  display: block;
  transform: translateY(-0.08em);
}

.logo-mark.is-large {
  width: 84px;
  height: 84px;
  font-size: 72px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text);
}

.wordmark em {
  font-style: italic;
  color: var(--accent);
}

/* En-tête */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

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

.lang-switch {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.lang-switch li {
  display: flex;
  align-items: center;
}

.lang-switch li + li::before {
  content: "·";
  color: var(--muted);
}

.lang-switch a,
.lang-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  cursor: pointer;
}

.lang-switch a:hover,
.lang-switch button:hover {
  color: var(--text);
}

.lang-switch [aria-current="true"],
.lang-switch [aria-pressed="true"] {
  color: var(--accent);
}

/* Accueil */

.hero {
  padding: 56px 0 40px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.hero-brand .wordmark {
  font-size: 64px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 9.5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

.rate-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.2;
  color: var(--text-soft);
  margin: 0 0 32px;
}

.rotator {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
  color: var(--accent);
}

.rotator-track {
  display: block;
  animation: rotate-words 7.5s infinite;
}

.rotator-track > span {
  display: block;
  height: 1.2em;
}

@keyframes rotate-words {
  0%, 26% { transform: translateY(0); }
  33%, 59% { transform: translateY(-1.2em); }
  66%, 92% { transform: translateY(-2.4em); }
  99.9% { transform: translateY(-3.6em); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rotator {
    height: auto;
    overflow: visible;
    vertical-align: baseline;
  }

  .rotator-track {
    animation: none;
    display: inline;
  }

  .rotator-track > span {
    display: inline;
    height: auto;
  }

  .rotator-track > span + span::before {
    content: " ";
  }

  .rotator-track > span[aria-hidden="true"]:last-child {
    display: none;
  }
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 176px;
  min-height: 56px;
  padding: 8px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.store-badge small {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.store-badge strong {
  font-size: 18px;
  font-weight: 600;
}

.store-badge:hover {
  border-color: var(--accent);
}

.store-badge.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.store-badge.is-primary small {
  color: #3a3f12;
}

.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.1;
  margin: 8px 0 24px;
}

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.steps .label {
  display: block;
  margin-bottom: 8px;
}

.steps strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.steps span:last-child {
  color: var(--text-soft);
  font-size: 16px;
}

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

.features li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}

.features li:last-child {
  border-bottom: 0;
}

.features strong {
  color: var(--text);
}

.cards {
  display: grid;
  gap: 12px;
}

.card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.card strong {
  display: block;
  margin-bottom: 2px;
}

.card span {
  color: var(--muted);
  font-size: 15px;
}

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

@media (min-width: 640px) {
  .steps,
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Pages de contenu (légal, aide) */

.page {
  padding: 48px 0 72px;
}

.page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 9vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.page .intro {
  color: var(--text-soft);
  font-size: 19px;
  margin: 0 0 12px;
}

.page .updated {
  margin: 0 0 32px;
}

.page .lang-note {
  color: var(--text-soft);
  font-size: 15px;
  margin: -16px 0 32px;
}

.page h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  margin: 48px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.page h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.page p,
.page ul,
.page ol {
  margin: 0 0 14px;
}

.page ul,
.page ol {
  padding-left: 22px;
}

.page li {
  margin-bottom: 8px;
}

.page li::marker {
  color: var(--muted);
}

.callout {
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0 0 24px;
}

.callout .label {
  display: block;
  margin-bottom: 6px;
}

.callout p:last-child,
.callout ul:last-child,
.callout ol:last-child {
  margin-bottom: 0;
}

.path {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(0.94);
}

.button.is-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

td:first-child {
  min-width: 150px;
}

td {
  overflow-wrap: anywhere;
}

/* Téléphone : chaque ligne de tableau devient une fiche (libellé de colonne
   repris de l'attribut data-label), plus de défilement horizontal caché. */
@media (max-width: 599px) {
  .table-wrap {
    overflow-x: visible;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .table-wrap table {
    font-size: 16px;
  }

  .table-wrap tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  .table-wrap tr:last-child {
    border-bottom: 0;
  }

  .table-wrap td {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .table-wrap td + td {
    margin-top: 10px;
  }

  .table-wrap td:first-child {
    font-weight: 600;
  }

  .table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 10px;
}

summary {
  position: relative;
  padding: 16px 48px 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 20px;
  color: var(--muted);
}

details[open] summary::after {
  content: "−";
}

details > :not(summary) {
  margin-left: 20px;
  margin-right: 20px;
}

details > :last-child {
  margin-bottom: 18px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

/* 404 et pages de partage */

.center-page {
  padding: 72px 0 88px;
  text-align: center;
}

.center-page .logo-mark {
  margin-bottom: 28px;
}

.center-page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 9vw, 56px);
  line-height: 1.08;
  margin: 0 0 14px;
}

.center-page p {
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto 24px;
}

.center-page .code {
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.share-handle {
  display: inline-block;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 20px;
}

.share-handle:empty {
  display: none;
}

.center-page .actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.center-page .stores {
  justify-content: center;
}

.center-page .hint {
  font-size: 14px;
  color: var(--muted);
}

/* Pied de page */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 32px 0 40px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  margin-bottom: 12px;
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer p {
  margin: 0 0 4px;
}

/* Petits écrans : boutons des stores de même largeur, empilés proprement */
@media (max-width: 420px) {
  .stores .store-badge {
    flex: 1 1 100%;
    min-width: 0;
  }

  .center-page .stores {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .site-header .container {
    gap: 8px;
  }

  .header-nav {
    gap: 10px;
  }
}

/* iPhone en paysage : rien sous l'encoche */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}
