/* tradeportpilot.com — pages publiques (accueil, acheteurs, fournisseurs).
   La page prend la palette de la section qui passe au milieu de l'écran (attribut data-palette posé sur <html> par
   app.js) : fond et texte glissent d'une palette à l'autre. Des formes décoratives défilent chacune à sa vitesse
   (parallaxe) ; les petites, plus lentes et floues, donnent la profondeur. Rien n'est téléchargé : formes en CSS,
   polices du système. Mouvement réduit respecté. */

/* --- palettes ------------------------------------------------------------------------------------ */

:root {
  --site-glow: 1;
  --site-bg: #0a182b;
  --site-ink: #ffffff;
  --site-muted: #b9c8db;
  --site-accent: #5fb7be;
  --site-card: rgba(255, 255, 255, 0.06);
  --site-card-line: rgba(255, 255, 255, 0.14);
  --site-shape: rgba(95, 183, 190, 0.55);
  --site-shape-2: rgba(255, 255, 255, 0.22);
}

html[data-palette="night"] {
  --site-glow: 1;
  --site-bg: #0a182b;
  --site-ink: #ffffff;
  --site-muted: #b9c8db;
  --site-accent: #5fb7be;
  --site-card: rgba(255, 255, 255, 0.06);
  --site-card-line: rgba(255, 255, 255, 0.14);
  --site-shape: rgba(95, 183, 190, 0.55);
  --site-shape-2: rgba(255, 255, 255, 0.22);
}

html[data-palette="mist"] {
  --site-glow: 0;
  --site-bg: #f3f6fa;
  --site-ink: #142d4e;
  --site-muted: #566377;
  --site-accent: #006d77;
  --site-card: #ffffff;
  --site-card-line: #e1e7ef;
  --site-shape: rgba(0, 109, 119, 0.28);
  --site-shape-2: rgba(20, 45, 78, 0.16);
}

html[data-palette="lagoon"] {
  --site-glow: 0.6;
  --site-bg: #04434a;
  --site-ink: #f2fbfb;
  --site-muted: #b7dcdf;
  --site-accent: #9fe0e5;
  --site-card: rgba(255, 255, 255, 0.07);
  --site-card-line: rgba(255, 255, 255, 0.16);
  --site-shape: rgba(159, 224, 229, 0.5);
  --site-shape-2: rgba(255, 255, 255, 0.2);
}

/* Démarrage : rien de l'habillage avant la première page. */
body.is-booting .demo-banner,
body.is-booting .topbar,
body.is-booting > .footer {
  visibility: hidden;
}

body.is-booting-public {
  background: #0a182b;
}

body.is-public {
  background: var(--site-bg);
  color: var(--site-ink);
}

body.is-public .demo-banner,
body.is-public > .footer {
  display: none;
}

body.is-public .main {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.is-public .view.site {
  animation: none;
}

.site {
  position: relative;
  overflow: hidden;
  color: var(--site-ink);
}

.site > * + * {
  margin-top: 0;
}

.site h1,
.site h2,
.site h3 {
  color: var(--site-ink);
}

.site .eyebrow {
  color: var(--site-accent);
}

/* --- formes en parallaxe ------------------------------------------------------------------------- */

.site-parallax {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site > *:not(.site-parallax) {
  position: relative;
  z-index: 1;
}

.fx {
  position: absolute;
  display: block;
  will-change: transform;
}

.fx--blur {
  filter: blur(2px);
  opacity: 0.7;
}

.fx--ring {
  border: 1.5px solid var(--site-shape);
  border-radius: 50%;
}

.fx--ring-xl {
  top: 120px;
  right: -180px;
  width: 620px;
  height: 620px;
  box-shadow: 0 0 0 70px rgba(95, 183, 190, 0.04), 0 0 0 140px rgba(95, 183, 190, 0.025);
}

.fx--ring-s {
  top: 900px;
  left: -60px;
  width: 220px;
  height: 220px;
}

/* Des conteneurs maritimes stylisés : un rectangle aux nervures verticales. */
.fx--box {
  width: 132px;
  height: 52px;
  border: 1.5px solid var(--site-shape);
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, transparent 0 14px, var(--site-shape-2) 14px 15.5px);
}

.fx--box-a {
  top: 560px;
  right: 9%;
  transform-origin: center;
}

.fx--box-b {
  top: 1180px;
  left: 6%;
  width: 92px;
  height: 36px;
}

.fx--box-c {
  top: 1650px;
  right: 14%;
  width: 110px;
  height: 44px;
}

.fx--dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--site-accent);
  box-shadow: 0 0 0 6px rgba(95, 183, 190, 0.12);
}

.fx--dot-a {
  top: 210px;
  left: 46%;
}

.fx--dot-b {
  top: 760px;
  left: 12%;
  width: 16px;
  height: 16px;
}

.fx--dot-c {
  top: 1420px;
  right: 30%;
}

/* Une route maritime : un arc en pointillé. */
.fx--route {
  top: 980px;
  right: -40px;
  width: 520px;
  height: 260px;
  border: 2px dashed var(--site-shape);
  border-color: var(--site-shape) transparent transparent transparent;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* --- en-tête du site -------------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 18px 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 40px);
}

.site-brand {
  color: var(--site-ink);
}

.site-brand:hover {
  color: var(--site-ink);
}

.site-brand .brand__name {
  font-size: 1.08rem;
}

.site-nav {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
}

.site-nav__link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--site-muted);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  background: var(--site-card);
  color: var(--site-ink);
}

.site-signin {
  border-color: var(--site-card-line);
  background: var(--site-card);
  color: var(--site-ink);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.site-signin:hover {
  border-color: var(--site-accent);
  background: var(--site-card);
  color: var(--site-ink);
}

/* --- bandeau d'accueil ----------------------------------------------------------------------------- */

.site-hero {
  padding-bottom: clamp(48px, 7vw, 96px);
}

/* Le halo du bandeau s'efface quand la page passe à une palette claire. */
.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 85% 10%, rgba(95, 183, 190, 0.22), transparent 70%),
    radial-gradient(50% 60% at 0% 90%, rgba(30, 60, 102, 0.55), transparent 70%);
  opacity: var(--site-glow);
  pointer-events: none;
}

.site-hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 40px) 0;
}

.site-hero h1 {
  max-width: 16ch;
  margin-top: 14px;
  font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4.1rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.gradient-text {
  background: linear-gradient(100deg, #9fe0e5 0%, #5fb7be 45%, #e6f6f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-hero__lead {
  max-width: 54ch;
  margin-top: 18px;
  color: var(--site-muted);
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.16rem);
  line-height: 1.65;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 18px;
  overflow: hidden;
  border: 1px solid var(--site-card-line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--site-ink);
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.choice-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 183, 190, 0.35), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: rgba(159, 224, 229, 0.7);
  color: var(--site-ink);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  transform: translateY(-4px);
}

.choice-card:hover::before,
.choice-card:focus-visible::before {
  opacity: 1;
}

.choice-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b838e, #006d77);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(0, 109, 119, 0.8);
}

.choice-card--supplier .choice-card__icon {
  background: linear-gradient(135deg, #3d5b84, #1e3c66);
  box-shadow: 0 8px 18px -8px rgba(30, 60, 102, 0.9);
}

.choice-card__icon svg {
  width: 22px;
  height: 22px;
}

.choice-card__kicker {
  color: var(--site-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice-card__title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.choice-card__text {
  color: var(--site-muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.choice-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 650;
}

.choice-card__arrow {
  transition: transform 0.25s ease;
}

.choice-card:hover .choice-card__arrow {
  transform: translateX(4px);
}

/* --- illustration d'offres comparées ------------------------------------------------------------------ */

.site-hero__visual {
  perspective: 1400px;
}

.mock {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--site-card-line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--site-ink);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  transform: rotateY(-10deg) rotateX(6deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-hero__visual:hover .mock {
  transform: rotateY(-3deg) rotateX(2deg);
}

html[data-palette="mist"] .mock {
  background: #ffffff;
  box-shadow: 0 30px 60px -30px rgba(20, 45, 78, 0.35);
}

.mock__head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--site-muted);
  font-size: 0.8rem;
}

.mock__dots {
  display: inline-flex;
  gap: 5px;
}

.mock__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--site-card-line);
}

.mock__tag {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px dashed var(--site-card-line);
  border-radius: 999px;
  font-weight: 600;
}

.mock__title {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
}

.mock__row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.9fr;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.mock__row + .mock__row {
  margin-top: 6px;
}

.mock__row--head {
  color: var(--site-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mock__row:not(.mock__row--head) {
  border: 1px solid var(--site-card-line);
  background: var(--site-card);
}

.mock__row.is-chosen {
  border-color: rgba(159, 224, 229, 0.7);
  background: linear-gradient(90deg, rgba(95, 183, 190, 0.25), rgba(95, 183, 190, 0.06));
}

.mock__ref {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.mock__muted {
  color: var(--site-muted);
}

.mock__badge {
  justify-self: start;
  padding: 2px 9px;
  border-radius: 999px;
  background: #5fb7be;
  color: #0a182b;
  font-size: 0.74rem;
  font-weight: 700;
}

.mock__caption {
  margin-top: 12px;
  color: var(--site-muted);
  font-size: 0.8rem;
}

/* --- sections ------------------------------------------------------------------------------------- */

.site-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) clamp(18px, 4vw, 40px);
}

.site-title {
  max-width: 24ch;
  margin-top: 12px;
  font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.6rem);
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.site-text {
  max-width: 56ch;
  margin-top: 14px;
  color: var(--site-muted);
  font-size: 1.04rem;
}

.how {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.how__step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 22px;
  border: 1px solid var(--site-card-line);
  border-radius: 18px;
  background: var(--site-card);
  color: var(--site-muted);
  font-size: 0.95rem;
  box-shadow: 0 18px 40px -28px rgba(20, 45, 78, 0.45);
  backdrop-filter: blur(10px);
}

.how__step strong {
  color: var(--site-ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.how__num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b838e, #006d77);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 750;
}

.values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.value {
  padding: 24px 22px;
  border: 1px solid var(--site-card-line);
  border-radius: 18px;
  background: var(--site-card);
  backdrop-filter: blur(10px);
}

.value strong {
  display: block;
  margin-top: 14px;
  color: var(--site-ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.value p {
  margin-top: 6px;
  color: var(--site-muted);
  font-size: 0.95rem;
}

.value__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--site-card);
  color: var(--site-accent);
  box-shadow: inset 0 0 0 1px var(--site-card-line);
}

.value__icon svg {
  width: 21px;
  height: 21px;
}

.site-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.site-cta {
  width: min(1160px, calc(100% - 2 * clamp(18px, 4vw, 40px)));
  margin: 0 auto clamp(48px, 6vw, 80px);
  padding: clamp(40px, 6vw, 72px) clamp(22px, 5vw, 64px);
  border: 1px solid var(--site-card-line);
  border-radius: 28px;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(95, 183, 190, 0.3), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  text-align: center;
}

.site-cta h2 {
  font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.7rem);
  font-weight: 740;
  letter-spacing: -0.03em;
}

.site-cta p {
  margin-top: 10px;
  color: var(--site-muted);
}

.site-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.site-hero .site-cta__actions {
  justify-content: flex-start;
}

.site .btn:not(.btn--primary) {
  border-color: var(--site-card-line);
  background: var(--site-card);
  color: var(--site-ink);
  box-shadow: none;
}

.site .btn--primary {
  min-height: 46px;
  padding: 10px 22px;
}

.site-hint {
  color: var(--site-muted);
  font-size: 0.9rem;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--site-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.page-badge {
  display: grid;
  justify-self: center;
  place-items: center;
  width: clamp(160px, 22vw, 260px);
  aspect-ratio: 1;
  border: 1px solid var(--site-card-line);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(95, 183, 190, 0.35), rgba(255, 255, 255, 0.03) 70%);
  color: var(--site-accent);
  box-shadow: 0 0 0 40px rgba(95, 183, 190, 0.05), 0 0 0 80px rgba(95, 183, 190, 0.03);
}

.page-badge svg {
  width: 38%;
  height: 38%;
}

.site-hero--page h1 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.4rem);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 40px) 46px;
  border-top: 1px solid var(--site-card-line);
  color: var(--site-muted);
  font-size: 0.88rem;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--site-ink);
}

.site-footer__brand .brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}

.site-footer__note {
  max-width: 60ch;
}

/* --- apparitions au défilement ----------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mouvement réduit : un fondu, sans glissement. */
html.site-reduced .reveal {
  transform: none;
  transition: opacity 0.6s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.how .reveal:nth-child(2),
.values .reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.how .reveal:nth-child(3),
.values .reveal:nth-child(3) {
  transition-delay: 0.16s;
}

.how .reveal:nth-child(4),
.values .reveal:nth-child(4) {
  transition-delay: 0.24s;
}

/* --- entrée du bandeau ------------------------------------------------------------------------------ */

.site-hero .site-hero__text > * {
  animation: site-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.site-hero .site-hero__text > *:nth-child(2) {
  animation-delay: 0.08s;
}

.site-hero .site-hero__text > *:nth-child(3) {
  animation-delay: 0.16s;
}

.site-hero .site-hero__text > *:nth-child(4) {
  animation-delay: 0.26s;
}

.site-hero__visual {
  animation: site-in 1s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes site-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- petits écrans ------------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .site-hero__body,
  .site-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .how,
  .values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mock {
    transform: none;
  }

  .page-badge {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .choices,
  .how,
  .values {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header {
    gap: 12px;
    padding-top: 16px;
  }

  .site-brand .brand__name {
    font-size: 0.98rem;
  }

  .site-signin {
    min-height: 38px;
    margin-left: auto;
    padding: 6px 14px;
    font-size: 0.9rem;
  }

  .site-nav {
    gap: 2px;
    margin: 0 -6px;
  }

  .site-nav__link {
    padding: 7px 10px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .fx--ring-xl {
    width: 360px;
    height: 360px;
    right: -160px;
  }
}

/* Mouvement réduit : rien ne bouge ; les couleurs suivent le défilement, les blocs apparaissent en fondu. */
@media (prefers-reduced-motion: reduce) {
  .choice-card,
  .mock,
  .site-hero .site-hero__text > *,
  .site-hero__visual {
    transition: none !important;
    animation: none !important;
  }

}
