/* =============================================================================
   Mayan & K — Cafés du monde
   Feuille de styles principale

   Sommaire
   01. Tokens de design
   02. Reset & base
   03. Utilitaires & accessibilité
   04. Mise en page (wrap, section, grid)
   05. Typographie de section
   06. Composants  — topbar, hero, boutons, kraft-card, contact
   07. Pied de page
   08. Animations d'apparition
   09. Responsive
   10. Impression
   ========================================================================== */

/* ---------------------------------------------------------------------------
   01. TOKENS DE DESIGN
   Toutes les valeurs réutilisées sont centralisées ici : une seule ligne à
   changer pour ajuster la charte.
   -------------------------------------------------------------------------- */
:root {
  /* Couleurs de marque */
  --c-cream:        #faf3e6;
  --c-cream-alt:    #f4ebdb;
  --c-kraft:        #efe1c4;
  --c-kraft-line:   rgb(62 42 28 / 0.25);
  --c-espresso:     #3e2a1c;
  --c-text:         #5c4632;   /* 8.0:1 sur --c-cream  ✔ AAA */
  --c-rust:         #b65c2c;   /* décoratif uniquement (filets, traits) */
  --c-rust-ink:     #8f4620;   /* 6.2:1 sur --c-cream  ✔ AA — texte & aplats */

  /* Typographie */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body:    "EB Garamond", Georgia, serif;
  --font-ui:      "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-body:      1.1875rem;  /* 19px */
  --lh-body:      1.6;

  /* Rythme & mise en page */
  --wrap-max:     1080px;
  --gutter:       6vw;
  --space-2:      0.5rem;
  --space-3:      0.75rem;
  --space-4:      1rem;
  --space-6:      1.5rem;
  --space-8:      2rem;
  --space-12:     3rem;
  --space-16:     4rem;
  --section-y:    6.875rem;    /* 110px */

  /* Effets */
  --shadow-card:  0 18px 40px rgb(34 25 17 / 0.18);
  --shadow-lift:  0 20px 50px rgb(34 25 17 / 0.20);
  --radius:       2px;
  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------------------------------------------------
   02. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  /* Décale l'ancre sous la barre fixe lors d'un saut vers #contact */
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--c-cream);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--c-espresso);
  text-wrap: balance;
}

p { text-wrap: pretty; }
p + p { margin-top: var(--space-4); }

a { color: inherit; }

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

hr { border: 0; }

/* Anneau de focus visible et cohérent sur tous les éléments interactifs */
:focus-visible {
  outline: 2px solid var(--c-rust-ink);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ---------------------------------------------------------------------------
   03. UTILITAIRES & ACCESSIBILITÉ
   -------------------------------------------------------------------------- */
.list-reset { list-style: none; padding: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Lien d'évitement : masqué jusqu'à réception du focus clavier */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-6);
  background: var(--c-espresso);
  color: var(--c-cream);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-150%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.text-emphasis {
  font-style: italic;
  margin-top: var(--space-4);
}

/* ---------------------------------------------------------------------------
   04. MISE EN PAGE
   -------------------------------------------------------------------------- */
.section {
  padding-block: var(--section-y);
  padding-inline: var(--gutter);
}
.section--cream { background: var(--c-cream); }
.section--alt   { background: var(--c-cream-alt); }

.wrap {
  max-width: var(--wrap-max);
  margin-inline: auto;
}

.grid { display: grid; gap: var(--space-16); }
.grid--story  { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
.grid--rental { grid-template-columns: 1.1fr 0.9fr;  align-items: center; }
.grid--duo    { grid-template-columns: 1fr 1fr; gap: var(--space-8); }

/* ---------------------------------------------------------------------------
   05. TYPOGRAPHIE DE SECTION
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-rust-ink);
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.375rem);
  margin-block: var(--space-3) var(--space-6);
}

.section__head { max-width: 42ch; margin-bottom: var(--space-12); }
.section__head--center {
  margin-inline: auto;
  text-align: center;
}

/* Longueur de ligne confortable (~52 caractères) sans casser les blocs centrés */
.section p { max-width: 52ch; }
.section--cream .contact p,
.section__head--center p,
.contact-card p { margin-inline: auto; }

.signature {
  margin-top: var(--space-8);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--c-rust-ink);
}

/* ---------------------------------------------------------------------------
   06. COMPOSANTS
   -------------------------------------------------------------------------- */

/* --- Esperluette de marque : texte stylé, pas d'image à charger ----------- */
.amp {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--c-rust-ink);
}

/* --- Barre supérieure ---------------------------------------------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--gutter);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-espresso);
  background: transparent;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Classe posée par main.js dès que la page défile */
.topbar.is-scrolled {
  background: rgb(250 243 230 / 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--c-kraft-line);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.25em;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.topbar__link {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: color 0.2s var(--ease);
}
.topbar__link:hover { color: var(--c-rust-ink); }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 7.5rem var(--gutter) 5rem;
  text-align: center;
  background:
    radial-gradient(circle at 30% 20%, rgb(182 92 44 / 0.08), transparent 55%),
    var(--c-cream);
}

.hero__inner { max-width: 40rem; }

.brand-lockup {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  font-size: clamp(2.375rem, 8vw, 3.875rem);
}
.brand-lockup__word {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c-espresso);
}
.brand-lockup--sm { font-size: 1.875rem; margin-bottom: var(--space-2); }

.brand-rule {
  width: 110px;
  height: 1px;
  background: rgb(62 42 28 / 0.35);
  margin: var(--space-6) auto 0;
}

.hero__tagline {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-rust-ink);
  margin-top: var(--space-4);
}

.hero__lede {
  margin: var(--space-6) auto 0;
  max-width: 34ch;
  font-style: italic;
  color: var(--c-text);
}

.hero__cta { margin-top: var(--space-8); }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.875rem 1.875rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--solid {
  background: var(--c-rust-ink);          /* 6.2:1 avec le texte crème ✔ AA */
  color: var(--c-cream);
  box-shadow: 0 8px 22px rgb(143 70 32 / 0.35);
}
.btn--solid:hover { background: #7a3b1a; }

.btn--outline {
  border: 1px solid currentColor;
  color: var(--c-espresso);
}
.btn--outline:hover { background: rgb(62 42 28 / 0.06); }

/* --- Carte kraft --------------------------------------------------------- */
.kraft-card {
  position: relative;
  background: var(--c-kraft);
  padding: 2.375rem 2.125rem;
  box-shadow: var(--shadow-card);
}
/* Filet décoratif intérieur — NE DOIT JAMAIS intercepter le pointeur */
.kraft-card::before,
.contact-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--c-kraft-line);
  pointer-events: none;
}
.kraft-card--offset { margin-top: 4.375rem; }

.kraft-card__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-rust-ink);
}
.kraft-card__title { font-size: 1.625rem; margin-block: var(--space-2) var(--space-3); }
.kraft-card__divider {
  width: 56px;
  height: 2px;
  background: var(--c-rust);
  margin-block: var(--space-3) var(--space-4);
}
.kraft-card p { font-size: 1.09rem; }

/* --- Contact ------------------------------------------------------------- */
.contact { text-align: center; }

.contact-card {
  position: relative;
  max-width: 35rem;
  margin-inline: auto;
  padding: 3.25rem 2.5rem;
  background: var(--c-kraft);
  box-shadow: var(--shadow-lift);
}
.contact-card::before { inset: 12px; }

.contact-card__sub {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-rust-ink);
  margin-bottom: var(--space-8);
}

.contact-list {
  display: grid;
  gap: 0.875rem;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  /* Cible tactile ≥ 44px de haut (WCAG 2.5.8) */
  min-height: 44px;
  padding: 0.875rem 1.125rem;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  color: var(--c-espresso);
  text-decoration: none;
  border: 1px solid var(--c-kraft-line);
  background: rgb(241 234 224 / 0.4);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-row:hover {
  background: rgb(241 234 224 / 0.85);
  border-color: var(--c-rust-ink);
}

.contact-row__icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  fill: none;
  stroke: var(--c-rust-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------------------
   07. PIED DE PAGE
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2.125rem var(--gutter);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text);      /* couleur pleine : contraste garanti */
  border-top: 1px solid var(--c-kraft-line);
}

/* ---------------------------------------------------------------------------
   08. ANIMATIONS D'APPARITION
   État initial posé par JS (.js-reveal) afin que le contenu reste visible
   si JavaScript est indisponible ou échoue.
   -------------------------------------------------------------------------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Le hero s'anime immédiatement, sans attendre l'observateur */
@keyframes rise { to { opacity: 1; transform: none; } }

.js-reveal .hero__inner > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease) forwards;
}
.js-reveal .hero__inner > :nth-child(1) { animation-delay: 0.25s; }
.js-reveal .hero__inner > :nth-child(2) { animation-delay: 0.40s; }
.js-reveal .hero__inner > :nth-child(3) { animation-delay: 0.55s; }
.js-reveal .hero__inner > :nth-child(4) { animation-delay: 0.70s; }
.js-reveal .hero__inner > :nth-child(5) { animation-delay: 0.85s; }

/* ---------------------------------------------------------------------------
   09. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 47.5rem) {          /* 760px */
  :root { --section-y: 5rem; }

  .grid--story,
  .grid--rental,
  .grid--duo { grid-template-columns: 1fr; gap: var(--space-12); }

  .kraft-card--offset { margin-top: 0; }

  .topbar { font-size: 0.75rem; }
  .contact-card { padding: 2.5rem 1.5rem; }
  .contact-row  { font-size: 1rem; }
}

@media (max-width: 26rem) {            /* 416px */
  /* L'icône reste sur la ligne, seul le libellé se replie */
  .contact-row      { font-size: 0.9375rem; padding-inline: 0.75rem; }
  .contact-row span { overflow-wrap: anywhere; }
}

/* Respect du réglage système « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js-reveal [data-reveal],
  .js-reveal .hero__inner > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------------------------------------------------------------------------
   10. IMPRESSION
   -------------------------------------------------------------------------- */
@media print {
  .topbar,
  .skip-link { display: none; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { min-height: auto; padding-block: 2rem; }
  .section { padding-block: 1.5rem; break-inside: avoid; }
  .kraft-card,
  .contact-card { box-shadow: none; border: 1px solid #999; }

  /* Expose les destinations des liens sur le papier */
  .contact-row[href]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
