/* Home page ("/"). Needs brand.css first. */

:root {
  --gutter: clamp(20px, 4vw, 48px);
  --section-gap: clamp(56px, 8vw, 96px);
}

.wrap {
  width: 100%;
  max-width: calc(1120px + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ------------------------------------------------------------ type */

.home h1, .home h2, .home h3 { font-family: var(--qard-font-editorial); font-weight: 400; color: var(--qard-ink); }
.home h1 {
  margin: 20px 0 20px;
  font-size: clamp(38px, 28.69px + 2.483vw, 56px);
  line-height: clamp(42px, 32.69px + 2.483vw, 60px);
}
.home h2 {
  margin: 0 0 32px;
  font-size: clamp(28px, 23.86px + 1.103vw, 36px);
  line-height: clamp(34px, 29.86px + 1.103vw, 42px);
  max-width: 760px;
}
.home h3 { margin: 0 0 8px; font-size: 24px; line-height: 30px; }
.home p { margin: 0; }
.accent { color: var(--qard-royal); }
.lead { color: var(--qard-muted); font-size: 18px; line-height: 28px; max-width: 520px; margin-bottom: 32px !important; }
@media (min-width: 768px) { .lead { font-size: 20px; line-height: 30px; } }
.measure { max-width: 640px; margin-top: 40px !important; }
.caption { font-size: 12px; line-height: 18px; color: var(--qard-muted); }

/* ------------------------------------------------------------ header and footer */

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.site-logo { display: block; line-height: 0; }
.site-logo img { width: 168px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 8px; }
@media (max-width: 359px) { .site-header { gap: 8px; } .site-nav { gap: 4px; } .site-logo img { width: 148px; } }
.site-login {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  font-weight: 600; font-size: 14px; line-height: 20px; text-decoration: none; white-space: nowrap;
}
.site-login:hover { text-decoration: underline; }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: var(--section-gap); padding-top: 24px; padding-bottom: 40px;
  /* A rule across the content width only (the padding is the gutter). */
  background: linear-gradient(var(--qard-border), var(--qard-border)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--qard-muted); font-size: 13px; line-height: 20px;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--qard-muted); font-weight: 600; }
.site-footer a:hover { color: var(--qard-ink); }

/* ------------------------------------------------------------ hero */

.hero { display: grid; gap: 48px; padding-top: 24px; }
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 40px; padding-top: 48px; }
}

/* The demo: one printed card, a trail of squares, the destination it currently opens.
   Stacked (vertical trail) by default; side by side once it fits next to the text. */
.demo {
  --card-w: 300px;
  --phone-w: 248px;
  display: grid;
  grid-template-columns: minmax(0, 300px);
  grid-template-areas: "card" "trail" "switch" "phone" "foot";
  justify-items: start;
  align-items: center;
}
@media (min-width: 1216px) {
  .demo {
    --card-w: 280px;
    grid-template-columns: var(--card-w) 72px var(--phone-w);
    grid-template-areas:
      ".    switch switch"
      "card trail  phone"
      "foot foot   foot";
  }
}

/* The printed card: business-card proportions (85:55). */
.demo-card {
  grid-area: card;
  width: 100%; max-width: var(--card-w);
  aspect-ratio: 85 / 55;
  margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  padding: 16px;
  background: var(--qard-white);
  border: 1px solid var(--qard-border);
  border-radius: var(--qard-radius-card);
}
.demo-card-text { display: flex; flex-direction: column; min-width: 0; }
.demo-card-name { font-family: var(--qard-font-editorial); font-size: 22px; line-height: 28px; }
.demo-card-line { margin-top: 4px !important; font-size: 13px; line-height: 18px; }
.demo-card-scan { margin-top: auto !important; font-size: 11px; line-height: 16px; color: var(--qard-muted); }
/* 33 modules (25 + a 4-module quiet zone on each side), 3 px each. */
.demo-qr { display: block; align-self: end; width: 99px; height: 99px; }

/* The trail: kept well away from the QR (card padding + gap of 12 px or more). */
.demo-trail { grid-area: trail; display: flex; flex-direction: column; gap: 6px; padding: 16px 0 16px 24px; }
@media (min-width: 1216px) { .demo-trail { flex-direction: row; justify-self: center; padding: 0 11px; } }
.demo-trail i { display: block; width: 8px; height: 8px; background: var(--qard-border); }
.demo-trail i:last-child { background: var(--qard-royal); }
.demo-trail i { animation-duration: 700ms; animation-timing-function: ease; animation-fill-mode: both; }
.demo-trail i:nth-child(2) { animation-delay: 100ms; }
.demo-trail i:nth-child(3) { animation-delay: 200ms; }
.demo-trail i:nth-child(4) { animation-delay: 300ms; }
/* One identical animation per destination, so it plays again on every change (with or without JavaScript). */
.demo:has(input[value="profil"]:checked) .demo-trail i { animation-name: trail-a; }
.demo:has(input[value="reservation"]:checked) .demo-trail i { animation-name: trail-b; }
.demo:has(input[value="evenement"]:checked) .demo-trail i { animation-name: trail-c; }
@keyframes trail-a { 0%, 100% { background: var(--qard-border); } 35% { background: var(--qard-royal); } }
@keyframes trail-b { 0%, 100% { background: var(--qard-border); } 35% { background: var(--qard-royal); } }
@keyframes trail-c { 0%, 100% { background: var(--qard-border); } 35% { background: var(--qard-royal); } }
.demo:has(input:checked) .demo-trail i:last-child { animation-name: none; }

/* The switch: a real radio group, styled as a segmented control. */
.demo-switch { grid-area: switch; margin: 0 0 12px; padding: 0; border: 0; min-width: 0; width: 100%; }
@media (min-width: 1216px) { .demo-switch { width: auto; justify-self: end; } }
.demo-switch legend { padding: 0; margin-bottom: 8px; }
.seg {
  display: flex; padding: 3px; gap: 2px;
  background: var(--qard-white); border: 1px solid var(--qard-border); border-radius: var(--qard-radius-control);
}
.seg label { position: relative; flex: 1 1 auto; display: flex; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 8px; border-radius: 6px;
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--qard-muted); white-space: nowrap;
}
.seg label:hover span { color: var(--qard-ink); }
.seg input:checked + span { background: var(--qard-royal); color: var(--qard-white); }
.seg input:focus-visible + span { outline: 2px solid var(--qard-ink); outline-offset: 2px; }
@media (max-width: 359px) { .seg span { font-size: 12px; padding: 6px 6px; } }

/* The phone frame: fixed size, so nothing jumps when the screen changes. */
.phone {
  grid-area: phone;
  position: relative;
  width: var(--phone-w); height: 400px;
  border: 6px solid var(--qard-ink); border-radius: 28px;
  background: var(--qard-paper);
  overflow: hidden;
}
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 28px 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}
.demo:has(input[value="profil"]:checked) .screen-profil,
.demo:has(input[value="reservation"]:checked) .screen-reservation,
.demo:has(input[value="evenement"]:checked) .screen-evenement {
  opacity: 1; visibility: visible; transition: opacity 300ms ease, visibility 0s;
}
@supports not selector(:has(*)) { .screen-profil { opacity: 1; visibility: visible; } }
.screen-profil { align-items: center; text-align: center; }
.screen .eyebrow { margin-bottom: 8px; }
.ph-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin-bottom: 12px; border-radius: 50%;
  background: var(--qard-lavender); color: var(--qard-royal);
  font-family: var(--qard-font-editorial); font-size: 24px; line-height: 1;
}
.home .ph-title { font-family: var(--qard-font-editorial); font-size: 22px; line-height: 28px; }
.home .ph-text { margin: 4px 0 20px; font-size: 13px; line-height: 20px; color: var(--qard-muted); }
.ph-btn {
  display: flex; align-items: center; justify-content: center; align-self: stretch;
  min-height: 44px; padding: 10px 12px; margin-top: 8px;
  border: 1px solid var(--qard-border); border-radius: var(--qard-radius-control);
  background: var(--qard-white); color: var(--qard-ink);
  font-size: 13px; line-height: 18px; font-weight: 600; text-align: center;
}
.ph-btn-main { background: var(--qard-royal); border-color: var(--qard-royal); color: var(--qard-white); }
.ph-slots { display: grid; gap: 8px; align-self: stretch; margin-bottom: 8px; }
.ph-slots span {
  padding: 8px 12px; border: 1px solid var(--qard-border); border-radius: var(--qard-radius-control);
  background: var(--qard-white); font-size: 13px; line-height: 18px; font-weight: 600;
}
.ph-slots .on { background: var(--qard-royal); border-color: var(--qard-royal); color: var(--qard-white); }

/* Status and caption. The status shows after a switch: JavaScript marks it; without it, CSS does. */
.demo-foot { grid-area: foot; margin-top: 16px; }
.demo-status { min-height: 20px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--qard-royal); visibility: hidden; }
.demo.is-updated .demo-status,
.demo:not(.has-js):has(input[value="reservation"]:checked, input[value="evenement"]:checked) .demo-status { visibility: visible; }
.demo-foot .caption { margin-top: 4px; }

/* ------------------------------------------------------------ sections */

.section { margin-top: var(--section-gap); scroll-margin-top: 24px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.step-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--qard-radius-control);
  background: var(--qard-lavender); color: var(--qard-royal);
  font-weight: 600; font-size: 16px; line-height: 24px;
}
.steps p, .uses p { color: var(--qard-muted); }

.uses { display: grid; gap: 24px; }
@media (min-width: 768px) { .uses { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.uses > div { padding-top: 20px; border-top: 1px solid var(--qard-border); }

.offers { display: grid; gap: 16px; }
@media (min-width: 768px) { .offers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.offer { padding: 28px 24px; border: 1px solid var(--qard-border); border-radius: var(--qard-radius-card); background: var(--qard-white); }
@media (min-width: 768px) { .offer { padding: 32px; } }
.offer-paid { background: var(--qard-lavender); border-color: var(--qard-lavender); }
.offer-line { margin-top: 4px !important; color: var(--qard-royal); font-weight: 600; }
.ticks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 20px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; background: var(--qard-royal); }
.offers-note { margin-top: 16px !important; font-size: 14px; line-height: 20px; color: var(--qard-muted); }

/* Closing band: violet panel, the logo on a light cartouche. */
.closing {
  padding: 40px 24px;
  border-radius: var(--qard-radius-card);
  background: var(--qard-royal); color: var(--qard-white);
}
@media (min-width: 768px) { .closing { padding: 64px 56px; } }
.home .closing h2 { color: var(--qard-white); margin-bottom: 12px; }
.closing-text { font-size: 18px; line-height: 28px; }
.cartouche {
  display: inline-block; margin-top: 32px; padding: 16px 20px;
  border-radius: var(--qard-radius-control); background: var(--qard-paper); line-height: 0;
}
.cartouche img { width: clamp(160px, 50vw, 200px); height: auto; }
.closing-note { margin-top: 24px !important; font-size: 13px; line-height: 20px; }

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .screen, .demo:has(input:checked) .screen { transition: none !important; }
  .demo-trail i { animation: none !important; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Keeps a hyphenated word on one line (the demo's "rendez-vous"). */
.nowrap { white-space: nowrap; }
