/* =========================================================
   PAGE D'ACCUEIL - HERO
   ========================================================= */

.home-hero {
  position: relative;
  overflow: clip;
  padding: 34px 0 72px;
}

.home-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 40px;
  align-items: center;
}

/* =========================================================
   FOND HERO
   ========================================================= */

.home-hero__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.home-hero__plus {
  position: absolute;
  color: rgb(var(--color-brand));
  font-size: 26px;
  font-weight: 700;
}

.home-hero__plus--left {
  top: 32%;
  left: -14%;
}

.home-hero__plus--right {
  top: 2%;
  right: 11%;
}

/* =========================================================
   COLONNE TEXTE
   ========================================================= */

.home-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.home-hero__title {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.5rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.home-hero__eyebrow {
  margin: 14px 0 0;
  color: rgb(var(--color-brand));
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero__description {
  max-width: 62ch;
  margin: 14px 0 10px;
  color: rgb(var(--color-text) / 0.9);
  font-size: 1rem;
}

/* =========================================================
   ACTIONS HERO
   ========================================================= */

.home-hero__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 30px;
  align-items: stretch;
  margin-top: 30px;
}

.hero-card-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 80px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  will-change: transform;
}

.hero-card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-dropdown);
  text-decoration: none;
}

.hero-card-link--primary {
  --arrow-color: rgb(255 255 255);
  color: rgb(255 255 255);
  background: rgb(var(--color-brand));
  border: 1px solid rgb(255 255 255 / 0.14);
}

.hero-card-link--secondary {
  --arrow-color: rgb(var(--color-brand));
  background: rgb(var(--color-surface));
  border: 2px solid rgb(var(--color-border));
}

.hero-card-link__content {
  display: block;
}

.hero-card-link__eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}

.hero-card-link__title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.08;
}

.hero-card-link__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
}

.hero-card-link__arrow {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-top: 3px solid var(--arrow-color);
  border-right: 3px solid var(--arrow-color);
}

.hero-card-link__arrow::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 0;
  width: 22px;
  height: 3px;
  background: var(--arrow-color);
  transform: rotate(-45deg);
  transform-origin: left center;
}

/* =========================================================
   PREUVES / RASSURANCE
   ========================================================= */

.home-hero__proof {
  margin-top: 40px;
}

.home-hero__proof-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-hero__proof-item {
  position: relative;
  max-width: 85%;
  padding-left: 36px;
  color: rgb(var(--color-text) / 0.85);
  font-size: 0.92rem;
  font-weight: 600;
}

.home-hero__proof-item::before {
  content: "✓";
  position: absolute;
  top: 0.15em;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: rgb(var(--color-text));
  background: rgb(var(--color-surface));
  border: 2px solid rgb(var(--color-border));
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

/* =========================================================
   COLONNE VISUELLE
   ========================================================= */

.home-hero__visual-column {
  display: flex;
  align-items: end;
  justify-content: center;
  min-width: 0;
}

.hero-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 460px;
  height: 620px;
  margin: 0;
  overflow: visible;
  perspective: 1200px;
  perspective-origin: 50% 38%;

  --visual-h: 620px;
  --grid-color: rgb(var(--color-border) / 0.75);

  --grid-size: 28px;
  --wall-cols: 12;
  --wall-w: calc(var(--wall-cols) * var(--grid-size));
  --wall-h: 252px;
  --wall-bottom: 195px;

  --floor-w: var(--wall-w);
  --floor-h: 350px;
  --floor-bottom: 170px;
  --floor-tilt: -89deg;

  --halo-size: 200px;
  --halo-left: 50%;
  --halo-bottom: 190px;

  --portrait-max-w: 330px;
  --portrait-bottom: 92px;
  --portrait-left: 55%;

  --badge-left: 259px;
  --badge-bottom: 107px;
}

/* =========================================================
   PORTRAIT
   ========================================================= */

.hero-visual__portrait {
  position: absolute;
  left: var(--portrait-left);
  bottom: var(--portrait-bottom);
  z-index: 5;
  width: auto;
  max-width: var(--portrait-max-w);
  max-height: calc(var(--visual-h) - 10px);
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  filter:
    grayscale(1)
    contrast(1.04)
    drop-shadow(20px -2px 40px rgb(var(--color-text) / 0.01))
    drop-shadow(20px -2px 12px rgb(var(--color-text) / 0.7));
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 1) 92%,
    rgb(0 0 0 / 0.25) 94%,
    rgb(0 0 0 / 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 1) 92%,
    rgb(0 0 0 / 0.25) 94%,
    rgb(0 0 0 / 0) 100%
  );
}

/* =========================================================
   HALO
   ========================================================= */

.hero-visual__halo {
  position: absolute;
  left: var(--halo-left);
  bottom: var(--halo-bottom);
  z-index: 1;
  width: var(--halo-size);
  height: var(--halo-size);
  opacity: 0.8;
  pointer-events: none;
  transform: translateX(-50%);
}

.hero-visual__halo-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-visual__halo-path {
  fill: rgb(var(--color-brand));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 18;
  filter:
    drop-shadow(0 0 10px rgb(var(--color-brand) / 0.18))
    drop-shadow(0 0 24px rgb(var(--color-brand) / 0.12));
}

/* =========================================================
   MUR
   ========================================================= */

.hero-visual__wall {
  position: absolute;
  left: 50%;
  bottom: var(--wall-bottom);
  z-index: 0;
  width: var(--wall-w);
  height: var(--wall-h);
  overflow: visible;
  border: 2px solid rgb(var(--color-border));
  opacity: 0.9;
  transform: translateX(-50%);
  background:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: 0 0, 0 0;
}

/* =========================================================
   LIGNE DE COTE
   ========================================================= */

.hero-visual__dimension {
  position: absolute;
  top: -38px;
  left: -18px;
  right: -18px;
  height: 28px;
  pointer-events: none;
}

.hero-visual__dimension::before,
.hero-visual__dimension::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 1px;
  height: 20px;
  background: rgb(var(--color-border));
}

.hero-visual__dimension::before {
  left: 16px;
}

.hero-visual__dimension::after {
  right: 16px;
}

.hero-visual__dimension-line {
  position: absolute;
  top: 50%;
  left: 18px;
  right: 18px;
  height: 1px;
  background: rgb(var(--color-border));
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  animation: draw-line 0.8s ease-out forwards;
}

.hero-visual__dimension-line::before,
.hero-visual__dimension-line::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgb(var(--color-border));
  border-right: 2px solid rgb(var(--color-border));
  opacity: 0;
  animation: fade-in 0.3s ease forwards;
  animation-delay: 0.7s;
}

.hero-visual__dimension-line::before {
  left: 0;
  transform: translateY(-50%) rotate(225deg);
}

.hero-visual__dimension-line::after {
  right: 0;
  transform: translateY(-50%) rotate(45deg);
}

.hero-visual__dimension-label {
  position: absolute;
  top: -2px;
  left: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  color: rgb(var(--color-text));
  background: rgb(var(--color-bg));
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  animation: label-in 0.4s ease forwards;
  animation-delay: 0.9s;
}

/* =========================================================
   SOL
   ========================================================= */

.hero-visual__floor {
  position: absolute;
  left: 50%;
  bottom: var(--floor-bottom);
  z-index: 2;
  width: var(--floor-w);
  height: var(--floor-h);
  overflow: hidden;
  border: 2px solid rgb(var(--color-border));
  transform: translateX(-50%) rotateX(var(--floor-tilt));
  transform-origin: center bottom;
  box-shadow:
    inset 0 1px 0 rgb(var(--color-border) / 0.16),
    0 -10px 40px rgb(255 255 255 / 0.24);
  background:
    repeating-linear-gradient(
      to right,
      var(--grid-color) 0 1px,
      transparent 1px var(--grid-size)
    ),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color)),
    linear-gradient(var(--grid-color), var(--grid-color));
  background-repeat:
    repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
  background-size:
    auto,
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px;
  background-position:
    0 0,
    0 calc(100% - 4%),
    0 calc(100% - 9%),
    0 calc(100% - 15%),
    0 calc(100% - 23%),
    0 calc(100% - 34%),
    0 calc(100% - 48%),
    0 calc(100% - 65%),
    0 calc(100% - 84%);
}

.hero-visual__floor::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  left: -2px;
  height: 2px;
  background: rgb(var(--color-border));
}

/* =========================================================
   BADGE
   ========================================================= */

.hero-visual__badge {
  position: absolute;
  z-index: 6;
  padding: 10px 14px;
  color: rgb(var(--color-text));
  background: rgb(255 255 255 / 0.7);
  backdrop-filter: blur(15px);
  box-shadow:
    0 12px 30px rgb(0 0 0 / 0.18),
    0 4px 10px rgb(0 0 0 / 0.25);
  font-family: "Inter", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  user-select: none;
}

.hero-visual__badge--identity {
  bottom: var(--badge-bottom);
  left: var(--badge-left);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  animation:
    float 4s ease-in-out infinite,
    badge-in 0.4s ease forwards;
  animation-delay: 0s, 0.9s;
}

.hero-visual__badge-label {
  font-size: 0.6rem;
  opacity: 0.7;
}

.hero-visual__badge-name {
  font-size: 0.9rem;
  font-weight: 700;
}

/* =========================================================
   LIGNES TECHNIQUES
   ========================================================= */

.hero-visual__tech-line {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
}

.hero-visual__tech-line::before,
.hero-visual__tech-line::after {
  content: "";
  position: absolute;
  background: rgb(var(--color-border) / 0.2);
}

.hero-visual__tech-line--right {
  top: 7%;
  right: -4%;
  width: 26%;
  height: 14%;
}

.hero-visual__tech-line--right::before {
  top: 42%;
  right: 0;
  width: 127%;
  height: 1px;
}

.hero-visual__tech-line--right::after {
  top: 0;
  right: 32%;
  width: 1px;
  height: 100%;
}

.hero-visual__tech-line--left {
  top: 1%;
  left: -8%;
  width: 25%;
  height: 17%;
}

.hero-visual__tech-line--left::before {
  top: 0;
  left: 50%;
  width: 1px;
  height: 103%;
}

.hero-visual__tech-line--left::after {
  top: 70%;
  left: 10px;
  width: 121%;
  height: 1px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes draw-line {
  from {
    transform: translateY(-50%) scaleX(0);
  }
  to {
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes label-in {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes badge-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* @keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
} */

/* @keyframes hero-portrait-float {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
} */

@keyframes hero-code-float {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-2px);
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-visual__portrait {
    animation: hero-portrait-float 8s ease-in-out infinite;
  }

  .hero-visual .svg-code {
    animation: hero-code-float 7s ease-in-out infinite;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .home-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 28px;
  }

  .home-hero__plus--left {
    left: -2%;
  }

  .hero-visual {
    width: min(100%, 400px);
    height: clamp(380px, 48vw, 540px);

    --visual-h: 520px;
    --grid-size: 24px;
    --wall-w: calc(var(--wall-cols) * var(--grid-size));
    --wall-h: 216px;
    --wall-bottom: 142px;

    --floor-w: var(--wall-w);
    --floor-h: 300px;
    --floor-bottom: 112px;

    --halo-size: 180px;
    --halo-bottom: 130px;

    --portrait-max-w: 290px;
    --portrait-bottom: clamp(42px, calc(102px - 5vw), 56px);

    --badge-bottom: clamp(58px, calc(109.43px - 4.286vw), 70px);
    --badge-left: 196px;
  }

  .hero-visual__portrait {
    max-width: min(70%, var(--portrait-max-w));
  }
  
  .hero-visual__tech-line--left {
    top: -9%;
  }

  .hero-visual__tech-line--right {
    top: -3%;
  }
}

@media (max-width: 920px) {
  .home-hero {
    padding-top: 24px;
    padding-bottom: 60px;
  }

  .home-hero__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  .home-hero__content {
    max-width: 720px;
    justify-content: flex-start;
  }

  .home-hero__description {
    max-width: 58ch;
  }

  .home-hero__actions {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }

  .home-hero__visual-column,
  .home-hero__plus--right {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding-top: 20px;
    padding-bottom: 56px;
  }

  .home-hero__eyebrow {
    font-size: 0.84rem;
  }

  .home-hero__title {
    font-size: clamp(3.2rem, 11vw, 4.2rem);
  }

  .home-hero__description {
    max-width: 100%;
  }

  .home-hero__actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-card-link {
    max-width: 70%;
  }
}

@media (max-width: 420px) {
  .home-hero {
    padding-bottom: 48px;
  }

  .home-hero__description {
    margin-top: 16px;
  }

  .home-hero__actions {
    margin-top: 24px;
  }

  .hero-card-link {
    min-height: 88px;
    padding: 16px;
  }

  .hero-card-link__title {
    font-size: 1.12rem;
  }
}