/* =========================================================
   CEPF Tahiti — Design System
   Lagon premium · moderne/tech · ancré au fenua
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Hanken+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Ocean / lagoon palette */
  --ink:        #06222b;   /* deepest ocean */
  --ink-2:      #0a2e3a;   /* surface dark */
  --ink-3:      #0f3a48;   /* raised surface */
  --lagoon:     #2bb6c2;   /* turquoise accent */
  --lagoon-br:  #4fd4da;   /* bright lagoon */
  --lagoon-dp:  #1c8a96;   /* deep lagoon */
  --sand:       #e7dcc8;   /* warm sand */
  --sand-2:     #d8c9ad;
  --cream:      #f7f2e9;   /* warm white */
  --cream-2:    #efe8da;
  --paper:      #fbfaf6;

  --text-dark:  #102a31;   /* text on light */
  --text-mut:   #5d6f72;   /* muted on light */
  --text-light: #eaf2f1;   /* text on dark */
  --text-lmut:  #93aeb2;   /* muted on dark */
  --line:       rgba(16,42,49,.12);
  --line-d:     rgba(255,255,255,.12);

  --maxw: 1240px;
  --gut: clamp(20px, 5vw, 64px);
  --r:   4px;
  --shadow: 0 24px 60px -28px rgba(6,34,43,.45);
  --shadow-sm: 0 12px 30px -18px rgba(6,34,43,.4);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, sans-serif;
  --mono:  'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text-dark);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--lagoon); color: #fff; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.section { padding-block: clamp(64px, 9vw, 130px); }

/* ---------- Type ---------- */
h1,h2,h3 { font-family: var(--serif); font-weight: 600; line-height: 1.04; letter-spacing: -.01em; }
.display {
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.02em;
}
.h-xl { font-size: clamp(2.1rem, 4.6vw, 3.7rem); }
.h-lg { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
.h-md { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.lede { font-size: clamp(1.08rem, 1.5vw, 1.32rem); line-height: 1.55; color: var(--text-mut); }
.it { font-style: italic; font-family: var(--serif); }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--lagoon-dp);
  display: inline-flex; align-items: center; gap: .7em;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--lagoon); display: inline-block;
}
.eyebrow.center::before { display: none; }
.on-dark .eyebrow, .eyebrow.light { color: var(--lagoon-br); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  letter-spacing: .01em;
  padding: 1.02em 1.7em; border-radius: var(--r);
  cursor: pointer; border: 1px solid transparent;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), background .25s, color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn-primary { background: var(--lagoon); color: #04242a; box-shadow: 0 14px 28px -12px rgba(43,182,194,.6); }
.btn-primary:hover { background: var(--lagoon-br); transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .9; }
.btn-ghost:hover { background: currentColor; transform: translateY(-2px); }
.btn-ghost:hover span { color: var(--paper); }
.on-dark .btn-ghost { border-color: rgba(255,255,255,.4); color: var(--text-light); }
.on-dark .btn-ghost:hover { background: rgba(255,255,255,.95); color: var(--ink); }
.btn-lg { padding: 1.15em 2.1em; font-size: 1rem; }

.link-arrow {
  font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .18em;
  font-weight: 700; display: inline-flex; align-items: center; gap: .6em; color: var(--lagoon-dp);
}
.link-arrow span { transition: transform .25s; }
.link-arrow:hover span { transform: translateX(5px); }
.on-dark .link-arrow { color: var(--lagoon-br); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .35s, box-shadow .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 20px; }
.site-header.scrolled {
  background: rgba(6,34,43,.92);
  backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { height: 66px; width: auto; display: block; }
.foot-brand .brand-logo { height: 96px; margin-bottom: 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 5px;
  background: linear-gradient(140deg, var(--lagoon) 0%, var(--lagoon-dp) 100%);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: #042328;
  box-shadow: 0 8px 20px -8px rgba(43,182,194,.7);
}
.brand-txt { display: none; }
.brand-txt b { font-family: var(--sans); font-weight: 700; letter-spacing: .14em; font-size: 1.06rem; }
.brand-txt small { font-family: var(--mono); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-mut); margin-top: 4px; }
.site-header.on-hero .brand-txt b,
.site-header.on-hero .nav-links a { color: var(--cream); }
.site-header.on-hero .brand-txt small { color: var(--text-lmut); }
.site-header.on-hero.scrolled { background: rgba(10,22,26,.45); backdrop-filter: blur(14px); border-color: rgba(255,255,255,.08); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.site-header .nav-links a, .site-header .nav-phone, .site-header .burger { color: var(--cream); }
.nav-links a {
  font-size: .92rem; font-weight: 500; padding: .5em .85em; border-radius: var(--r);
  position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: .85em; right: .85em; bottom: .2em; height: 1.5px;
  background: var(--lagoon); transform: scaleX(0); transform-origin: left; transition: transform .28s;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-phone {
  font-family: var(--mono); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .5em; color: inherit;
}
.site-header.on-hero .nav-phone { color: var(--cream); }
.nav-phone svg { width: 16px; height: 16px; color: var(--lagoon); }

.burger { display: none; background: none; border: none; cursor: pointer; width: 44px; height: 44px; }
.burger span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px auto; transition: .3s; }
.site-header.on-hero .burger { color: var(--cream); }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--ink); color: var(--cream);
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: var(--gut);
  transform: translateY(-100%); transition: transform .45s cubic-bezier(.7,0,.2,1); pointer-events: none;
}
.mobile-menu.open { transform: translateY(0); pointer-events: auto; }
.mobile-menu a { font-family: var(--serif); font-size: 2.4rem; padding: .25em 0; border-bottom: 1px solid var(--line-d); }
.mobile-menu .mm-foot { margin-top: 34px; font-family: var(--mono); font-size: .85rem; color: var(--lagoon-br); letter-spacing: .05em; }

/* ---------- Photo placeholders ---------- */
.ph {
  position: relative; overflow: hidden; background: var(--ink-2);
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 11px);
  display: grid; place-items: center; color: var(--text-lmut);
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--lagoon-br); opacity: .9; padding: .7em 1em; text-align: center;
  border: 1px dashed rgba(79,212,218,.4); border-radius: 3px; max-width: 78%;
  background: rgba(6,34,43,.35);
}
.ph.light { background: var(--cream-2); background-image: repeating-linear-gradient(135deg, rgba(16,42,49,.05) 0 2px, transparent 2px 11px); }
.ph.light::after { color: var(--lagoon-dp); border-color: rgba(28,138,150,.4); background: rgba(255,255,255,.5); }

/* ---------- Cards / misc ---------- */
.tag {
  font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 700; padding: .42em .75em; border-radius: 100px; background: rgba(43,182,194,.13);
  color: var(--lagoon-dp); display: inline-block;
}
.on-dark .tag { background: rgba(79,212,218,.16); color: var(--lagoon-br); }

.on-dark { background: var(--ink); color: var(--text-light); }
.on-dark .lede { color: var(--text-lmut); }
.on-sand { background: var(--cream); }

.divider { height: 1px; background: var(--line); border: 0; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-instant { transition: none !important; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Slider Avant/Après (partagé) ---------- */
.ba { position: relative; aspect-ratio: 4/3; border-radius: var(--r); overflow: hidden; user-select: none; box-shadow: var(--shadow); }
.ba .ph, .ba .ba-layer { position: absolute; inset: 0; }
.ba .ba-layer image-slot { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ba-after { z-index: 2; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 46px; transform: translateX(-50%); z-index: 3; cursor: ew-resize; touch-action: none; }
.ba-handle::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: #fff; box-shadow: 0 0 16px rgba(0,0,0,.4); }
.ba-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 700; letter-spacing: -2px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.ba-tag { position: absolute; bottom: 14px; z-index: 3; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; padding: .45em .8em; border-radius: 100px; background: rgba(6,34,43,.78); color: var(--cream); pointer-events: none; }
.ba-tag-l { left: 14px; } .ba-tag-r { right: 14px; background: var(--lagoon); color: #042328; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--text-light); padding-block: clamp(56px,7vw,90px) 32px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 48px 40px; }
.foot-grid h4 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .2em; color: var(--lagoon-br); margin-bottom: 20px; font-weight: 700; }
.foot-grid a, .foot-grid p { color: var(--text-lmut); font-size: .95rem; display: block; padding: 5px 0; transition: color .2s; }
.foot-grid a:hover { color: var(--lagoon-br); }
.foot-brand .brand-mark { margin-bottom: 18px; }
.foot-brand p { max-width: 30ch; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-d); font-family: var(--mono); font-size: .73rem; letter-spacing: .04em; color: var(--text-lmut); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--text-mut); }
.field input, .field textarea, .field select {
  font-family: var(--sans); font-size: 1rem; padding: .85em 1em; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; color: var(--text-dark); transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--lagoon); box-shadow: 0 0 0 3px rgba(43,182,194,.16); }
.field textarea { resize: vertical; min-height: 120px; }

/* ---------- Curseur custom ---------- */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
    border-radius: 50%; transform: translate(-50%, -50%);
  }
  .cursor-dot { width: 34px; height: 34px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cline x1='29' y1='5' x2='16.5' y2='17.5' stroke='%23f7f2e9' stroke-width='3.4' stroke-linecap='round'/%3E%3Cline x1='16.5' y1='17.5' x2='13' y2='21' stroke='%23caa15a' stroke-width='4.6' stroke-linecap='round'/%3E%3Cpath d='M13.5 19 L18 23.5 L5.5 29 Z' fill='%234fd4da'/%3E%3C/svg%3E") no-repeat center/contain; transform: translate(-9px,-25px); transition: opacity .25s; }
  .cursor-dot::before, .cursor-dot::after { content: none; }
  .cursor-dot::before { width: 22px; height: 1px; }
  .cursor-dot::after { width: 1px; height: 22px; }
  .cursor-ring {
    width: 30px; height: 30px; border: 1px solid var(--cream); opacity: 0;
    transition: width .3s cubic-bezier(.2,.7,.3,1), height .3s cubic-bezier(.2,.7,.3,1), opacity .3s, background .3s;
    display: grid; place-items: center;
  }
  .cursor-ring::after { content: ""; color: var(--lagoon-br); font-family: var(--mono); font-size: .7rem; font-weight: 700; line-height: 1; opacity: 0; transition: opacity .25s; }
  /* survol d'un lien / bouton : l'anneau grossit, le point disparaît */
  html.cur-link .cursor-ring { width: 52px; height: 52px; opacity: .9; }
  html.cur-link .cursor-dot { opacity: 1; }
  /* survol d'un média « à voir » : anneau plein + signe + */
  html.cur-view .cursor-ring { width: 74px; height: 74px; opacity: 1; background: rgba(43,182,194,.16); border-color: var(--lagoon-br); }
  html.cur-view .cursor-ring::after { content: "+"; opacity: 1; font-size: 1.4rem; }
  html.cur-view .cursor-dot { opacity: 1; }
  html.cur-hidden .cursor-dot, html.cur-hidden .cursor-ring { opacity: 0 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .nav-links, .nav-phone { display: none; }
  .burger { display: block; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .nav-cta .btn { display: none; }
}

/* footer unifié */
.site-footer .foot-grid a { color: var(--cream); text-decoration: none; }
.site-footer .foot-grid a:hover { color: var(--lagoon-br); }
.site-footer .foot-bottom a { color: var(--cream); }
.site-footer .foot-bottom a:hover { color: var(--lagoon-br); }
