/* The landing page's hero in 3D: the relay's own pieces (the sources, the EC 560 sheet, Expadon)
   placed in one scene inside the hero card, Certisia drawn in WebGL behind them, the bubbles of
   information in front (hero.min.js). Everything here is scoped to the card. */
.hero3d {
  --h3-ink: #e8eef4;
  --h3-ink-3: #93a3b3;
  --h3-blue-ink: #7db8e8;
  --h3-green: #4dbd6c;
  --h3-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.home .home-hero .hero-card.hero3d {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 16px);
  height: calc(100svh - 16px); /* on a phone, the screen left by the browser's bars */
  min-height: 560px;
  padding: 0;
  background: radial-gradient(120% 90% at 70% 0%, #14304d 0%, #08111b 62%);
  color: var(--h3-ink);
}
.hero3d .h3-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero3d #gl-back { z-index: 0; }
.hero3d #css3d { z-index: 1; overflow: hidden; }
.hero3d #gl-front { z-index: 2; }
.hero3d #pieces { position: absolute; left: -20000px; top: 0; }

/* The pieces, sized for the scene (their look is home.css's). */
.hero3d .relay.p-piece { display: block; max-width: none; margin: 0; column-gap: 0; }
.hero3d .p-srcs { width: 236px; }
.hero3d .p-srcs .srcs { grid-template-columns: minmax(0, 1fr); }
.hero3d .p-sheet { width: var(--sheet-w, 280px); }
.hero3d .p-sheet .sheet-live { width: 100%; }
.hero3d .p-rxp { width: 600px; }
.hero3d .p-rxp .relay-xp .xpd-scaled { zoom: 1; width: 600px; }

/* The four steps' captions: the step's number, a hairline, the step in small capitals; the caption of
   the step playing lights up green (in a second, and only once everything under it is still). */
.hero3d .p-label { width: 280px; }
.hero3d .v-cap { display: grid; justify-items: center; gap: 10px; text-align: center; }
.hero3d .v-cap-head { display: flex; align-items: center; gap: 10px; }
.hero3d .v-cap-n { font: 700 13px/1 var(--h3-sans); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--h3-blue-ink); transition: color 1s, text-shadow 1s; }
.hero3d .v-cap-rule { width: 32px; height: 1px; background: linear-gradient(90deg, rgba(125,184,232,.7), rgba(125,184,232,0)); transition: background 1s, width 1s; }
.hero3d .v-cap-t { font: 600 12px/1.45 var(--h3-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--h3-ink-3); transition: color 1s, text-shadow 1s; }
.hero3d .v-cap.on .v-cap-n { color: var(--h3-green); text-shadow: 0 0 14px rgba(77,189,108,.65); }
.hero3d .v-cap.on .v-cap-rule { width: 48px; background: linear-gradient(90deg, rgba(77,189,108,.9), rgba(77,189,108,0)); }
.hero3d .v-cap.on .v-cap-t { color: #8fe0a6; text-shadow: 0 0 16px rgba(77,189,108,.55), 0 0 2px rgba(77,189,108,.4); }

/* The claim above, the way in below. */
.hero3d .hero-top { position: absolute; z-index: 3; top: calc(62px + 1.5vh); left: 0; right: 0; display: grid; justify-items: center; padding-inline: 24px; text-align: center; }
.home .hero3d .hero-top h1 {
  display: block; margin: 0; padding-bottom: .14em;
  font-size: clamp(30px, min(3.4vw, 6.2vh), 52px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700;
  background: linear-gradient(180deg, #ffffff 30%, #9db3c9 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero3d .hero-ctas-3d { position: absolute; z-index: 3; bottom: 20px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.hero3d .hero-ctas-3d .cta { padding: 10px 20px; font-size: 15px; }
.hero3d .hero-ctas-3d .cta svg { width: 16px; height: 16px; }
.hero3d .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The bar: the mark and the name a size up, on a computer (a phone's bar has no room for it). */
@media (min-width: 861px) {
  .home .bar .mark { width: 40px; height: 40px; }
  .home .bar .brand { gap: 12px; font-size: 23px; line-height: 40px; }
}

/* On a phone held upright the relay is shown one level at a time (hero.js adds `portrait`): the
   sources two by two, each caption above its piece; the scene shows only between the claim and the
   buttons (--bt, --bb, from hero.js), fading out at both edges as it goes by. */
/* Its two buttons are left out there: the page's « Créer un compte » and « Voir un exemple » come right
   after the card, and the relay takes the room. */
.hero3d.portrait .hero-ctas-3d { display: none; }
.hero3d.portrait .p-srcs { width: 344px; }
.hero3d.portrait .p-srcs .srcs { grid-template-columns: 1fr 1fr; gap: 10px; }
.hero3d.portrait .p-label { width: 320px; }
.hero3d.portrait .h3-layer {
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--bt, 0px), #000 calc(var(--bt, 0px) + 36px), #000 calc(var(--bb, 100%) - 36px), transparent var(--bb, 100%));
  mask-image: linear-gradient(to bottom, transparent var(--bt, 0px), #000 calc(var(--bt, 0px) + 36px), #000 calc(var(--bb, 100%) - 36px), transparent var(--bb, 100%));
}

/* The sources light up green from left to right (a green layer revealed by its clip), then the bubbles
   leave from their right edge; when they have gone it fades out, and only then is the clip reset. */
.hero3d .p-srcs .srcs li { position: relative; }
.hero3d .p-srcs .srcs li::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(77,189,108,.75);
  background: linear-gradient(90deg, rgba(77,189,108,.06), rgba(77,189,108,.2));
  box-shadow: inset -12px 0 18px -14px rgba(127,214,153,.9);
  opacity: 0; clip-path: inset(0 100% 0 0);
  transition: opacity 300ms ease, clip-path 0s linear 300ms;
}
.hero3d .p-srcs .srcs li.sweep::after { opacity: 1; clip-path: inset(0 0 0 0); transition: clip-path 700ms cubic-bezier(.45,0,.25,1), opacity 120ms ease; }

/* Upright, the sources light up green from top to bottom (the bubbles then leave from their bottom edge). */
.hero3d.portrait .p-srcs .srcs li::after {
  background: linear-gradient(180deg, rgba(77,189,108,.06), rgba(77,189,108,.2));
  box-shadow: inset 0 -12px 18px -14px rgba(127,214,153,.9);
  clip-path: inset(0 0 100% 0);
}
.hero3d.portrait .p-srcs .srcs li.sweep::after { clip-path: inset(0 0 0 0); }
