/* =========================================================
   Ostio — Sections (1/2) : hero, bandeau, manifeste, expertise, méthode
   ========================================================= */

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding-top: 112px; padding-bottom: 32px;
}
.hero__rays {
  position: absolute; left: 0; right: 0; top: -10%; height: 95%; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  opacity: var(--rays, 1);
}
.hero__rays span {
  position: absolute; top: -20%; width: 13vw; height: 130%;
  background: linear-gradient(to bottom, rgba(251, 200, 67, .17), rgba(251, 200, 67, 0) 75%);
  transform-origin: top center; filter: blur(22px); mix-blend-mode: screen;
  animation: ray 10s ease-in-out infinite alternate;
}
.hero__rays span:nth-child(1) { left: 6%; rotate: 20deg; animation-duration: 11s; }
.hero__rays span:nth-child(2) { left: 26%; rotate: 12deg; width: 7vw; animation-duration: 8s; animation-delay: -3s; }
.hero__rays span:nth-child(3) { left: 46%; rotate: 4deg; width: 16vw; animation-duration: 13s; animation-delay: -6s; }
.hero__rays span:nth-child(4) { left: 64%; rotate: -8deg; width: 8vw; animation-duration: 9s; animation-delay: -2s; }
.hero__rays span:nth-child(5) { left: 82%; rotate: -18deg; animation-duration: 12s; animation-delay: -5s; }
/* Safari recalcule le flou à chaque image (accueil à 27 images/s au lieu de 60) : main.js le remplace
   par son résultat exact, un masque dégradé calculé une fois, sur une bande élargie de 3 × 22 px
   de chaque côté pour la diffusion. Sans JavaScript, le flou d'origine reste en place. */
.hero__rays.is-baked span { filter: none; box-sizing: content-box; padding-inline: 66px; margin-left: -66px; }
@keyframes ray {
  from { opacity: .3; translate: -3vw 0; }
  to { opacity: 1; translate: 3vw 0; }
}

.hero__content {
  position: relative; z-index: 1; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center;
  will-change: transform, opacity;
}
.hero__title {
  font-size: clamp(2.75rem, .9rem + 6vw, 6rem);
  line-height: .98; letter-spacing: -0.046em;
}
/* Le halo suit la forme des lettres (un text-shadow serait coupé en carré par le masque de chaque mot) */
.hero__title em { font-style: normal; color: var(--gold-light); filter: drop-shadow(0 0 26px rgba(238, 170, 24, .6)); }
.hero__lead { max-width: 580px; font-size: clamp(16px, .5vw + 13px, 18px); color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 32px; margin-top: 8px; }

.js [data-hero-fade] { opacity: 0; transform: translateY(26px); transition: opacity 1.2s var(--ease-out), transform 1.4s var(--ease-out); }
html.is-loaded [data-hero-fade] { opacity: 1; transform: none; }
.hero__lead[data-hero-fade] { transition-delay: .85s; }
.hero__actions[data-hero-fade] { transition-delay: 1s; }
.hero__bottom[data-hero-fade] { transition-delay: 1.3s; }
.hero__title { --delay: 250ms; }

.hero__bottom { position: relative; z-index: 1; display: flex; justify-content: flex-end; align-items: end; gap: 24px; }
.hero__list { color: var(--muted); }
.scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--cream); }
.scroll-hint__line { position: relative; width: 1px; height: 64px; overflow: hidden; background: var(--line-strong); }
.scroll-hint__line::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 45%;
  background: linear-gradient(to bottom, transparent, var(--gold-light));
  animation: drip 2.2s var(--ease-in-out) infinite;
}
@keyframes drip { from { transform: translateY(-100%); } to { transform: translateY(240%); } }

/* ---------- BANDEAU DÉFILANT ---------- */
.marquee {
  position: relative; z-index: 2; overflow: hidden;
  padding: 26px 0; border-block: 1px solid var(--line);
  background: rgba(8, 7, 6, .35);
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group {
  display: flex; align-items: center; flex: none;
  font-size: clamp(2.5rem, 1.4rem + 4vw, 5.375rem);
}
.marquee__group span {
  padding-inline: .38em; white-space: nowrap;
  font-weight: 500; line-height: 1; letter-spacing: -0.046em; color: var(--white);
  -webkit-text-stroke: 1px transparent;
  transition: color .5s, -webkit-text-stroke-color .5s;
}
.marquee__group span.is-outline { color: transparent; -webkit-text-stroke-color: rgba(246, 240, 230, .5); }
.marquee__group span:hover { color: transparent; -webkit-text-stroke-color: var(--gold-light); }
.marquee__group span.is-outline:hover { color: var(--white); -webkit-text-stroke-color: transparent; }
.marquee__dot {
  display: inline-block; flex: none; width: .2em; height: .2em; border-radius: 50%;
  background: var(--grad-gold); box-shadow: 0 0 .35em rgba(238, 170, 24, .6);
}

/* ---------- MANIFESTE ---------- */
.manifesto__body { max-width: 1000px; margin-inline: auto; text-align: center; }
.manifesto__text {
  font-size: clamp(1.75rem, .9rem + 2.5vw, 3.25rem);
  font-weight: 500; line-height: 1.12; letter-spacing: -0.03em; color: var(--white);
}

/* ---------- EXPERTISE ---------- */
.expertise__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.services { display: grid; gap: 8px; }
.service { position: relative; }
.service:not(:last-child)::after {
  content: ""; position: absolute; left: 36px; right: 36px; bottom: -4px; height: 1px; background: var(--line);
  transition: opacity .4s;
}
.service:hover::after { opacity: 0; }
.service__link {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 52px 1fr; gap: 20px; align-items: start;
  padding: 44px 36px; border-radius: var(--r-card);
  transition: background-color .6s var(--ease-out), box-shadow .6s;
}
.service__link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .5s;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(251, 200, 67, .15), rgba(192, 135, 10, .1) 40%, transparent 70%);
}
.service:hover .service__link { background-color: var(--surface); box-shadow: inset 0 0 0 1px rgba(251, 200, 67, .08); }
.service:hover .service__link::before { opacity: 1; }
.service__num { padding-top: 12px; color: var(--faint); transition: color .4s; }
.service:hover .service__num { color: var(--gold-light); }
.service__title { font-size: clamp(1.6rem, 1rem + 1.5vw, 2.25rem); line-height: 1.05; letter-spacing: -0.03em; transition: transform .7s var(--ease-out); }
.service:hover .service__title { transform: translateX(8px); }
.service__text { margin-top: 14px; max-width: 46ch; color: var(--muted); }
.service__more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .7s var(--ease-out), opacity .5s; }
.service__more > div { overflow: hidden; }
.service__more .tags { padding-top: 20px; }
.service:hover .service__more, .service:focus-within .service__more { grid-template-rows: 1fr; opacity: 1; }

.expertise__visual { position: sticky; top: 120px; }
.molecule { position: relative; max-width: 480px; margin-inline: auto; }
/* Atome en points dorés dessiné par js/atom.js */
.atom { display: block; width: 100%; aspect-ratio: 1 / 1; }

/* ---------- MÉTHODE (4 cartes centrées) ---------- */
.process { position: relative; z-index: 2; }
.process__pin { display: flex; flex-direction: column; gap: clamp(40px, 5vw, 72px); padding-block: var(--section-y); }
.process__head { display: flex; justify-content: center; text-align: center; }
.process__head > div { display: grid; justify-items: center; gap: 20px; }
.process__head .h2 { font-size: clamp(2rem, 1rem + 2.8vw, 3.4rem); max-width: 14ch; }
.process__viewport { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.process__track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.step {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 360px; padding: 32px 30px 32px; border-radius: var(--r-card);
  background: rgba(33, 29, 24, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .8s var(--ease-out), background-color .6s, opacity 1s var(--ease-out), translate 1.2s var(--ease-out);
}
/* Apparition en cascade, puis le chiffre s'allume */
.js .step { opacity: 0; translate: 0 48px; }
.js .step.is-in { opacity: 1; translate: 0 0; transition-delay: 0s, 0s, calc(var(--d, 0) * 140ms), calc(var(--d, 0) * 140ms); }
.step::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .5s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(251, 200, 67, .14), transparent 70%);
}
.step:hover { transform: translateY(-10px); transition-delay: 0s; }
.step:hover::before { opacity: 1; }
.step__num {
  font-size: clamp(4.5rem, 2.5rem + 3vw, 6.5rem); font-weight: 500; line-height: .9; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1px rgba(246, 240, 230, .35);
  transition: color .9s var(--ease-out), -webkit-text-stroke-color .9s;
}
.step.is-in .step__num { color: var(--highlight); -webkit-text-stroke-color: transparent; transition-delay: calc(var(--d, 0) * 140ms + .6s); }
.step__title { margin-top: 10px; font-size: clamp(1.6rem, 1rem + 1.3vw, 2.25rem); line-height: 1; letter-spacing: -0.03em; }
.step__text { color: var(--muted); }
.step__time { color: var(--gold-light); margin-top: auto; padding-top: 6px; }

/* ---------- Responsive (sections 1/2) ---------- */
@media (max-width: 1100px) {
  .process__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { min-height: 320px; }
}
@media (max-width: 1024px) {
  .expertise__grid { grid-template-columns: 1fr; }
  .expertise__visual { position: relative; top: 0; max-width: 400px; width: 100%; margin-inline: auto; }
}
@media (max-width: 600px) {
  .process__track { grid-template-columns: 1fr; }
  .step { min-height: 0; }
}
@media (max-width: 640px) {
  .hero__list { display: none; }
  .service__link { grid-template-columns: 1fr; padding: 32px 20px; }
  .service__num { display: none; }
  .service:not(:last-child)::after { left: 20px; right: 20px; }
}
