/* =========================================================
   Ostio — Base : tokens, reset, typographie, composants communs
   Palette « Onyx et or » : noir profond, or champagne, particules dorées
   ========================================================= */

:root {
  /* Couleurs — palette Onyx et or (fond → surface, textes, ors) */
  --bg: #0e0d0b;
  --bg-deep: #080706;
  --surface: #211d18;
  --cream: #f6f0e6;
  --white: #fbf7ef;
  --muted: #a89f92;
  --faint: #6f685e;
  --highlight: #fcc22c;
  --gold-deep: #c0870a;
  --gold-light: #fbc843;
  --gold: #eeaa18;
  --ink: #222222;

  --grad-line: linear-gradient(90deg, #c0870a 0%, #fbc843 100%);
  --grad-gold: linear-gradient(90deg, #fbc843 0%, #ffd866 30%, #ffe69a 52%, #eeaa18 92%);

  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --chip-bg: rgba(238, 170, 24, .16);

  /* Typo */
  --font: 'Satoshi', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Formes & layout */
  --r-card: 16px;
  --r-sm: 6px;
  --gutter: clamp(20px, 4vw, 64px);
  --max: 1440px;
  --section-y: clamp(120px, 13vw, 200px);

  /* Courbes */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3 { color: var(--white); font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
::selection { background: var(--gold-light); color: var(--bg); }
:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 4px; border-radius: 2px; }


.skip {
  position: fixed; left: 16px; top: -60px; z-index: 10000;
  background: var(--gold-light); color: var(--ink); padding: 10px 14px; border-radius: var(--r-sm);
  transition: top .3s;
}
.skip:focus { top: 16px; }

/* ---------- Layout & typo ---------- */
main, .footer { position: relative; z-index: 2; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: var(--section-y); }

/* Ligne de séparation entre les grandes parties, avec une marge pour ne pas toucher les bords */
.divider {
  position: relative; height: 1px; margin-inline: var(--gutter);
  background: var(--line-strong); transform-origin: center;
  transition: transform 1.8s var(--ease-out);
}
.js .divider { transform: scaleX(0); }
.js .divider.is-in { transform: scaleX(1); }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-light);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--gold-light); box-shadow: 0 0 12px rgba(251, 200, 67, .8);
}

.h2 {
  font-size: clamp(2.25rem, 1.2rem + 3.4vw, 3.8125rem);
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 15ch;
}
.section-head { display: grid; gap: 24px; margin-bottom: clamp(56px, 7vw, 96px); }
.section-head__lead { max-width: 440px; color: var(--muted); }
.section-head--row { grid-template-columns: 1fr auto; align-items: end; column-gap: 48px; }
.section-head--row > div { display: grid; gap: 24px; }
.section-head--center { justify-items: center; text-align: center; }
.section-head--center .h2 { margin-inline: auto; }
.fig { color: var(--faint); line-height: 1.7; }

/* ---------- Icônes ---------- */
.ico { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* ---------- Texte « roll » (lettres qui roulent au survol) ---------- */
.roll { display: inline-flex; overflow: hidden; line-height: 1.25; vertical-align: top; }
.roll__c {
  display: inline-block; position: relative; white-space: pre;
  transition: transform .6s var(--ease-in-out);
  transition-delay: calc(var(--i) * 16ms);
}
.roll__c::after { content: attr(data-c); position: absolute; left: 0; top: 100%; }
:is(a, button):hover .roll__c { transform: translateY(-100%); }

/* ---------- Boutons ---------- */
/* Survol simple, comme les choix du formulaire : léger soulèvement + bordure qui s'éclaire */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  height: 56px; padding: 0 26px; border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  transition: border-color .35s, transform .5s var(--ease-back);
}
.btn:hover { transform: translateY(-2px); border-color: rgba(251, 200, 67, .5); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.btn--gold { color: var(--ink); background: var(--grad-gold); }
.btn--gold:hover { border-color: var(--white); }

.btn--sm { height: 44px; padding: 0 18px; font-size: 11.5px; }

.link-arrow {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 56px;
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--white);
}
.link-arrow::before, .link-arrow::after {
  content: ""; position: absolute; left: 0; right: 24px; bottom: 14px; height: 1px; background: currentColor;
}
.link-arrow::before { opacity: .22; }
.link-arrow::after { transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease-out); }
.link-arrow:hover::after { transform: scaleX(1); transform-origin: left; }
.link-arrow .ico { transition: transform .6s var(--ease-out); }
.link-arrow:hover .ico { transform: rotate(45deg); }

.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 100% 100%; background-repeat: no-repeat;
  transition: background-size .6s var(--ease-out), color .4s;
  padding-bottom: 2px;
}
.link-underline:hover { background-size: 100% 1px; background-position: 0 100%; color: var(--white); }

.arrow-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--chip-bg); color: var(--white); overflow: hidden;
  transition: background-color .5s, color .5s;
}
.arrow-btn::before {
  content: ""; position: absolute; inset: 0; background: var(--grad-gold);
  transform: scale(0); border-radius: inherit; transition: transform .5s var(--ease-out);
}
.arrow-btn .ico { position: relative; transition: transform .6s var(--ease-out); }
:is(a, button):hover .arrow-btn { color: var(--ink); }
:is(a, button):hover .arrow-btn::before { transform: scale(1); }
:is(a, button):hover .arrow-btn .ico { transform: rotate(45deg); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cream); padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: rgba(8, 7, 6, .45);
}

.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--cream);
  padding: 10px 14px; border-radius: var(--r-sm);
  background: rgba(33, 29, 24, .5); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.status__dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--gold-light); animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(251, 200, 67, .6); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(251, 200, 67, 0); }
}

/* ---------- Couches de fond ---------- */
.depth-tint {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(140% 90% at 50% 10%, #080706 0%, #050404 100%);
  opacity: var(--depth, 0);
}
.orb { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 70; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
}

/* ---------- Intro : logo Ostio → explosion en planète ---------- */
/* Pendant l'intro, le canevas des particules passe au-dessus du voile pour « sortir » du logo */
html.is-intro .orb { z-index: 9600; }
.intro {
  position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; overflow: hidden;
  pointer-events: none;
}
html.no-js .intro, .intro.is-gone { display: none; }
.intro__bg { position: absolute; inset: 0; background: var(--bg-deep); transition: opacity .9s var(--ease-out) .1s; }
html.is-burst .intro__bg { opacity: 0; }

/* Logo en minuscules : plus grand qu'en capitales pour garder la même largeur à l'écran */
.intro__brand { --F: clamp(4.8rem, min(25vw, 41vh), 23.5rem); position: relative; display: inline-flex; flex-direction: column; }
.intro__logo {
  position: relative; white-space: nowrap; user-select: none;
  /* rogné seulement en bas : les lettres sortent de la ligne de base, le point tombe d'en haut sans être coupé */
  clip-path: inset(-100vh -100vw 0);
  padding: 0 .06em .02em;
  font-size: var(--F); font-weight: 500; line-height: .8; letter-spacing: -0.04em;
  transition: opacity .3s ease-out, filter .3s ease-out;
}
.intro__l {
  display: inline-block; color: transparent;
  /* marge intérieure compensée : le texte découpé n'est pas rogné sur les bords des lettres */
  padding-inline: .08em; margin-inline: -.08em;
  /* dégradé blanc → transparent, comme le logo du footer */
  background: linear-gradient(180deg, var(--white) 25%, rgba(246, 240, 230, .12) 100%);
  -webkit-background-clip: text; background-clip: text;
  transform: translateY(110%); /* cachées sous la ligne de base jusqu'à l'impact du point (classe ajoutée par main.js) */
}
/* Au premier impact du point d'or, les lettres sortent en partant du ı, puis vers les bords */
.intro.is-landed .intro__l { animation: introRise 1s var(--ease-out) both; }
.intro.is-landed .intro__l:is(:nth-of-type(3), :nth-of-type(5)) { animation-delay: .08s; }
.intro.is-landed .intro__l:nth-of-type(2) { animation-delay: .16s; }
.intro.is-landed .intro__l:nth-of-type(1) { animation-delay: .24s; }
.intro__probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
@keyframes introRise { from { transform: translateY(110%); } to { transform: none; } }

/* Le point d'or attend au-dessus de l'écran ; main.js le fait tomber (gravité, rebonds) jusqu'à sa place */
.intro .idot { transform-origin: 50% 100%; }
.intro:not(.is-landed) .idot { transform: translateY(-100vh); }

/* Le logo se dissout en points (dessinés par le canevas) puis explose */
.intro.is-dissolve .intro__logo { opacity: 0; filter: blur(6px) brightness(1.6); }
.intro__flash, .intro__wave { position: absolute; left: 50%; top: 50%; border-radius: 50%; opacity: 0; }
.intro__flash {
  width: 80vmin; height: 80vmin; margin: -40vmin 0 0 -40vmin;
  background: radial-gradient(circle, rgba(246, 240, 230, .85), rgba(251, 200, 67, .3) 28%, rgba(192, 135, 10, .12) 50%, transparent 68%);
}
.intro__wave { width: 40vmin; height: 40vmin; margin: -20vmin 0 0 -20vmin; border: 1px solid rgba(251, 200, 67, .7); }
.intro.is-boom .intro__flash { animation: introFlash .8s var(--ease-out) both; }
.intro.is-boom .intro__wave { animation: introWave 1.1s var(--ease-out) both; }
.intro.is-boom .intro__wave--2 { animation-delay: .08s; animation-duration: 1.35s; border-color: rgba(238, 170, 24, .55); }
@keyframes introFlash {
  0% { opacity: 0; transform: scale(.3); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.7); }
}
@keyframes introWave {
  0% { opacity: .9; transform: scale(.15); }
  100% { opacity: 0; transform: scale(3.6); }
}

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 80px;
  transition: transform .7s var(--ease-in-out), background-color .5s;
}
.header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line); transform: scaleX(0); transition: transform .9s var(--ease-out);
}
.header.is-scrolled { background: rgba(14, 13, 11, .6); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.header.is-scrolled::after { transform: scaleX(1); }
.header.is-hidden { transform: translateY(-100%); }
html.menu-open .header { transform: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.menu-open .header::after { transform: scaleX(0); }

.header__inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.header__cta { justify-self: end; }
.js .header__inner { opacity: 0; transform: translateY(-20px); transition: opacity 1s .5s, transform 1.2s .5s var(--ease-out); }
html.is-loaded .header__inner { opacity: 1; transform: none; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--white); justify-self: start; }
.logo__mark { width: 30px; height: 30px; }
.logo__mark svg { width: 100%; height: 100%; overflow: visible; }
.logo__core { fill: var(--gold-light); transition: fill .4s; }
.logo__ring { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: .85; }
.logo__sat { fill: var(--white); transform-origin: 16px 16px; animation: orbit 6s linear infinite; }
.logo:hover .logo__sat { animation-duration: 1.4s; }
.logo:hover .logo__core { fill: var(--highlight); }
@keyframes orbit { to { transform: rotate(360deg); } }
/* remonté d'un cheveu : le centre des minuscules (o, s, o) tombe pile sur le centre de l'icône */
.logo__word { position: relative; top: -.06em; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
/* Point du i d'ostio : un point d'or dessiné en CSS au-dessus d'un ı (i sans point), à la place
   exacte du point de la police (mesuré sur Satoshi), un peu plus gros. Ses marges négatives
   annulent sa place dans la ligne : les lettres gardent exactement leur position. */
.idot {
  display: inline-block; width: .134em; height: .134em; vertical-align: baseline;
  margin: -.734em -.181em .6em .047em; border-radius: 50%;
  background: var(--gold-light); box-shadow: 0 0 .1em .02em rgba(251, 200, 67, .5);
}
.logo__tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted);
  /* 2px en haut : les capitales descendent sur l'axe de l'icône, le trait de séparation reste centré */
  padding: 2px 0 0 10px; margin-left: 2px; border-left: 1px solid var(--line-strong);
}

.nav ul { display: flex; gap: 32px; }
.nav__link {
  position: relative; display: inline-flex; padding: 6px 0;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .4s;
}
.nav__link:hover, .nav__link.is-active { color: var(--white); }
.nav__link::before {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--gold-light); box-shadow: 0 0 8px var(--gold-light);
  transform: scale(0); transition: transform .45s var(--ease-back);
}
.nav__link.is-active::before { transform: scale(1); }

.burger { display: none; position: relative; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface); justify-self: end; }
.burger span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--white); transition: transform .5s var(--ease-in-out), top .5s var(--ease-in-out); }
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 25px; }
html.menu-open .burger span:first-child { top: 21.5px; transform: rotate(45deg); }
html.menu-open .burger span:last-child { top: 21.5px; transform: rotate(-45deg); }

/* ---------- Menu mobile ---------- */
.menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 120px var(--gutter) 40px; background: var(--bg-deep);
  clip-path: circle(0% at calc(100% - var(--gutter) - 22px) 40px);
  visibility: hidden;
  transition: clip-path .9s var(--ease-in-out), visibility 0s .9s;
}
html.menu-open .menu { clip-path: circle(150% at calc(100% - var(--gutter) - 22px) 40px); visibility: visible; transition: clip-path .9s var(--ease-in-out), visibility 0s; }
.menu__link { display: flex; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow: hidden; }
.menu__num { color: var(--faint); }
.menu__txt {
  display: inline-block; font-size: clamp(2.4rem, 10vw, 4rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.04em; color: var(--white);
  transform: translateY(115%); transition: transform .9s var(--ease-out);
}
.menu__link:nth-child(1) .menu__txt { transition-delay: .25s; }
.menu__link:nth-child(2) .menu__txt { transition-delay: .31s; }
.menu__link:nth-child(3) .menu__txt { transition-delay: .37s; }
.menu__link:nth-child(4) .menu__txt { transition-delay: .43s; }
.menu__link:nth-child(5) .menu__txt { transition-delay: .49s; }
.menu__link:nth-child(6) .menu__txt { transition-delay: .55s; }
html.menu-open .menu__txt { transform: none; }
.menu__foot { display: grid; gap: 16px; }
.menu__mail { font-size: 20px; color: var(--cream); }
.menu__socials { display: flex; gap: 20px; color: var(--muted); }

/* ---------- Jauge de progression (côté droit) ---------- */
.hud {
  position: fixed; right: 22px; top: 50%; z-index: 40; transform: translateY(-50%);
  pointer-events: none; opacity: 0; transition: opacity 1.2s .8s;
}
html.is-loaded .hud { opacity: 1; }
.hud__gauge {
  --p: 0;
  position: relative; width: 2px; height: clamp(220px, 46vh, 440px);
  border-radius: 2px; background: var(--line-strong);
}
/* Partie déjà parcourue, en surbrillance */
.hud__gauge::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--p) * 100%);
  border-radius: inherit; background: linear-gradient(to bottom, rgba(192, 135, 10, .2), var(--gold-light));
  box-shadow: 0 0 10px rgba(251, 200, 67, .45);
}
.hud__gauge span {
  position: absolute; left: 50%; top: calc(var(--p) * 100%); width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 16px 2px rgba(251, 200, 67, .75);
}

/* ---------- Révélations au scroll ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(48px);
  transition: opacity 1s var(--ease-out), transform 1.3s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 100ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Découpage des titres (mots / lettres masqués) */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding: .08em .03em .14em; margin: -.08em -.03em -.14em; }
.sw__in, .sc {
  display: inline-block; transform: translate3d(0, 120%, 0) rotate(8deg); transform-origin: 0 100%;
  transition: transform 1.3s var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger, 40ms) + var(--delay, 0ms));
}
[data-split="chars"] { --stagger: 22ms; }
[data-split].is-in .sw__in, [data-split].is-in .sc { transform: none; }
/* Une fois révélés, les mots/lettres réagissent au survol */
[data-split].is-done .sw__in, [data-split].is-done .sc { transition: transform .6s var(--ease-out), color .4s; transition-delay: 0s; }
[data-split].is-done .sc:hover, [data-split].is-done .sw__in:hover { transform: translateY(-5%); color: var(--gold-light); }

/* Mots qui s'allument au scroll */
.lw { color: rgba(246, 240, 230, .14); transition: color .5s, text-shadow .5s; }
.lw.is-lit { color: var(--white); }
.lw.is-front { text-shadow: 0 0 24px rgba(251, 200, 67, .55); }

/* ---------- Responsive commun ---------- */
@media (max-width: 1100px) { .hud { display: none; } }
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: block; }
  .header__inner { grid-template-columns: 1fr auto auto; }
}
@media (max-width: 560px) {
  .header__cta, .logo__tag { display: none; }
  .section-head--row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
}
