/* Shared home shell: full-bleed white canvas with a fixed contact rail. */
:root {
  --frame-x: 0px;
  --frame-top: 0px;
  --frame-bottom: 0px;
  --rail-width: clamp(78px, 6.2vw, 96px);
  --system-font:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}

html {
  background: #fff;
  scrollbar-width: none;
  overflow-anchor: none;
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  overflow-x: clip;
  overflow-y: auto;
  background: #fff;
  font-family: var(--system-font);
}

body.immersive-is-open {
  overflow: hidden;
}

.intro {
  height: 100svh;
  padding: 0;
  background: #fff;
}

.intro__panel {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
}

.intro__title {
  position: absolute;
  top: 22.5%;
  left: calc(49% + var(--rail-width) * 0.18);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - var(--rail-width) - 52px);
  margin: 0;
  color: #050505;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans Display", Arial, sans-serif;
  font-size: clamp(30px, 6.1vw, 94px);
  font-weight: 300;
  line-height: 1.24;
  letter-spacing: -0.05em;
}

.intro__line {
  display: block;
  white-space: nowrap;
}
.intro__line--muted {
  color: #999;
}

.contact-rail {
  position: fixed;
  z-index: 1100;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  border-right: 1px solid #ececec;
  background: rgba(255, 255, 255, 0.98);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.75, 0.2, 1),
    visibility 260ms;
}

.contact-rail__items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
}

.contact-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  color: #111;
  text-decoration: none;
  outline-offset: 4px;
  border-radius: 14px;
}

.contact-link:first-child {
  margin-bottom: 6px;
}

.contact-link__icon {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: transparent;
  transition:
    background-color 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.78, 0.2, 1);
  transform-origin: center;
}

.contact-link__icon img {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.contact-link__label {
  position: absolute;
  z-index: 2;
  left: calc(100% + 11px);
  top: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100vw - var(--rail-width) - 34px);
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-radius: 14px;
  background: #eeeeee;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.055);
  font-size: clamp(18px, 1.25vw, 20px);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.05;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-10px, -50%) scale(0.96);
  transform-origin: left center;
  transition:
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.2, 0.75, 0.2, 1),
    visibility 220ms;
  pointer-events: none;
}

.contact-link__label img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Organic bridge between the icon tile and its label, without moving layout. */
.contact-link::before,
.contact-link::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 39px;
  top: 50%;
  background: #eeeeee;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.contact-link::before {
  width: 34px;
  height: 28px;
  border-radius: 50%;
  filter: blur(2.5px);
  transform: translate(-4px, -50%) scale(0.64, 0.55);
}

.contact-link::after {
  width: 22px;
  height: 34px;
  border-radius: 45%;
  filter: blur(4px);
  transform: translate(5px, -50%) scale(0.55, 0.48);
}

.contact-link:focus-visible {
  outline: 2px solid #777;
}
.contact-link:focus-visible .contact-link__icon {
  background: #eeeeee;
  transform: scale(1.06);
}
.contact-link:focus-visible .contact-link__label {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) scale(1);
}
.contact-link:focus-visible::before,
.contact-link:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

@media (hover: hover) {
  .contact-link:hover .contact-link__icon {
    background: #eeeeee;
    transform: scale(1.07);
  }
  .contact-link:hover .contact-link__label {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
  }
  .contact-link:hover::before,
  .contact-link:hover::after {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
  }
}

body.immersive-is-open .contact-rail {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-12px);
  pointer-events: none;
}

/* V10: a more visible 5 px track, still tied to the real scroll position. */
.scroll-progress {
  position: fixed;
  z-index: 1090;
  top: 50%;
  right: clamp(14px, 2.4vw, 38px);
  display: grid;
  place-items: center;
  width: 24px;
  height: clamp(110px, 18svh, 176px);
  padding: 0;
  border-radius: 8px;
  transform: translateY(-50%);
  outline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}
.scroll-progress__track {
  position: relative;
  display: block;
  width: 5px;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #d1d1d1;
}
.scroll-progress__thumb {
  position: absolute;
  inset: 0 0 auto;
  height: 50%;
  border-radius: inherit;
  background: #777;
  will-change: transform;
}
.scroll-progress:focus-visible { outline: 2px solid #777; }
body.immersive-is-open .scroll-progress {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page {
  min-height: 100svh;
  padding: 0;
  background: #fff;
}

.stage {
  height: 100svh;
  padding-left: var(--rail-width);
  touch-action: pan-y;
}

.project-nav {
  touch-action: manipulation;
}

@media (max-width: 760px) {
  :root {
    --rail-width: 58px;
  }

  .intro__title {
    left: calc(50% + var(--rail-width) / 2);
    top: 30%;
    max-width: none;
    font-size: clamp(20px, 6.1vw, 46px);
    line-height: 1.3;
  }

  .contact-rail__items {
    gap: 7px;
    padding: 12px 4px;
  }
  .contact-link {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  .contact-link__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .contact-link__icon img {
    width: 22px;
    height: 22px;
  }
  .contact-link__label {
    left: calc(100% + 6px);
    min-height: 42px;
    padding: 8px 11px;
    font-size: 15px;
  }
  .contact-link::before,
  .contact-link::after {
    left: 34px;
  }
  .scroll-progress {
    right: 5px;
    width: 20px;
    height: 110px;
  }
  .stage {
    --icon-size: clamp(60px, 20vw, 154px);
    --menu-width: 49vw;
    --menu-size: clamp(13px, 4.2vw, 32px);
    --composition-gap: 2.3vw;
  }
  .experience {
    max-width: calc(100% - 14px);
  }
}

@media (max-height: 520px) and (min-width: 761px) {
  .intro__title {
    top: 16%;
    font-size: min(6.1vw, 11svh);
  }
  .contact-rail__items {
    gap: 4px;
    padding-top: 10px;
  }
  .contact-link {
    height: 46px;
    flex-basis: 46px;
  }
  .contact-link__icon {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .contact-rail,
  .contact-link__icon,
  .contact-link__label,
  .contact-link::before,
  .contact-link::after,
  .scroll-progress {
    transition: none;
  }
}

/* V7 — contact hover matches the supplied reference: the neutral state above
   stays unchanged; only hover/focus grows into one connected soft-grey shape. */
.contact-link__icon {
  transition:
    width 220ms cubic-bezier(0.2, 0.78, 0.2, 1),
    height 220ms cubic-bezier(0.2, 0.78, 0.2, 1),
    border-radius 220ms cubic-bezier(0.2, 0.78, 0.2, 1),
    background-color 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.78, 0.2, 1);
}

.contact-link__label {
  left: calc(100% + 18px);
  min-height: 58px;
  padding: 7px 7px 7px 20px;
  gap: 16px;
  border: 0;
  border-radius: 18px;
  background: #eeeeee;
  box-shadow: none;
  font-size: clamp(20px, 1.55vw, 26px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.contact-link__label img {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.contact-link::before,
.contact-link::after {
  background: #eeeeee;
  filter: none;
}

.contact-link::before {
  left: 36px;
  width: 56px;
  height: 34px;
  border-radius: 50%;
  transform: translate(-8px, -50%) scale(0.45, 0.55);
}

.contact-link::after {
  left: 48px;
  width: 42px;
  height: 24px;
  border-radius: 48%;
  transform: translate(-4px, -50%) scale(0.45, 0.62);
}

.contact-link:focus-visible .contact-link__icon {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  background: #eeeeee;
  transform: none;
}

.contact-link:focus-visible .contact-link__label {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) scale(1);
}

.contact-link:focus-visible::before,
.contact-link:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

@media (hover: hover) {
  .contact-link:hover .contact-link__icon {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    background: #eeeeee;
    transform: none;
  }

  .contact-link:hover .contact-link__label {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%) scale(1);
  }

  .contact-link:hover::before,
  .contact-link:hover::after {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
  }
}

@media (max-width: 720px) {
  .contact-link__label {
    left: calc(100% + 10px);
    min-height: 48px;
    padding: 6px 6px 6px 14px;
    gap: 10px;
    border-radius: 15px;
    font-size: 17px;
  }

  .contact-link__label img {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 11px;
  }

  .contact-link:focus-visible .contact-link__icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }
}

/* V8 — compact connected hover from the latest Figma reference. Neutral state
   stays unchanged; only hover/focus is resized. */
.contact-link__icon img {
  transition:
    width 180ms cubic-bezier(0.2, 0.78, 0.2, 1),
    height 180ms cubic-bezier(0.2, 0.78, 0.2, 1),
    padding 180ms cubic-bezier(0.2, 0.78, 0.2, 1),
    border-radius 180ms cubic-bezier(0.2, 0.78, 0.2, 1),
    background-color 160ms ease;
}

.contact-link__label {
  left: calc(100% + 10px);
  min-height: 46px;
  padding: 5px 5px 5px 12px;
  gap: 8px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.contact-link__label img {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
}

.contact-link::before {
  left: 33px;
  width: 38px;
  height: 26px;
  border-radius: 52%;
}

.contact-link::after {
  left: 43px;
  width: 29px;
  height: 20px;
  border-radius: 48%;
}

.contact-link:focus-visible .contact-link__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.contact-link:focus-visible .contact-link__icon img {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 9px;
  background: #fff;
}

@media (hover: hover) {
  .contact-link:hover .contact-link__icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .contact-link:hover .contact-link__icon img {
    width: 38px;
    height: 38px;
    padding: 7px;
    border-radius: 9px;
    background: #fff;
  }
}

@media (max-width: 720px) {
  .contact-link__label {
    min-height: 42px;
    padding: 4px 4px 4px 10px;
    gap: 7px;
    font-size: 14px;
    border-radius: 13px;
  }

  .contact-link__label img {
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 9px;
  }

  .contact-link:focus-visible .contact-link__icon,
  .contact-link:hover .contact-link__icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .contact-link:focus-visible .contact-link__icon img,
  .contact-link:hover .contact-link__icon img {
    width: 35px;
    height: 35px;
    padding: 7px;
  }
}

/* V10 — contact rail hover alignment + comfortable label padding. */
.contact-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-link__icon img {
  display: block;
  margin: auto;
}

.contact-link__label {
  align-items: center;
  left: calc(100% + 12px);
  min-height: 46px;
  padding: 5px 16px;
  gap: 10px;
}

.contact-link__label img {
  flex: 0 0 auto;
  background: transparent !important;
}

.contact-link:focus-visible .contact-link__icon img,
.contact-link:hover .contact-link__icon img {
  background: transparent !important;
}

@media (max-width: 720px) {
  .contact-link__label {
    padding: 4px 14px;
  }
}

/* V11 — contact buttons aligned like the Figma reference.
   The left icon tile stays larger, the text pill is smaller and centered,
   and every trailing action pictogram sits inside its own white square. */
.contact-link__label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  left: calc(100% + 12px);
  min-height: 44px;
  padding: 4px 4px 4px 18px;
  gap: 10px;
  border-radius: 15px;
  font-size: 15px;
  font-weight: 620;
  line-height: 1;
}

/* Mail */
.contact-link[href^="mailto:"] .contact-link__label,

/* Téléphone */
.contact-link[href^="tel:"] .contact-link__label {
  padding-right: 14px;
}

.contact-link__label img {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 11px;
  background: #ffffff !important;
  object-fit: contain;
  margin-left: 2px;
}

.contact-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-link__icon img {
  display: block;
  margin: auto;
}

.contact-link::before {
  left: 34px;
  width: 40px;
  height: 26px;
  border-radius: 52%;
}

.contact-link::after {
  left: 45px;
  width: 31px;
  height: 20px;
  border-radius: 48%;
}

.contact-link:focus-visible .contact-link__icon,
.contact-link:hover .contact-link__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.contact-link:focus-visible .contact-link__icon img,
.contact-link:hover .contact-link__icon img {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
}

@media (max-width: 720px) {
  .contact-link__label {
    min-height: 40px;
    padding: 4px 12px 4px 15px;
    gap: 8px;
    font-size: 14px;
    border-radius: 14px;
  }

  .contact-link__label img {
    width: 31px;
    height: 31px;
    padding: 7px;
    border-radius: 10px;
  }

  .contact-link:focus-visible .contact-link__icon,
  .contact-link:hover .contact-link__icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .contact-link:focus-visible .contact-link__icon img,
  .contact-link:hover .contact-link__icon img {
    width: 32px;
    height: 32px;
  }
}

/* V12 — labels that include a trailing pictogram keep only left padding. */

/* V9 — optical compensation for the wide, two-bubble contact SVG.
   Only the glyph grows: the hit area, centre and label padding stay unchanged. */
.contact-link--contact { --contact-glyph-size: 27px; }
.contact-link.contact-link--contact .contact-link__icon img {
  width: calc(var(--contact-glyph-size) * 1.22);
  height: var(--contact-glyph-size);
  max-width: none;
  flex: 0 0 auto;
}
.contact-link--contact:focus-visible { --contact-glyph-size: 34px; }
@media (hover: hover) {
  .contact-link--contact:hover { --contact-glyph-size: 34px; }
}
@media (max-width: 760px) {
  .contact-link--contact { --contact-glyph-size: 22px; }
  .contact-link--contact:focus-visible { --contact-glyph-size: 32px; }
}
@media (max-width: 760px) and (hover: hover) {
  .contact-link--contact:hover { --contact-glyph-size: 32px; }
}
