/* ════════════════════════════════════════════════════════════
   OPTICALIUM — main.css
   Design tokens, reset, loader, curseur, navigation, boutons,
   footer, utilitaires
═════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
  /* Couleurs */
  --ivory:        #F6F2EB;   /* fond principal  */
  --ivory-deep:   #EFE9DF;   /* fond alterné    */
  --paper:        #FCFAF6;   /* cartes          */
  --ink:          #14181D;   /* texte principal */
  --ink-soft:     #4B5158;   /* texte secondaire*/
  --ink-mute:     #7C8189;   /* texte tertiaire */
  --night:        #12151A;   /* sections sombres*/
  --night-soft:   #1B2027;
  --gold:         #B08C52;   /* accent laiton   */
  --gold-deep:    #8A6B3C;   /* laiton lisible (4.5:1 sur ivoire) */
  --gold-light:   #CDAE78;
  --cream-on-dark:#EDE6DA;
  --line:         rgba(20, 24, 29, 0.12);
  --line-dark:    rgba(237, 230, 218, 0.14);

  /* Typographie */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Manrope', 'Segoe UI', sans-serif;

  /* Rythme */
  --container:    1280px;
  --section-pad:  clamp(56px, 8vw, 100px);
  --radius:       2px;
  --radius-lg:    4px;

  /* Mouvements */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-loading { overflow: hidden; }
body.menu-open  { overflow: hidden; }

img, svg, iframe { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--gold); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

@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;
  }
}

/* ── UTILITAIRES ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.section { padding-block: var(--section-pad); }
.section-alt  { background: var(--ivory-deep); }
.section-dark { background: var(--night); color: var(--cream-on-dark); }

/* En-têtes de section */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 22px;
}
.section-dark .section-eyebrow { color: var(--gold-light); }

.eyebrow-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.section-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-deep);
}
.section-dark .section-title em { color: var(--gold-light); }


.section-text {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 56ch;
}
.section-dark .section-text { color: rgba(237, 230, 218, 0.72); }

.section-head { margin-bottom: clamp(48px, 7vw, 80px); }
.section-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.section-head-split .section-text { max-width: 40ch; padding-bottom: 8px; }

/* Révélation au scroll */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ── SKIP-LINK (accessibilité clavier) ──────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1100;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.85rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* note affichée quand JavaScript est désactivé */
.noscript-note {
  padding: 18px 22px;
  background: var(--ivory);
  border-left: 2px solid var(--gold);
  font-size: 0.95rem;
  line-height: 1.7;
}
.noscript-note a { color: var(--gold-deep); text-decoration: underline; }

/* ── LOADER ─────────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.loader-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: var(--night);
  transition: transform 1s var(--ease-out);
}
.loader-panel-top    { top: 0; }
.loader-panel-bottom { bottom: 0; }

.loader.is-done .loader-panel-top    { transform: translateY(-101%); }
.loader.is-done .loader-panel-bottom { transform: translateY(101%); }

.loader-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.45s ease;
}
.loader.is-done .loader-inner { opacity: 0; }

.loader-mark {
  width: 96px;
  margin-bottom: 28px;
  color: var(--gold-light);
}
.loader-lens, .loader-bridge, .loader-temple {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.loader-lens {
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  animation: loaderDraw 1.3s var(--ease-out) forwards;
}
.loader-lens-2 { animation-delay: 0.18s; }
.loader-bridge, .loader-temple {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: loaderDraw 0.7s var(--ease-out) 0.85s forwards;
}

@keyframes loaderDraw { to { stroke-dashoffset: 0; } }

.loader-word {
  display: flex;
  gap: 0.06em;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.38em;
  color: var(--cream-on-dark);
  padding-left: 0.38em; /* compense le tracking du dernier caractère */
}
.loader-word span {
  opacity: 0;
  transform: translateY(0.5em);
  animation: loaderLetter 0.7s var(--ease-out) forwards;
}
.loader-word span:nth-child(1)  { animation-delay: 0.30s; }
.loader-word span:nth-child(2)  { animation-delay: 0.37s; }
.loader-word span:nth-child(3)  { animation-delay: 0.44s; }
.loader-word span:nth-child(4)  { animation-delay: 0.51s; }
.loader-word span:nth-child(5)  { animation-delay: 0.58s; }
.loader-word span:nth-child(6)  { animation-delay: 0.65s; }
.loader-word span:nth-child(7)  { animation-delay: 0.72s; }
.loader-word span:nth-child(8)  { animation-delay: 0.79s; }
.loader-word span:nth-child(9)  { animation-delay: 0.86s; }
.loader-word span:nth-child(10) { animation-delay: 0.93s; }

@keyframes loaderLetter {
  to { opacity: 1; transform: none; }
}

.loader-tagline {
  margin-top: 14px;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
  animation: loaderFade 0.8s ease 1.1s forwards;
}
@keyframes loaderFade { to { opacity: 0.85; } }

.loader-bar {
  width: 180px;
  height: 1px;
  margin-top: 34px;
  background: rgba(237, 230, 218, 0.16);
  overflow: hidden;
}
.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gold-light);
  transition: width 0.3s ease;
}

/* ── CURSEUR PERSONNALISÉ ───────────────────────────────────── */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 999;
  pointer-events: none;
  border-radius: 50%;
  translate: -50% -50%;
  display: none;
  opacity: 0;
  visibility: hidden;
}
/* visible uniquement après le premier mouvement de souris */
body.cursor-on .cursor-dot,
body.cursor-on .cursor-ring {
  opacity: 1;
  visibility: visible;
}
@media (hover: hover) and (pointer: fine) {
  .cursor-dot, .cursor-ring { display: block; }
}
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--gold-deep);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(176, 140, 82, 0.55);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--gold);
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 950;
  transform: translate(-50%, 140%);
  max-width: min(92vw, 460px);
  padding: 15px 26px;
  background: var(--night);
  color: var(--cream-on-dark);
  font-size: 0.9rem;
  text-align: center;
  border-left: 2px solid var(--gold);
  box-shadow: 0 18px 50px rgba(18, 21, 26, 0.3);
  transition: transform 0.5s var(--ease-out);
  pointer-events: none;
  visibility: hidden;
}
.toast.is-visible {
  transform: translate(-50%, 0);
  visibility: visible;
  pointer-events: auto;
}

/* ── NAVIGATION ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 4vw, 48px);
  transition: padding 0.4s var(--ease-soft),
              background 0.4s var(--ease-soft),
              box-shadow 0.4s var(--ease-soft),
              transform 0.45s var(--ease-soft);
}
.nav.is-scrolled {
  padding-block: 13px;
  background: rgba(246, 242, 235, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.nav-logo-mark { width: 34px; color: var(--gold-deep); }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.35s ease;
}
.nav-logo-mark { transition: color 0.35s ease; }
.nav-logo-text em { font-style: italic; font-weight: 300; color: var(--gold-deep); }

.nav-links {
  display: flex;
  gap: clamp(20px, 2.6vw, 38px);
}
.nav-links a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 0;
  transition: color 0.25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--gold-deep);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.is-active { color: var(--ink); }

/* sélecteur de langue */
.nav-lang, .mobile-lang {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-lang button, .mobile-lang button {
  min-width: 36px;
  min-height: 36px;
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-lang button:hover { color: var(--ink); }
.nav-lang button.is-active {
  color: var(--gold-deep);
  border-bottom-color: var(--gold-deep);
}
.mobile-lang { gap: 10px; }
.mobile-lang button { font-size: 0.85rem; min-width: 44px; min-height: 44px; color: rgba(237, 230, 218, 0.5); }
.mobile-lang button:hover { color: var(--cream-on-dark); }
.mobile-lang button.is-active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-light);
}

.nav-cta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 12px 26px;
  transition: background 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--ivory); }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  align-items: center;
}
.nav-burger span {
  display: block;
  width: 26px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}
.nav-burger.is-open span:first-child { transform: translateY(4.25px) rotate(45deg); }
.nav-burger.is-open span:last-child  { transform: translateY(-4.25px) rotate(-45deg); }

/* Menu mobile ouvert : la barre de nav passe en clair sur le fond sombre */
body.menu-open .nav {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
body.menu-open .nav-logo-text { color: var(--cream-on-dark); }
body.menu-open .nav-logo-text em { color: var(--gold-light); }
body.menu-open .nav-logo-mark { color: var(--gold-light); }
body.menu-open .nav-burger span { background: var(--cream-on-dark); }

/* ── MENU MOBILE ────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 890;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 100px clamp(28px, 8vw, 64px) 48px;
  background: var(--night);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-soft), visibility 0.45s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }

.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; }

.mobile-link {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 400;
  color: var(--cream-on-dark);
  padding: 8px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.25s ease;
}
.mobile-menu.is-open .mobile-link { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-link:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.is-open .mobile-link:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.is-open .mobile-link:nth-child(3) { transition-delay: 0.20s; }
.mobile-menu.is-open .mobile-link:nth-child(4) { transition-delay: 0.26s; }
.mobile-menu.is-open .mobile-link:nth-child(5) { transition-delay: 0.32s; }
.mobile-menu.is-open .mobile-link:nth-child(6) { transition-delay: 0.38s; }
.mobile-link:hover { color: var(--gold-light); }

.mobile-link-num {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gold-light);
}

.mobile-menu-cta {
  margin-top: 26px;
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--night);
  background: var(--gold-light);
  padding: 16px 34px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out) 0.44s, transform 0.5s var(--ease-out) 0.44s;
}
.mobile-menu.is-open .mobile-menu-cta { opacity: 1; transform: none; }

.mobile-menu-footer {
  font-size: 0.82rem;
  line-height: 1.9;
  color: rgba(237, 230, 218, 0.55);
}
.mobile-menu-footer a { color: var(--gold-light); }

/* ── BOUTONS ────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 15px 34px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform 0.3s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--ink);
  color: var(--ivory);
  border: 1px solid var(--ink);
}
.btn-primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(20, 24, 29, 0.35);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(20, 24, 29, 0.04); }

.btn-block { width: 100%; }

.btn-text {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 5px;
  min-height: 44px;
}

/* État de chargement des boutons de formulaire */
.btn-spinner {
  display: none;
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .btn-spinner { display: block; }
.btn.is-loading .btn-label { opacity: 0.7; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--night);
  color: rgba(237, 230, 218, 0.65);
  padding: clamp(64px, 8vw, 96px) 0 36px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-dark);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-on-dark);
}
.footer-logo em { font-style: italic; font-weight: 300; color: var(--gold-light); }

.footer-brand p { margin-top: 18px; font-size: 0.9rem; line-height: 1.8; }

.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 0.9rem;
  transition: color 0.25s ease;
}
.footer-col a:hover { color: var(--cream-on-dark); }

.footer-hours li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-top: 32px;
  font-size: 0.78rem;
  color: rgba(237, 230, 218, 0.4);
}
.footer-sep {
  width: 24px;
  height: 1px;
  background: var(--line-dark);
}
.footer-bottom a {
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.25s ease;
}
.footer-bottom a:hover { color: var(--cream-on-dark); }

/* ── RETOUR EN HAUT ─────────────────────────────────────────── */
.back-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 880;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--ivory);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s var(--ease-out), background 0.3s ease;
}
.back-top svg { width: 16px; height: 16px; }
.back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--gold-deep); }

/* ── RESPONSIVE GLOBAL ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav-links, .nav-cta, .nav-lang { display: none; }
  .nav-burger { display: flex; }
}

@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .back-top { right: 18px; bottom: 18px; }
}
