/* ==========================================================================
   DESIGN SYSTEM — Emma Constant
   Repris du site v1 (fonts, couleurs, gabarits) + variantes clair/sombre
   ========================================================================== */

@font-face {
  font-family: 'EC';
  src: url('../fonts/AME.ttf');
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}



:root {
  /* Typo */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;

  /* Couleurs de base */
  --black: #050505;
  --white: #ffffff;
  --gray: #8a8a8a;
  --gray-light: #e4e4e4;

  /* Thème courant (piloté par JS selon la section visible) */
  --bg: var(--black);
  --fg: var(--white);
  --border: rgba(255, 255, 255, 0.35);

  /* Rythme */
  --gutter: 40px;
  --nav-width: 180px;
  --header-height: 100px;
  --radius: 5px;
  --transition: 0.3s ease;
  --transition-fast: 0.18s ease;
}

* {
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body), sans-serif;
  background: var(--black);
  color: var(--white);
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  background: var(--white);
  color: var(--black);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skills-ticker-track,
  .hero-file {
    animation: none !important;
  }
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  height: var(--header-height);
  background: var(--bg);
  color: var(--fg);
  transition: background var(--transition), color var(--transition);
}

.site-header .logo {
  height: 56px;
  width: auto;
  filter: invert(var(--logo-invert, 0));
  transition: filter var(--transition);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--fg);
  opacity: 0.65;
  padding: 4px 2px;
  font-size: 13px;
  transition: opacity var(--transition-fast);
}

.lang-switch button.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-switch .divider {
  display: none;
}

/* ==========================================================================
   SIDE NAV — scrollspy, suit le thème de la section visible
   ========================================================================== */

.side-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  z-index: 50;
  padding: 40px var(--gutter);
  background: var(--bg);
  color: var(--fg);
  transition: background var(--transition), color var(--transition);
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-nav li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-nav .dash {
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  transition: width var(--transition-fast), opacity var(--transition-fast);
}

.side-nav a {
  text-decoration: none;
  font-size: 13px;
  opacity: 0.65;
  transition: opacity var(--transition-fast);
}

.side-nav li.active .dash {
  width: 24px;
  opacity: 1;
}

.side-nav li.active a {
  opacity: 1;
}

.nav-toggle {
  display: none;
}

/* ==========================================================================
   LAYOUT DE PAGE
   ========================================================================== */

.page {
  margin-left: var(--nav-width);
  padding-top: var(--header-height);
}

section {
  padding: 140px var(--gutter);
}

.theme-dark {
  background: var(--black);
  color: var(--white);
  --border: rgba(255, 255, 255, 0.35);
}

.theme-light {
  background: var(--white);
  color: var(--black);
  --border: rgba(0, 0, 0, 0.2);
}

.reveal {
  opacity: 0;
  transform: translateY(56px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.section-head {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.section-head h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 300;
}

/* ==========================================================================
   HERO / INTRO
   ========================================================================== */

.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.hero-hello {
  font-weight: 300;
  font-size: clamp(36px, 5.5vw, 64px);
  margin: 0;
}

.hero-files {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 16px;
  justify-content: center;
  padding: 8px 0;
  margin: 0;
  list-style: none;
}

.hero-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 130px;
  text-align: center;
  opacity: 0;
  animation: hero-file-in 0.6s ease forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms);
}

.hero-file:nth-child(1) { --i: 1; }
.hero-file:nth-child(2) { --i: 2; }
.hero-file:nth-child(3) { --i: 3; }
.hero-file:nth-child(4) { --i: 4; }
.hero-file:nth-child(5) { --i: 5; }
.hero-file:nth-child(6) { --i: 6; }

@keyframes hero-file-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-file-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  background: #d8d7d5;
  transition: transform var(--transition-fast);
  --folder-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128.83 106.7'%3E%3Cpath fill='white' d='M119.595 106.696 L9.23438 106.696 C4.13437 106.696 0 102.561 0 97.4612 L0 9.23438 C0 4.13437 4.13436 0 9.23437 0 L35.402 0 C37.8965 0 40.2848 1.00913 42.0235 2.79772 L45.3183 6.18717 C47.057 7.97576 49.4453 8.98489 51.9397 8.98489 L119.595 8.98489 C124.695 8.98489 128.829 13.1193 128.829 18.2193 L128.829 97.4612 C128.829 102.561 124.695 106.696 119.595 106.696 Z'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--folder-shape);
  mask-image: var(--folder-shape);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.hero-file-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 40%);
  z-index: 1;
  pointer-events: none;
}

.hero-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.hero-file:hover .hero-file-thumb,
.hero-file:focus-within .hero-file-thumb {
  transform: translateY(-4px) rotate(-1.5deg);
}

.hero-file:hover .hero-file-thumb img,
.hero-file:focus-within .hero-file-thumb img {
  transform: scale(1.08);
}

.hero-file-name {
  margin: 0;
  font-size: 12px;
}

.hero-file-caption {
  margin: 0;
  font-size: 11px;
  opacity: 0.6;
}

.hero-signature {
  font-weight: 300;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.1;
  margin: 0;
  text-align: right;
}

/* ==========================================================================
   ABOUT ME
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: minmax(240px, 361px) minmax(0, 1fr);
  gap: 96px;
  align-items: start;
}

.about-content {
  min-width: 0;
}

.about-photo {
  position: sticky;
  top: calc(var(--header-height) + 40px);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(1);
}

.about-intro h3 {
  margin: 0 0 20px;
  font-size: 36px;
  font-weight: 300;
}

.skills-ticker {
  overflow: hidden;
  margin-bottom: 16px;
}

.skills-ticker-track {
  white-space: nowrap;
}

.skills-ticker-track:not([hidden]) {
  display: flex;
  animation: ticker-scroll 36s linear infinite;
}

.skills-ticker-track p {
  display: inline-block;
  flex: none;
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  font-style: normal;
  opacity: 0.7;
  white-space: nowrap;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.about-intro p {
  margin: 0 0 14px;
  font-size: 14px;
  opacity: 0.9;
  max-width: 60ch;
}

.about-block {
  margin-top: 40px;
}

/* Experience list */

.experience-list {
  display: flex;
  flex-direction: column;
}

.experience-item {
  border-bottom: 1px solid var(--border);
}

.experience-trigger {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 12px 0;
}

.experience-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.experience-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 300;
}

.experience-date {
  flex: none;
  font-size: 14px;
  opacity: 0.7;
  white-space: nowrap;
}

.experience-org {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  opacity: 0.8;
}

.experience-toggle {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.experience-trigger[aria-expanded="true"] .experience-toggle {
  transform: rotate(45deg);
}

.experience-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.experience-panel p {
  margin: 0;
  padding: 0 0 16px;
  font-size: 13px;
  opacity: 0.75;
  max-width: 60ch;
}

.cv-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.links-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   WORK — présentation scrollée par projet (composant réutilisable)
   ========================================================================== */

.work-intro {
  padding-bottom: 40px;
}

.project {
  position: relative;
  padding: 64px var(--gutter);
  border-top: 1px solid var(--border);
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 12px;
}

.project-index {
  font-family: var(--font-heading);
  opacity: 0.6;
}

.project-client {
  opacity: 0.65;
}

.project-title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 300;
  line-height: 1.25;
  max-width: 70ch;
  margin: 0 0 40px;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 48px;
}

.project-sticky {
  position: sticky;
  top: calc(var(--header-height) + 40px);
  align-self: start;
  height: fit-content;
}

.project-sticky .project-client {
  margin: 0 0 12px;
}

.project-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-scroll img,
.project-scroll video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 -11px 60px rgba(0, 0, 0, 0.13);
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.work-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.work-row > * {
  flex: 1 1 0;
  min-width: 0;
}

.work-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}

.project-scroll .fill-height {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-desc {
  font-size: 13px;
  opacity: 0.75;
  margin: 12px 0 0;
  max-width: 46ch;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #f8f8f8;
  padding: 12px 12px;
  border-radius: var(--radius);
}

.project-detail-grid img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 12px;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.1);
}

.project-detail-grid h5 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.project-detail-grid p {
  font-size: 12px;
  opacity: 0.65;
  margin: 0;
}

.project-video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}

.project-proto-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */

.gallery-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 40px;
  margin-bottom: 96px;
}

.gallery-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-card--static {
  cursor: default;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
  filter: grayscale(0.15);
  transition: filter var(--transition-fast);
}

.gallery-card:not(.gallery-card--static):hover img {
  filter: grayscale(0);
}

.gallery-card h3 {
  font-size: 20px;
  font-weight: 300;
  margin: 0 0 4px;
}

.gallery-card p {
  font-size: 13px;
  opacity: 0.6;
  margin: 0;
}

.gallery-card p.gallery-meta {
  color: var(--white);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-card.in-view p.gallery-meta {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card p.gallery-desc {
  margin-top: 10px;
  opacity: 0.8;
  line-height: 1.5;
  max-width: 52ch;
  overflow: hidden;
}

.gallery-card p.gallery-desc:not([hidden]) {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.section-subtitle {
  margin: 0;
  font-size: 14px;
  opacity: 0.6;
}

.art-row {
  display: flex;
  gap: 12px;
  width: 100%;
  height: 40vw;
  max-height: 460px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.art-row li {
  flex: 1 1 0%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  transition: flex-grow 1s ease, flex-basis 1s ease;
}

.art-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .art-row li:hover {
    flex-grow: 0;
    flex-basis: var(--art-w, 40%);
  }
}

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-mark {
  width: 200px;
  height: auto;
  margin-bottom: 16px;
}

.contact h2 {
  font-weight: 300;
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 24px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(16px, 2.4vw, 28px);
  font-weight: 300;
}

.contact-links p {
  margin: 0;
}

.contact-links a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  padding: 24px var(--gutter) 40px;
  font-size: 11px;
  opacity: 0.5;
}

/* ==========================================================================
   PAGES SIMPLES — Liens, Mentions légales
   ========================================================================== */

.simple-page {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.links-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--gutter) 60px;
}

.links-page h1 {
  font-weight: 300;
  font-size: clamp(32px, 6vw, 48px);
  margin: 0 0 40px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.links-item {
  display: block;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 0;
  text-decoration: none;
  font-size: 15px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.links-item:hover {
  background: var(--fg);
  color: var(--bg);
}

.legal-page {
  flex: 1;
  width: 100%;
  max-width: 70ch;
  margin: 0 auto;
  padding: 140px var(--gutter) 80px;
}

.legal-page h1 {
  font-weight: 300;
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 32px;
}

.legal-page p {
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.85;
  margin: 0 0 24px;
}

.legal-page a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  .about-grid {
    gap: 56px;
  }

  .project-body {
    gap: 40px;
    grid-template-columns: minmax(200px, 260px) 1fr;
  }

  .gallery-row {
    gap: 48px 40px;
  }
}

@media (max-width: 800px) {
  :root {
    --nav-width: 0px;
    --gutter: 16px;
  }

  .experience-row:not(:has(.experience-toggle)) {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: initial;
  }

  .header-logo {
    justify-self: center;
  }

  .site-header .logo {
    height: 40px;
  }

  .lang-switch {
    justify-self: end;
  }

  #about > h2.visually-hidden {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 40px;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
  }

  .side-nav {
    width: 220px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  }

  .side-nav.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    color: var(--fg);
    padding: 6px;
  }

  .nav-toggle span {
    width: 20px;
    height: 1px;
    background: currentColor;
  }

  .page {
    margin-left: 0;
  }

  .about-grid,
  .project-body {
    grid-template-columns: 1fr;
  }

  .about-grid {
    gap: 40px;
  }

  .about-photo {
    position: static;
    max-width: 260px;
  }

  .project {
    padding: 16px;
  }

  .project-body {
    gap: 24px;
  }

  .project-title {
    margin: 0 0 24px;
  }

  .project-sticky {
    position: static;
  }

  .gallery-row {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .art-row {
    height: auto;
    max-height: none;
    flex-direction: column;
  }

  .art-row li {
    height: auto;
    flex: none !important;
  }

  .art-row img {
    height: auto;
    aspect-ratio: auto;
  }

  .project-detail-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-grid img {
    display: none;
  }

  .work-row {
    flex-direction: column;
  }

  .project-scroll .fill-height {
    height: auto;
  }

  .hero-files {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 8px 4px 16px;
    margin: 0 calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .hero-file {
    flex: none;
    width: 139px;
    scroll-snap-align: start;
  }

  .hero-signature {
    font-size: 30px;
  }
}

@media (max-width: 600px) {
  section {
    padding: 56px var(--gutter);
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
