/* ════════════════════════════════════════════════════════════
   MADAWAY TOURS — Design system « Dark Editorial Futuriste »
   base.css : variables, fonts, reset, typo, utilitaires, boutons
   ════════════════════════════════════════════════════════════ */

/* ── 1. Custom properties ──────────────────────────────────── */
:root {
  /* Contrôles natifs (date picker, scrollbars) en sombre */
  color-scheme: dark;
  /* Palette */
  --ink:        #0B0E14;
  --ink-deep:   #060810;
  --ink-panel:  #131722;
  --ink-soft:   #1A2030;
  --cream:      #F5F0E6;
  --cream-soft: #FAF7F1;
  --cream-dim:  rgba(245, 240, 230, .70);   /* +contraste micro-libellés (WCAG AA) */
  --terra:      #B85042;
  --terra-deep: #8C3528;
  --ochre:      #C9A961;
  --ochre-glow: #E8C97A;
  --success:    #1F6F4F;
  --danger:     #C0392B;
  --grid-line:  rgba(245, 240, 230, .06);
  --grid-line-dark: rgba(11, 14, 20, .07);

  /* Typographie */
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:    "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --fs-h1: clamp(2.8rem, 6vw, 5.5rem);
  --fs-h2: clamp(2rem, 4vw, 3.4rem);
  --fs-h3: clamp(1.4rem, 2.4vw, 1.9rem);
  --fs-h4: clamp(1.1rem, 1.6vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-mono: .72rem;

  /* Rythme */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4rem, 10vw, 8rem);
  --container: 1240px;
  --container-wide: 1440px;
  --radius: 6px;
  --radius-lg: 12px;

  /* Mouvements */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-luxe: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .25s;
  --t-med: .5s;
  --t-slow: .9s;

  /* Z-index */
  --z-header: 100;
  --z-veil: 200;
  --z-modal: 300;
  --z-maya: 150;
  --z-cursor: 400;
  --z-preloader: 500;

  /* Lueurs */
  --glow-ochre: 0 0 60px rgba(201, 169, 97, .25);
  --glow-terra: 0 0 50px rgba(184, 80, 66, .35);
}

/* ── 2. Fonts self-hosted (woff2 dans /assets/fonts) ───────── */
/* Subsets latin + latin-ext (Google Fonts, licence OFL), ~240 Ko au total. */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 3. Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  /* clip : aucune dérive latérale (reveals translateX hors écran),
     sans créer de conteneur de scroll (le sticky reste fonctionnel) */
  overflow-x: hidden;
  overflow-x: clip;
}
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100vh;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul[class], ol[class] { list-style: none; padding: 0; }
button { background: none; border: 0; cursor: pointer; }
/* L'attribut hidden doit toujours gagner sur les display des composants */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }
::selection { background: var(--terra); color: var(--cream-soft); }

/* ── 4. Typographie ────────────────────────────────────────── */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 480;
  line-height: 1.06;
  letter-spacing: -.015em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-h4); }
.italic-accent, h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 420;
  color: var(--terra);
}
.on-light .italic-accent { color: var(--terra-deep); }
p { max-width: 65ch; }
.lead { font-size: 1.15rem; color: var(--cream-dim); }

/* Labels techniques monospace — signature futuriste */
.mono, .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4em .9em;
  color: var(--ochre);
  margin-bottom: var(--space-3);
}
@media (max-width: 480px) {
  .eyebrow { letter-spacing: .15em; }
}
.eyebrow::before {
  content: "";
  width: 2.4em;
  height: 1px;
  background: var(--ochre);
  opacity: .6;
}
.mono-dim { color: var(--cream-dim); }

/* ── 5. Sections & containers ──────────────────────────────── */
.container {
  width: min(100% - 3rem, var(--container));
  margin-inline: auto;
}
.container-wide { width: min(100% - 3rem, var(--container-wide)); margin-inline: auto; }
.section { padding-block: var(--space-6); position: relative; }
.section-head { max-width: 720px; margin-bottom: var(--space-5); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::before { display: none; }
.section-head p { margin-top: var(--space-2); color: var(--cream-dim); }

/* Sections claires (≈40 %) */
.on-light {
  background: var(--cream);
  color: var(--ink);
}
.on-light .lead, .on-light .section-head p { color: rgba(11, 14, 20, .65); }
.on-light .eyebrow { color: var(--terra-deep); }
.on-light .eyebrow::before { background: var(--terra-deep); }
.on-light .mono-dim { color: rgba(11, 14, 20, .55); }

/* Section d'impact très sombre */
.on-deep { background: var(--ink-deep); }

/* ── 6. Décors techniques ──────────────────────────────────── */
/* Grille technique en arrière-plan */
.grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 85% at 50% 40%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 40%, #000 35%, transparent 100%);
}
.on-light.grid-bg::before {
  background-image:
    linear-gradient(var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-dark) 1px, transparent 1px);
}

/* Grain / noise (SVG feTurbulence, ~2 % opacité) */
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("../img/noise.svg");
  background-size: 280px;
  opacity: .35;
  mix-blend-mode: overlay;
}

/* Lignes topographiques décoratives */
.topo-deco {
  position: absolute;
  inset: auto 0 0 auto;
  width: min(48vw, 640px);
  opacity: .1;
  pointer-events: none;
  color: var(--ochre);
}
.topo-deco path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 6 10;
  animation: topo-drift 28s linear infinite;
}
@keyframes topo-drift { to { stroke-dashoffset: -320; } }

/* Coordonnées GPS décoratives */
.gps-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: .18em;
  color: var(--cream-dim);
  display: inline-flex;
  align-items: center;
  gap: .8em;
}
.gps-tag::before {
  content: "";
  width: 7px; height: 7px;
  border: 1px solid var(--ochre);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ochre);
}

/* Corner brackets ⌜ ⌟ */
.brackets { position: relative; }
.brackets::before, .brackets::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid var(--ochre);
  opacity: 0;
  transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease-out);
  pointer-events: none;
  z-index: 3;
}
.brackets::before {
  top: 12px; left: 12px;
  border-right: 0; border-bottom: 0;
  transform: translate(8px, 8px);
}
.brackets::after {
  bottom: 12px; right: 12px;
  border-left: 0; border-top: 0;
  transform: translate(-8px, -8px);
}
.brackets:hover::before, .brackets:hover::after,
.brackets:focus-within::before, .brackets:focus-within::after {
  opacity: 1;
  transform: translate(0, 0);
}

/* ── 7. Boutons ────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
  padding: 1em 2.2em;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: color var(--t-fast) ease, border-color var(--t-fast) ease,
              box-shadow var(--t-med) ease, transform var(--t-fast) var(--ease-out);
  will-change: transform;
}
/* Remplissage liquide au hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50% 50% 0 0 / 80% 80% 0 0;
  transform: translateY(103%) scaleX(1.4);
  transition: transform var(--t-med) var(--ease-luxe), border-radius var(--t-med) ease;
}
.btn:hover::before, .btn:focus-visible::before {
  transform: translateY(0) scaleX(1.4);
  border-radius: 0;
}
.btn-primary {
  background: var(--terra);
  color: var(--cream-soft);
  box-shadow: var(--glow-terra);
}
.btn-primary::before { background: var(--terra-deep); }
.btn-primary:hover { box-shadow: 0 0 70px rgba(184, 80, 66, .5); }
.btn-ghost {
  border: 1px solid rgba(245, 240, 230, .28);
  color: var(--cream);
  background: transparent;
}
.btn-ghost::before { background: var(--cream); }
.btn-ghost:hover { color: var(--ink); border-color: var(--cream); }
.on-light .btn-ghost { border-color: rgba(11, 14, 20, .3); color: var(--ink); }
.on-light .btn-ghost::before { background: var(--ink); }
.on-light .btn-ghost:hover { color: var(--cream); border-color: var(--ink); }
.btn-ochre {
  background: var(--ochre);
  color: var(--ink-deep);
  box-shadow: var(--glow-ochre);
}
.btn-ochre::before { background: var(--ochre-glow); }
.btn .arrow { transition: transform var(--t-fast) var(--ease-out); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-sm { padding: .65em 1.4em; font-size: .85rem; }

/* Lien souligné animé */
.link-line {
  position: relative;
  font-weight: 600;
  padding-bottom: 3px;
}
.link-line::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(.35);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.link-line:hover::after { transform: scaleX(1); }

/* ── 8. Formulaires ────────────────────────────────────────── */
.field { display: grid; gap: .45rem; margin-bottom: var(--space-3); }
.field > label {
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: .03em;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--ink-panel);
  border: 1px solid rgba(245, 240, 230, .14);
  border-radius: var(--radius);
  padding: .85em 1.1em;
  color: var(--cream);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.input::placeholder, .textarea::placeholder { color: rgba(245, 240, 230, .35); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ochre);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, .18);
}
.textarea { min-height: 130px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9A961' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  padding-right: 2.6em;
}
.field .error-msg {
  color: #E08373;
  font-size: var(--fs-small);
  min-height: 1.2em;
}
.field.has-error .input, .field.has-error .select, .field.has-error .textarea {
  border-color: var(--danger);
}
.checkbox-row {
  display: flex;
  gap: .8em;
  align-items: flex-start;
  font-size: var(--fs-small);
  color: var(--cream-dim);
}
.checkbox-row input {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--terra);
  flex: none;
}
/* Honeypot — caché aux humains, visible aux bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ── 9. Badges & misc ──────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .45em .9em;
  border-radius: 3px;
  background: var(--terra);
  color: var(--cream-soft);
}
.badge-ochre { background: var(--ochre); color: var(--ink-deep); }
.badge-ghost { background: rgba(245,240,230,.1); color: var(--cream-dim); }

.divider-glow {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(201,169,97,.5), transparent);
}

.stars { display: inline-flex; gap: 2px; color: var(--ochre); letter-spacing: 2px; }

/* Skeleton loaders */
.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--ink-panel) 40%, var(--ink-soft) 50%, var(--ink-panel) 60%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s ease infinite;
  min-height: 380px;
}
@keyframes skeleton-wave { to { background-position: -200% 0; } }

/* Accessibilité */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -100px; left: 1rem;
  z-index: 600;
  background: var(--terra);
  color: var(--cream-soft);
  padding: .7em 1.4em;
  border-radius: var(--radius);
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* Scrollbar subtile */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink-deep); }
::-webkit-scrollbar-thumb { background: var(--ink-soft); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--terra-deep); }
