/* ==========================================================================
   SundayOff · base.css
   Polices, tokens de la charte, reset, grain, typographie, composants
   partagés et système d'animations. Direction artistique : voir CLAUDE.md
   ========================================================================== */

/* ---------- Polices (versions d'essai : licence webfont à prévoir avant la mise en ligne) ---------- */
/* La version d'essai de Bogart remplace les chiffres 0-9 par un glyphe « trial » :
   en attendant la licence, les chiffres des titres sont pris dans Agrandir.
   Avec la vraie police, supprimer les deux unicode-range et les deux règles « chiffres ». */
@font-face { font-family: 'Bogart'; src: url('../polices/Bogart-Semibold-trial.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0-2F, U+3A-10FFFF; }
@font-face { font-family: 'Bogart'; src: url('../polices/Bogart-Semibold-Italic-trial.ttf') format('truetype'); font-weight: 600; font-style: italic; font-display: swap; unicode-range: U+0-2F, U+3A-10FFFF; }
@font-face { font-family: 'Bogart'; src: url('../polices/PPAgrandirText-Bold.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+30-39; }
@font-face { font-family: 'Bogart'; src: url('../polices/PPAgrandirText-Bold.otf') format('opentype'); font-weight: 600; font-style: italic; font-display: swap; unicode-range: U+30-39; }
@font-face { font-family: 'Agrandir'; src: url('../polices/PPAgrandir-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Agrandir'; src: url('../polices/PPAgrandirText-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Charte */
  --bordeaux: #2d0014;
  --creme: #fefcf1;
  --citron: #f7f85c;
  --corail: #ff6b6b;
  --ambre: #e58c13;

  /* Teintes claires dérivées (couleur de la charte + crème) */
  --corail-soft: #ffdcd3;
  --ambre-soft: #f9e3c0;
  --citron-soft: #fcfbc4;
  --lin: #f3ece1;

  --ink-80: rgba(45, 0, 20, .82);
  --ink-70: rgba(45, 0, 20, .7);
  --ink-20: rgba(45, 0, 20, .18);
  --ink-10: rgba(45, 0, 20, .08);
  --creme-80: rgba(254, 252, 241, .84);
  --creme-30: rgba(254, 252, 241, .3);

  /* Chrome (touche Y2K) */
  --chrome: linear-gradient(135deg, #ffffff 0%, #d4cbcd 18%, #8b7f82 34%, #fbf8f8 50%, #6a5c60 64%, #e2dadc 80%, #ffffff 100%);
  --chrome-soft: conic-gradient(from 20deg, #ffffff, #d9d0d2, #fbf8f8, #a99da0, #f0eaeb, #ffffff, #c4b9bc, #fbf8f8, #ffffff);

  /* Typographie */
  --font-title: 'Bogart', 'Iowan Old Style', Georgia, serif;
  --font-text: 'Agrandir', 'Helvetica Neue', Arial, sans-serif;

  /* Formes & ombres (diffuses, teintées bordeaux) */
  --r-sm: 10px;
  --r-card: 22px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 9999px;
  --shadow-soft: 0 14px 34px -22px rgba(45, 0, 20, .45);
  --shadow-float: 0 26px 50px -28px rgba(45, 0, 20, .55);
  --shadow-paper: 0 2px 0 rgba(45, 0, 20, .04), 0 18px 30px -22px rgba(45, 0, 20, .42);

  /* Mouvement : lent et moelleux */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.45, .05, .25, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  /* Mise en page */
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 8vw, 112px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--creme);
  color: var(--bordeaux);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

/* Grain argentique sur toute la page */
body::after {
  content: "";
  position: fixed; inset: -120px; z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .12 0 0 0 0 .06 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .13;
  animation: grain 1.1s steps(5) infinite;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 700; }
::selection { background: var(--citron); color: var(--bordeaux); }
:focus-visible { outline: 3px solid var(--corail); outline-offset: 3px; border-radius: 6px; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--bordeaux); color: var(--creme); text-decoration: none;
  translate: 0 -200%; transition: translate .3s var(--ease-out);
}
.skip-link:focus { translate: 0 0; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.section { position: relative; padding: var(--section-y) var(--gutter); }

/* ---------- Typographie ---------- */
.display {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.display em, .h2 em, .stack-title em, .places-title em { font-style: italic; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 12.5px/1.2 var(--font-text);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-80);
}
.eyebrow::before {
  content: ""; flex: none; width: 12px; height: 12px;
  background: var(--corail);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.6; }
.annot { font: italic 600 24px/1.1 var(--font-title); }
.tag {
  display: inline-flex; align-items: center;
  padding: 7px 12px;
  border: 1px solid currentColor; border-radius: var(--r-pill);
  font: 400 11.5px/1 var(--font-text);
  letter-spacing: .14em; text-transform: uppercase;
}

/* Surligneur citron (effet feutre) */
.hl {
  padding: 0 .1em;
  margin: 0 -.03em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 24' preserveAspectRatio='none'%3E%3Cpath d='M2 5.5C20 3 38 4.5 56 3.2S88 2.6 98.5 4.5L97.6 19.5C80 21.4 62 19.8 44 21.2S12 21.8 1.5 19.8Z' fill='%23f7f85c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 64%;
  background-size: 100% 84%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hl--creme {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 24' preserveAspectRatio='none'%3E%3Cpath d='M2 5.5C20 3 38 4.5 56 3.2S88 2.6 98.5 4.5L97.6 19.5C80 21.4 62 19.8 44 21.2S12 21.8 1.5 19.8Z' fill='%23fefcf1'/%3E%3C/svg%3E");
}
/* Sur fond bordeaux : le texte passe de crème à bordeaux quand le feutre arrive */
.hl--on-dark { color: var(--bordeaux); }
html.js .hl { background-size: 0% 84%; transition: background-size 1.1s var(--ease-in-out) var(--delay, .2s); }
html.js .hl.is-in { background-size: 100% 84%; }
html.js .hl--on-dark { color: var(--creme); transition: background-size 1.1s var(--ease-in-out) var(--delay, .2s), color .4s var(--ease-soft) calc(var(--delay, .2s) + .5s); }
html.js .hl--on-dark.is-in { color: var(--bordeaux); }

/* ---------- Boutons (pilules) ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--bordeaux);
  --btn-bd: var(--bordeaux);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px;
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 700 15.5px/1.2 var(--font-text);
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .5s var(--ease-out), transform .35s var(--ease-out), background-color .45s var(--ease-soft), color .45s var(--ease-soft), border-color .45s var(--ease-soft), box-shadow .45s;
}
/* Reflet chromé qui balaie le bouton au survol */
.btn::after {
  content: ""; position: absolute; z-index: -1;
  top: -2px; bottom: -2px; left: -70%; width: 50%;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, .7) 50%, transparent 85%);
  transform: translateX(0) skewX(-18deg);
  transition: transform .9s var(--ease-out);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(420%) skewX(-18deg); }
.btn:active { transform: scale(.97); }
.btn-primary { --btn-bg: var(--bordeaux); --btn-fg: var(--creme); }
.btn-primary:hover { --btn-bg: var(--corail); --btn-fg: var(--bordeaux); --btn-bd: var(--corail); box-shadow: var(--shadow-soft); }
.btn-ghost:hover { --btn-bg: var(--citron); }
.btn-citron { --btn-bg: var(--citron); --btn-fg: var(--bordeaux); --btn-bd: var(--citron); }
.btn-citron:hover { --btn-bg: var(--creme); --btn-bd: var(--creme); box-shadow: 0 0 0 6px rgba(247, 248, 92, .25); }
.btn-sm { padding: 10px 18px; font-size: 14px; gap: 8px; }
.btn-lg { padding: 18px 34px; font-size: 16.5px; }
.btn-xl { padding: 22px 44px; font-size: 18px; }
.btn-block { width: 100%; }

/* Flèche qui file au survol */
.btn-arrow { position: relative; display: inline-block; flex: none; width: 1.05em; height: 1.2em; overflow: hidden; }
.btn-arrow::before,
.btn-arrow::after {
  content: "→"; position: absolute; inset: 0;
  display: grid; place-items: center;
  transition: transform .55s var(--ease-out);
}
.btn-arrow::after { transform: translateX(-130%); }
.btn:hover .btn-arrow::before { transform: translateX(130%); }
.btn:hover .btn-arrow::after { transform: translateX(0); }

/* Texte qui « roule » au survol (data-text ajouté en JS) */
.btn-label { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.btn-label > span { display: inline-block; transition: transform .55s var(--ease-out); }
.btn-label[data-text]::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute; left: 0; top: 100%;
  white-space: nowrap;
  transition: transform .55s var(--ease-out);
}
.btn:hover .btn-label[data-text] > span,
.btn:hover .btn-label[data-text]::after { transform: translateY(-100%); }

/* ---------- Badge (sticker) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 11px;
  border-radius: var(--r-pill);
  background: var(--citron);
  color: var(--bordeaux);
  font: 700 13.5px/1.2 var(--font-text);
  letter-spacing: .02em;
  box-shadow: var(--shadow-paper);
  rotate: var(--tilt, 0deg);
}
.badge-star { width: 16px; height: 16px; flex: none; fill: currentColor; animation: spin 8s linear infinite; }
.badge--glass {
  background: rgba(254, 252, 241, .1);
  color: var(--creme);
  border: 1px solid var(--creme-30);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
.badge--glass .badge-star { fill: var(--citron); }

/* ---------- Navigation ---------- */
.nav-wrap {
  position: fixed; inset: 14px 0 auto; z-index: 60;
  padding-inline: var(--gutter);
  pointer-events: none;
  transition: translate .6s var(--ease-out);
}
.nav-wrap.is-hidden { translate: 0 calc(-100% - 24px); }
.nav {
  pointer-events: auto;
  position: relative;
  max-width: 1120px; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 20px;
  background: rgba(254, 252, 241, .78);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--ink-20);
  border-radius: var(--r-pill);
  box-shadow: 0 20px 40px -30px rgba(45, 0, 20, .5);
  overflow: hidden;
}
.nav::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--corail), var(--ambre), var(--citron));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}

.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 600 23px/1 var(--font-title); letter-spacing: -.01em; }
.logo em { font-style: italic; }
.logo-star { width: 22px; height: 22px; flex: none; overflow: visible; transition: rotate 1.1s var(--ease-spring); }
.logo-star use { stroke: rgba(45, 0, 20, .45); stroke-width: .6; }
.logo:hover .logo-star { rotate: 180deg; }

.nav-links { display: flex; gap: 2px; }
.nav-links a {
  position: relative; z-index: 0; display: block;
  padding: 8px 12px;
  font: 400 14px/1.2 var(--font-text);
  text-decoration: none;
}
.nav-links a::before {
  content: ""; position: absolute; z-index: -1;
  left: 8px; right: 8px; bottom: 6px; height: 44%;
  border-radius: 3px;
  background: var(--citron);
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .5s var(--ease-out);
}
.nav-links a:hover::before,
.nav-links a.is-active::before { transform: scaleX(1); transform-origin: 0 50%; }

/* ---------- Matière : pétales, étoiles chromées, lumière floue ---------- */
.petal {
  position: absolute; pointer-events: none; overflow: visible;
  filter: drop-shadow(0 10px 12px rgba(45, 0, 20, .2));
  animation: drift var(--dur, 12s) var(--ease-soft) infinite alternate;
  animation-delay: var(--del, 0s);
}
.chrome-star {
  position: absolute; pointer-events: none; overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(45, 0, 20, .28));
  animation: twinkle var(--dur, 4.5s) var(--ease-soft) infinite;
  animation-delay: var(--del, 0s);
}
.chrome-star use { stroke: rgba(45, 0, 20, .3); stroke-width: .5; }
.glow { position: absolute; border-radius: 50%; filter: blur(34px); animation: blob var(--dur, 18s) var(--ease-soft) infinite alternate; }

/* Verre cannelé : nervures verticales posées sur une lumière floue */
.fluted {
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, .34) 3px,
    rgba(255, 255, 255, .07) 7px,
    rgba(45, 0, 20, .14) 12px,
    rgba(255, 255, 255, 0) 14px);
}

/* ---------- Tracés dessinés à la main ---------- */
.draw { overflow: visible; }
.draw path, .draw circle, .draw line, .draw ellipse, .draw polyline, .draw rect {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--sw, 1.8);
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.js .draw .dl {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
  transition: stroke-dashoffset var(--dur, 1.2s) var(--ease-in-out) calc(var(--dd, 0s) + var(--d, 0s));
}
html.js .draw.is-in .dl { stroke-dashoffset: 0; }

/* Titres découpés en mots */
.split .w { display: inline-block; transform-origin: 0 100%; }
html.js .split .w {
  opacity: 0;
  translate: 0 .4em;
  rotate: 5deg;
  filter: blur(6px);
  transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-out), rotate 1.1s var(--ease-out), filter .9s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 60ms + .15s);
}
html.js .split.is-in .w { opacity: 1; translate: 0 0; rotate: 0deg; filter: blur(0); }

/* ---------- Apparitions au scroll ---------- */
html.js [data-reveal] {
  opacity: 0;
  transition-property: opacity, translate, scale, rotate;
  transition-duration: 1.1s;
  transition-timing-function: var(--ease-out);
  transition-delay: calc(var(--i, 0) * 100ms + var(--delay, 0ms));
}
html.js [data-reveal="up"] { translate: 0 44px; }
html.js [data-reveal="left"] { translate: -64px 0; }
html.js [data-reveal="right"] { translate: 64px 0; }
html.js [data-reveal="rise"] { translate: 0 70px; scale: .94; }
html.js [data-reveal="pop"] { scale: .6; rotate: calc(var(--tilt, 0deg) - 10deg); transition-timing-function: var(--ease-spring); }
html.js [data-reveal="drop"] { translate: 0 -50px; rotate: calc(var(--tilt, 0deg) + 7deg); scale: 1.05; transition-timing-function: var(--ease-spring); }
html.js [data-reveal].is-in { opacity: 1; translate: 0 0; scale: 1; rotate: var(--tilt, 0deg); }

/* ---------- Curseur ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 150;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1.5px solid var(--bordeaux);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  mix-blend-mode: multiply;
  transition: width .4s var(--ease-out), height .4s var(--ease-out), background-color .3s, border-color .3s, opacity .3s, transform .25s var(--ease-out);
}
.cursor.is-visible { opacity: 1; }
.cursor.is-visible.is-off { opacity: 0; }
.cursor.is-hover { width: 58px; height: 58px; background: var(--citron); border-color: var(--citron); }
.cursor.has-label { width: 88px; height: 88px; }
.cursor.is-down { transform: translate(-50%, -50%) scale(.8); }
.cursor-label {
  font: 700 11px/1 var(--font-text);
  letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; transition: opacity .2s;
}
.cursor.has-label .cursor-label { opacity: 1; }

/* ---------- Pétales au clic ---------- */
.confetti { position: fixed; z-index: 160; pointer-events: none; will-change: transform, opacity; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes breathe { 0%, 100% { scale: 1; opacity: 1; } 50% { scale: 1.1; opacity: .8; } }
@keyframes wobble { 0%, 100% { rotate: 8deg; } 50% { rotate: 15deg; } }
@keyframes bump { 0% { scale: 1; } 40% { scale: 1.22; } 100% { scale: 1; } }
@keyframes tick { from { transform: translateY(-40%); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes ticket-pop { from { scale: 0; rotate: -25deg; } to { scale: 1; rotate: 0deg; } }
@keyframes scroll-dot { 0% { transform: translateY(0); opacity: 1; } 75% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-40px, 22px); } 40% { transform: translate(28px, -36px); }
  60% { transform: translate(-18px, -48px); } 80% { transform: translate(44px, 30px); } 100% { transform: translate(0, 0); }
}
@keyframes blob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(14%, 10%) scale(1.12); }
  100% { transform: translate(-10%, 16%) scale(.92); }
}
@keyframes drift {
  from { transform: translate(0, 0) rotate(var(--r0, 0deg)); }
  to { transform: translate(var(--dx, 14px), var(--dy, -22px)) rotate(var(--r1, 24deg)); }
}
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(.78) rotate(45deg); } }
@keyframes shine { to { background-position: 200% 50%; } }
@keyframes buzz {
  0%, 100% { transform: rotate(0); } 15% { transform: rotate(-4deg); } 30% { transform: rotate(4deg); }
  45% { transform: rotate(-3deg); } 60% { transform: rotate(3deg); } 75% { transform: rotate(-1deg); }
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  50% { transform: translate(var(--sway, 40px), 55vh) rotate(160deg); }
  88% { opacity: 1; }
  100% { transform: translate(0, 110vh) rotate(320deg); opacity: 0; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
