/* Couleurs reprises de Framely : palette Ambre « heure dorée » (défaut) et écrin navy. */
:root {
  color-scheme: light dark;
  --bg: #FEF7FF; --surface: #F7F2FA; --surface-high: #ECE6F0;
  --text: #1D1B20; --text-dim: #49454F;
  --primary: #A05E00; --on-primary: #FFFFFF;
  --container: #FFDDB0; --on-container: #2A1800; --mark-2: #FFB74D;
  --a0: 151 85 30; --a1: 160 94 0; --a2: 143 76 60; --a3: 110 93 72;
  --on-aurora: #FFFFFF; --on-aurora-dim: rgba(255, 255, 255, .88);
  --cta-bg: #FFFFFF; --cta-text: #2A1800; --phone-edge: #1D1B20;
  --cols: 5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131C; --surface: #1C1F28; --surface-high: #262A33;
    --text: #E1E2EC; --text-dim: #C4C6D0;
    --primary: #FFB74D; --on-primary: #452B00;
    --container: #6A4A12; --on-container: #FFDDB0;
    --a0: 249 182 116; --a1: 255 183 77; --a2: 243 180 155; --a3: 216 195 164;
    --on-aurora: #2A1800; --on-aurora-dim: rgba(42, 24, 0, .84);
    --cta-bg: #2A1800; --cta-text: #FFDDB0; --phone-edge: #31343E;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(27px, 4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 600; }

.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: 16px; }
section { margin-top: clamp(64px, 9vw, 104px); }
.lede { color: var(--text-dim); margin-top: 10px; max-width: 58ch; }

/* En-tête */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 24px; font-weight: 700; color: var(--primary); }
.brand svg { width: 42px; height: 30px; flex: none; }
.brand svg.square { width: 34px; height: 34px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: border-radius .3s cubic-bezier(.3, 1.4, .5, 1), transform .15s ease;
}
.pill:hover { border-radius: 16px; }
.pill:active { transform: scale(.97); }
.pill svg { width: 20px; height: 20px; flex: none; }
a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* Hero aurora */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px;
  min-height: 560px; padding: clamp(28px, 6vw, 64px);
  border-radius: 28px;
  background:
    radial-gradient(circle at var(--x4, 15%) var(--y4, 5%), rgba(255, 255, 255, .14), transparent 55%),
    radial-gradient(circle at var(--x3, 35%) var(--y3, 55%), rgb(var(--a3) / .55), transparent 70%),
    radial-gradient(circle at var(--x2, 5%) var(--y2, 95%), rgb(var(--a2) / .85), transparent 100%),
    radial-gradient(circle at var(--x1, 92%) var(--y1, 8%), rgb(var(--a1) / .9), transparent 95%),
    rgb(var(--a0));
  color: var(--on-aurora);
}
.hero::before { /* grain, comme la carte d'accueil de l'app */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-text { align-self: center; }
.hero h1 { font-size: clamp(38px, 6.4vw, 62px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.hero-text > p { margin-top: 18px; font-size: clamp(17px, 2vw, 19px); color: var(--on-aurora-dim); max-width: 34ch; }
.cta { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.pill.big { min-height: 56px; padding: 14px 26px; font-size: 17px; background: var(--cta-bg); color: var(--cta-text); }
.pill.big svg { width: 24px; height: 24px; }
.cta small { font-size: 14px; color: var(--on-aurora-dim); }

.phones { position: relative; align-self: end; height: 100%; min-height: 460px; margin-bottom: calc(-1 * clamp(28px, 6vw, 64px)); }
.phone {
  border: 7px solid var(--phone-edge); border-radius: 34px; overflow: hidden;
  background: var(--phone-edge); box-shadow: 0 18px 44px rgba(16, 20, 16, .28);
}
.phones .phone { position: absolute; width: min(270px, 62%); }
.phones .front { right: 30%; bottom: -60px; z-index: 1; }
.phones .back { right: 0; bottom: -120px; }

/* Galerie */
.gallery {
  list-style: none; margin: 32px -16px 0; padding: 4px 16px 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(216px, 1fr); gap: 18px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
}
.gallery li { scroll-snap-align: start; }
.gallery .phone { border-width: 5px; border-radius: 26px; box-shadow: none; }
.gallery h3 { margin-top: 14px; }
.gallery p { font-size: 15px; line-height: 1.45; color: var(--text-dim); margin-top: 2px; }
@media (min-width: 1000px) { .gallery { margin-inline: 0; padding-inline: 0; overflow: visible; grid-auto-flow: row; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); } }

/* Fonctions */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin-top: 32px; }
.card { background: var(--surface); border-radius: 20px; padding: 22px; }
.card p { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--text-dim); }
.bubble {
  width: 52px; height: 52px; border-radius: 50%; margin-bottom: 14px;
  display: grid; place-items: center;
  background: var(--container); color: var(--on-container);
}
.bubble svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.swatches { display: flex; gap: 8px; margin-top: 12px; }
.swatches i { width: 26px; height: 26px; border-radius: 50%; }

/* Vie privée */
.private {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px 48px;
  background: var(--container); color: var(--on-container);
  border-radius: 28px; padding: clamp(28px, 5vw, 48px);
}
.private ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.private li { padding-left: 30px; position: relative; }
.private li::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 7px;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(-45deg);
}
.private .note { grid-column: 1 / -1; font-size: 15px; line-height: 1.5; opacity: .88; }

/* Installation */
.steps { list-style: none; padding: 0; margin: 32px 0 0; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.steps li { counter-increment: s; background: var(--surface); border-radius: 20px; padding: 22px; }
.steps li::before {
  content: counter(s); display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: 12px;
  background: var(--primary); color: var(--on-primary); font-weight: 700;
}
.steps p { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--text-dim); }
.after { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.after p { color: var(--text-dim); font-size: 16px; max-width: 62ch; }

footer { margin-top: 72px; padding-block: 24px 32px; color: var(--text-dim); font-size: 14px; }

@media (max-width: 820px) {
  .private { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; min-height: 0; }
  .phones { min-height: 380px; margin-bottom: 0; height: auto; }
  .phones .front { right: auto; left: 50%; transform: translateX(-50%); bottom: auto; top: 12px; width: min(280px, 82%); }
  .phones .back { display: none; }
  .top .pill { padding-inline: 16px; }
}
@media (max-width: 420px) {
  .pill.big { width: 100%; padding-inline: 16px; font-size: 16px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill { transition: none; }
}

/* Animations : le contenu reste visible sans JS (la classe .js est posée par main.js). */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-text > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .16s; }
.phones .phone { transition: translate .5s cubic-bezier(.2, .8, .2, 1); }
.phones .front { translate: var(--px, 0px) var(--py, 0px); }
.phones .back { translate: calc(var(--px, 0px) * -.6) calc(var(--py, 0px) * -.6 + var(--sy, 0px)); }
.js .reveal { opacity: 0; transform: translateY(26px) scale(.985); transition: opacity .6s ease var(--d, 0s), transform .7s cubic-bezier(.2, 1.1, .3, 1) var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.card, .steps li { transition: background-color .25s ease, border-radius .35s cubic-bezier(.3, 1.4, .5, 1), opacity .6s ease var(--d, 0s), transform .7s cubic-bezier(.2, 1.1, .3, 1) var(--d, 0s); }
.card:hover, .steps li:hover { background: var(--surface-high); border-radius: 28px; }
.bubble { transition: border-radius .4s cubic-bezier(.3, 1.4, .5, 1), rotate .4s cubic-bezier(.3, 1.4, .5, 1); }
.card:hover .bubble { border-radius: 16px; rotate: -6deg; }
.gallery .phone { transition: translate .4s cubic-bezier(.2, 1.1, .3, 1); }
.gallery li:hover .phone { translate: 0 -8px; }
@media (prefers-reduced-motion: reduce) {
  .hero-text > * { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card, .steps li, .bubble, .gallery .phone, .phones .phone { transition: none; }
}

/* Pastilles de palette : un vrai sélecteur, comme dans les réglages de l'app. */
.swatches { gap: 10px; }
.swatches button {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--c); cursor: pointer;
  outline: 3px solid transparent; outline-offset: 2px;
  transition: border-radius .35s cubic-bezier(.3, 1.4, .5, 1), outline-color .2s ease;
}
.swatches button:hover { border-radius: 14px; }
.swatches button[aria-pressed="true"] { border-radius: 14px; outline-color: var(--primary); }
.swatches button:focus-visible { outline-color: var(--text); }
.hint { font-size: 14px !important; margin-top: 10px !important; }

/* Widget du hero : la forme se transforme à chaque photo, comme les 16 formes de l'app. */
.widget-demo { align-self: center; justify-self: center; text-align: center; width: min(400px, 100%); animation: rise .8s cubic-bezier(.2, .8, .2, 1) .1s both; }
.widget {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 16px 26px rgba(30, 16, 0, .32));
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
}
.widget:hover { transform: scale(1.02); }
.widget:active { transform: scale(.97); }
.widget:focus-visible { outline: 3px solid var(--on-aurora); outline-offset: 6px; border-radius: 28px; }
.frame {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12%;
  transition: clip-path .75s cubic-bezier(.3, 1.25, .45, 1);
}
.js .frame { border-radius: 0; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; }
.frame img + img { opacity: 0; }
.widget-demo p { margin-top: 14px; font-size: 14px; color: var(--on-aurora-dim); }
@media (max-width: 820px) { .widget-demo { width: min(320px, 100%); padding-bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { .frame, .widget, .frame img { transition: none; } .widget-demo { animation: none; } }
