/*
 * Site de Popino : thème sombre, accents pastel irisés.
 * Couleurs reprises de mobile/src/ui/theme/palette.ts (source de vérité) : à garder synchronisées
 * (vérifié par tools/site-palette.test.mjs). Aucune couleur en dur ailleurs : passer par ces variables.
 */
:root {
  --background: #0e0c13;
  --surface: #1a1721;
  --text: #f6f3fb;
  --text-muted: #b4adc4;
  --primary: #f7b2d0;
  --on-primary: #1c1424;
  --border: #2c2836;
  --danger: #ff8a8a;
  --gradient-1: #fbc4dc;
  --gradient-2: #dccbfa;
  --gradient-3: #bfe1fb;
  --gradient: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
  --aurora-1: #fbc4dc;
  --aurora-2: #dccbfa;
  --aurora-3: #bfe1fb;
  --aurora-4: #c6f1df;
  --aurora-5: #fde3c8;
  --aurora: linear-gradient(135deg, var(--aurora-1), var(--aurora-2), var(--aurora-3), var(--aurora-4), var(--aurora-5));
  --rating-hate: #c9b6f7;
  --rating-dislike: #aebcf3;
  --rating-neutral: #cfc8db;
  --rating-like: #f9bcd6;
  --rating-love: #ff9cc6;

  --radius: 20px;
  --radius-small: 12px;
  --content: 68rem;
  --prose: 44rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

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

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 750;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40rem) {
  .container {
    padding: 0 1.5rem;
  }
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* En-tête */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

.site-nav ul {
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
}

@media (max-width: 30rem) {
  .site-nav .optional {
    display: none;
  }
}

/* Boutons en pilule */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.2;
}

.button:hover {
  border-color: var(--text-muted);
}

.button-primary {
  border: 0;
  background: var(--gradient);
  color: var(--on-primary);
}

.button-primary:hover {
  filter: brightness(1.05);
}

.button[aria-disabled='true'] {
  cursor: default;
}

.button small {
  display: block;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.button-store {
  gap: 0.5em;
  padding: 0.7rem 1.5rem;
}

/* Logo du store, monochrome : prend la couleur du texte du bouton. */
.button-store svg {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Accueil : hero */
.hero {
  position: relative;
  padding: 4rem 0 3.5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 46rem;
  height: 46rem;
  background: var(--aurora);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  z-index: -1;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero {
    padding: 6rem 0 5rem;
  }

  .hero-grid {
    grid-template-columns: 1.3fr 1fr;
  }
}

.hero .tagline {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.8em;
}

.hero .pitch {
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 1.8rem;
}

/* Téléphones : captures de l'application dans un cadre d'appareil, en CSS. */
.phone {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 17rem;
  padding: 0.55rem;
  border-radius: 2.6rem;
  background: linear-gradient(160deg, var(--border), var(--surface) 45%, var(--background));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent),
    0 0 0 1px color-mix(in srgb, var(--background) 80%, transparent),
    0 40px 80px -30px color-mix(in srgb, var(--gradient-2) 30%, transparent),
    0 24px 48px -24px color-mix(in srgb, var(--background) 90%, transparent);
}

/* Île de l'appareil photo, posée sur la barre d'état. */
.phone::before {
  content: '';
  position: absolute;
  top: 1.15rem;
  left: 50%;
  width: 28%;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--background);
  transform: translateX(-50%);
  z-index: 1;
}

/* Écran : une barre d'état, puis la capture. */
.phone img {
  width: 100%;
  height: auto;
  padding-top: 2.1rem;
  border-radius: 2.1rem;
  background: var(--background);
}

.hero-phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 1rem 0 0;
}

.hero-phones .phone-front {
  max-width: 15.5rem;
  z-index: 1;
}

.hero-phones .phone-back {
  display: none;
}

@media (min-width: 40rem) {
  .hero-phones .phone-back {
    display: block;
    max-width: 13.5rem;
    margin-right: -4.5rem;
    margin-bottom: 2.5rem;
    transform: rotate(-6deg);
    opacity: 0.9;
  }
}

/* Texte et téléphone côte à côte. */
.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.split > .phone {
  justify-self: center;
  max-width: 16rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
  }
}

/* Visite de l'application : trois écrans légendés, défilants sur mobile. */
.tour {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 17rem);
  gap: 1.5rem;
  margin: 0 -1rem;
  padding: 0.5rem 1rem 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.tour li {
  scroll-snap-align: center;
}

.tour .phone {
  margin: 0 auto 1.4rem;
}

.tour h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.tour p {
  margin: 0;
  color: var(--text-muted);
}

@media (min-width: 52rem) {
  .tour {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Sections */
.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 52rem) {
  .section {
    padding: 5rem 0;
  }
}

.section-intro {
  max-width: 40rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.median-note {
  margin-top: 1.5rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  max-width: 46rem;
}

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

/* Cartes */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

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

/* Promesses : liste éditoriale, une icône teintée par promesse. */
.kicker {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.features {
  display: grid;
  gap: 0 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  --tint: var(--aurora-1);
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.feature:nth-child(6n + 2) {
  --tint: var(--aurora-2);
}

.feature:nth-child(6n + 3) {
  --tint: var(--aurora-3);
}

.feature:nth-child(6n + 4) {
  --tint: var(--aurora-4);
}

.feature:nth-child(6n + 5) {
  --tint: var(--aurora-5);
}

.feature:nth-child(6n + 6) {
  --tint: var(--rating-love);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.1rem;
  border-radius: 0.85rem;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 14%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 28%, transparent);
}

.feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.feature h3 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
}

/* Bloc « fabrication » */
.made {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .made {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Appel final */
.cta {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1.5rem;
  border-radius: calc(var(--radius) * 1.4);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  isolation: isolate;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--aurora);
  opacity: 0.1;
  z-index: -1;
}

.cta p {
  color: var(--text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.cta .button-row {
  justify-content: center;
  margin-top: 1.5rem;
}

/* Pages de texte (juridique, support) */
.page {
  padding: 3rem 0 4rem;
}

.prose {
  max-width: var(--prose);
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.prose h2 {
  font-size: 1.45rem;
  margin-top: 2.2em;
}

.prose h3 {
  margin-top: 1.6em;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li::marker {
  color: var(--primary);
}

.meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: var(--surface);
}

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

.todo {
  padding: 0.05em 0.45em;
  border-radius: 6px;
  border: 1px dashed var(--danger);
  color: var(--danger);
  font-weight: 700;
  white-space: nowrap;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

thead th {
  background: var(--surface);
  border-top: 0;
  white-space: nowrap;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0 !important;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--on-primary);
  font-weight: 800;
  font-size: 0.9rem;
}

.ui-label {
  padding: 0.05em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Pied de page */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 52rem) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--text-muted);
}

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

.site-footer p {
  margin: 0.4rem 0 0;
}

/* 404 */
.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 0;
}

.not-found img {
  width: 6rem;
  margin: 0 auto 1.5rem;
}

.not-found .button-row {
  justify-content: center;
}
