@font-face {
  font-family: 'Afronut';
  src: url('./docs/AfronautTest-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  background: #fff;
  overflow-x: hidden;
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loader-text { font-size: 12px; letter-spacing: 0.1em; color: #aaa; text-transform: uppercase; }
#loader.hidden { display: none; }

#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 100;
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-left, .nav-right { display: flex; gap: 2rem; }
.nav-left a, .nav-right a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
}
.nav-left a:hover, .nav-right a:hover { color: #1a1a1a; }
.nav-left a[aria-current="page"], .nav-right a[aria-current="page"] { color: #1a1a1a; }

.logo {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 52px;
}
#logo-img { height: 45px; width: auto; display: block; }

#scroll-wrapper {
  height: 600vh;
  position: relative;
  margin-top: 0;
  padding-top: 0;
}
#canvas-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
#anim-canvas { 
  width: 100%; 
  height: 100%; 
  display: block;
}

/* Overlay de texte pour les changements d'état vidéo */
#video-text-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  max-width: 25%;
  display: flex;
  flex-direction: column;
}

#video-text-content {
  opacity: calc(var(--scroll-opacity, 0) * var(--state-opacity, 0));
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --scroll-opacity: 0;
  --state-opacity: 0;
}

#video-text-content.show {
  --state-opacity: 1;
}

#video-text-title {
  font-family: 'Helvetica', 'Arial', sans-serif;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #999;
  margin: 0 0 0.2rem 0;
  line-height: 1.3;
}

#video-text-description {
  font-family: 'Afronut', serif;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #333;
  margin: 0 0 1.2rem 0;
  line-height: 1.5;
}

#video-text-dots {
  display: flex;
  gap: 0.8rem;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: auto;
  order: -1;
  margin-bottom: 1rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #aaa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dot:hover {
  border-color: #555;
}

.dot.active {
  background: #333;
  border-color: #333;
}

#video-text-title.show {
  opacity: 1;
}

#video-text-description.show {
  opacity: 1;
}

#video-text-content.show {
  opacity: 1;
}

#content-section {
  width: 100%;
  min-height: 100vh;
  background: #fff;
  padding: 4rem 2rem;
}

.content-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.text-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.column {
  line-height: 1.8;
  color: #333;
}

.column p {
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 0;
}

.full-width-image {
  width: 100%;
  margin-top: 4rem;
  overflow: hidden;
  border-radius: 4px;
}

.full-width-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Portfolio Carousel Sections */
#carousel-section,
#windows-carousel-section {
  position: relative;
  background: transparent;
  width: 100%;
  z-index: 5;
  min-height: 250vh;
  margin-top: 62vh;
}

#windows-carousel-section {
  margin-top: 28vh;
}

.horizontal-scroll {
  position: sticky;
  top: 25vh;
  width: 100%;
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  contain: paint;
  --carousel-text-opacity: 0;
  --carousel-text-left: 42vw;
  --carousel-text-y: 18px;
}

.scroll-content {
  display: flex;
  height: 100%;
  will-change: transform;
  transform: translate3d(20px, 0, 0);
}

.carousel-image {
  flex-shrink: 0;
  margin: 5px;
  height: 100%;
  width: auto;
  aspect-ratio: var(--image-ratio);
  object-fit: cover;
}

.carousel-text {
  position: absolute;
  left: var(--carousel-text-left);
  top: 50%;
  z-index: 2;
  width: min(34vw, 430px);
  transform: translateY(calc(-50% + var(--carousel-text-y)));
  opacity: var(--carousel-text-opacity);
  pointer-events: none;
}

.carousel-text h3 {
  font-family: 'Helvetica', 'Arial', sans-serif;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #999;
  margin: 0 0 0.2rem 0;
  line-height: 1.3;
}

.carousel-text p {
  font-family: 'Afronut', serif;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #333;
  margin: 0 0 1.2rem 0;
  line-height: 1.5;
}

@media (max-width: 700px) {
  #carousel-section,
  #windows-carousel-section {
    margin-top: 42vh;
  }

  #windows-carousel-section {
    margin-top: 24vh;
  }

  .carousel-text {
    width: 38vw;
  }

  .carousel-text h3 {
    font-size: 14px;
  }

  .carousel-text p {
    font-size: 20px;
  }
}

#after-carousel-section {
  min-height: 160vh;
  background: #fff;
}

/* About page */
.about-document {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

.about-page {
  min-height: 100vh;
  color: #333;
  background: #fff;
}

.about-layout {
  width: min(1240px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 0 0 18vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(88px, 14vw, 220px);
  align-items: start;
}

.about-profile {
  position: fixed;
  top: 0;
  left: max(32px, calc((100vw - 1240px) / 2));
  min-height: 100vh;
  width: min(420px, calc((100vw - 64px - clamp(88px, 14vw, 220px)) / 2));
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: end;
  text-align: left;
  padding: 22vh 0 18vh;
}

.about-photo {
  width: clamp(180px, 16vw, 240px);
  aspect-ratio: 0.82;
  justify-self: center;
  align-self: center;
  margin: 0 0 1.6rem;
  border-radius: 12px;
  background: #f0ebe4;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.about-identity {
  width: clamp(180px, 16vw, 240px);
}

.about-identity h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0 0 0.8rem;
}

.about-identity p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0.02em;
  margin: 0;
}

.about-identity p:first-of-type {
  font-family: 'Afronut', serif;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.25;
}

.about-identity .about-muted {
  color: #aaa;
  margin-top: 0.8rem;
}

.about-socials {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.about-socials a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
}

.about-socials a:hover {
  color: #1a1a1a;
}

.about-timeline {
  grid-column: 2;
  justify-self: start;
  width: min(100%, 680px);
  min-height: 360vh;
  display: grid;
  gap: 0;
  padding: 0 0 14vh;
}

.timeline-block {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: clamp(2.2rem, 5vh, 4rem);
  padding-top: 22vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.timeline-block-spaced {
  margin-top: 48vh;
}

.timeline-section-title {
  position: absolute;
  top: calc(22vh - 2.2rem);
  left: 0;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  margin: 0;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 4.5rem;
  align-items: start;
  transform: none;
}

.timeline-entry h2 {
  transform: translateX(-30px);
}

.timeline-entry h2 {
  font-family: 'Afronut', serif;
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin: 0;
}

.timeline-entry p {
  font-size: 14px;
  line-height: 1.38;
  letter-spacing: 0.02em;
  margin: 0;
}

.timeline-school {
  color: #777;
  font-weight: 300;
}

.timeline-title {
  font-family: 'Afronut', serif;
  font-size: 17px;
  color: #333;
  font-weight: 300;
  line-height: 1.16;
  margin-top: 0.3rem;
}

.timeline-note {
  color: #999;
  font-weight: 300;
  margin-top: 0.3rem;
}

@media (max-width: 1050px) {
  .about-document {
    scroll-snap-type: none;
  }

  .about-layout {
    width: min(760px, calc(100vw - 40px));
    padding-top: 14vh;
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .about-profile {
    position: static;
    min-height: auto;
    width: min(100%, 560px);
    padding: 0;
  }

  .about-timeline {
    grid-column: auto;
    min-height: auto;
    padding: 0 0 8vh;
  }

  .timeline-block,
  .timeline-block-spaced {
    min-height: auto;
    margin-top: 0;
  }

  .timeline-entry {
    grid-template-columns: 98px 1fr;
    gap: 1.5rem;
    transform: none;
  }
}

@media (max-width: 620px) {
  .about-layout {
    width: calc(100vw - 32px);
    padding-top: 110px;
    gap: 3rem;
  }

  .about-photo {
    width: min(240px, 70vw);
    margin-bottom: 2rem;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .timeline-entry h2 {
    font-size: 32px;
  }

  .timeline-entry p {
    font-size: 14px;
  }

  .timeline-title {
    font-size: 18px;
  }
}

/* Archive page */
.archive-document,
.archive-page {
  min-height: 100%;
  overflow: hidden;
}

.archive-page {
  color: #111;
  background: #fff;
}

.archive-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 640px;
  padding: 76px clamp(24px, 4vw, 64px) 58px;
  display: grid;
  grid-template-rows: 1fr auto;
}

.archive-graph-shell {
  position: relative;
  min-height: 0;
}

#archive-graph {
  position: absolute;
  inset: 0;
  cursor: default;
  overflow: hidden;
}

#archive-graph:active {
  cursor: default;
}

#archive-graph canvas {
  display: block;
}

.archive-graph-fallback {
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
}

.archive-readout {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: none;
  gap: 1rem;
  align-items: baseline;
  pointer-events: none;
  color: #aaa;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#archive-current-year {
  display: none;
}

.archive-timeline {
  position: relative;
  width: min(980px, 72vw);
  margin: 34px auto 0;
  padding-top: 14px;
}

.archive-ticks {
  display: grid;
  grid-template-columns: repeat(84, minmax(4px, 1fr));
  align-items: center;
  gap: 6px;
}

.archive-tick {
  width: 5px;
  height: 5px;
  border: 0;
  border-radius: 50%;
  background: #e8e8e8;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.archive-tick:hover,
.archive-tick.is-start {
  transform: scale(1.45);
}

.archive-tick.is-visible {
  background: #111;
}

.archive-range-handle {
  position: absolute;
  top: 12px;
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #000;
  color: transparent;
  cursor: ew-resize;
  transform: translate(-50%, -3px);
  z-index: 2;
  transition: box-shadow 160ms ease;
}

.archive-range-handle:hover,
.archive-range-handle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 7px rgba(0, 0, 0, 0.08);
}

.archive-year-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 17px;
  transform: translateX(-3px);
}

.archive-year-labels button {
  border: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
}

.archive-year-labels button:not(.is-visible) {
  color: #d6d6d6;
}

.archive-year-labels button.is-start {
  color: #000;
}

@media (max-width: 780px) {
  .archive-stage {
    min-height: 600px;
    padding: 94px 18px 38px;
  }

  .archive-timeline {
    width: calc(100vw - 42px);
  }

  .archive-ticks {
    gap: 4px;
  }

  .archive-readout {
    left: 18px;
    bottom: 8px;
    transform: none;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
  }
}
