/* ============================================================
   Kevin Montreuil — Portfolio
   css/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@300..900&family=Newsreader:ital,opsz,wght@0,6..72,300..700;1,6..72,300..700&display=swap');

/* ---------- DESIGN TOKENS (from Kevin Montreuil Design System) ---------- */
:root {
  --bg:            #0a0a0a;
  --bg-raised:     #141312;
  --bg-sunken:     #050505;
  --bg-overlay:    rgba(10, 10, 10, 0.35);
  --fg:            #f5f1ea;
  --fg-muted:      #a8a39c;
  --fg-faint:      #6b6862;
  --fg-invert:     #0a0a0a;
  --border:        #2a2826;
  --border-strong: #3d3a36;
  --accent:        #fd7c74;
  --accent-deep:   #c84e44;
  --accent-soft:   rgba(253, 124, 116, 0.14);
  --accent-ink:    #1a0a08;

  --font-display: 'Unbounded', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Newsreader', 'Iowan Old Style', Georgia, serif;

  --t-hero:      clamp(72px, 12vw, 200px);
  --t-display-1: clamp(56px, 8vw, 128px);
  --t-display-2: clamp(40px, 5.5vw, 80px);
  --t-h1:        clamp(36px, 4vw, 56px);
  --t-h2:        clamp(28px, 3vw, 40px);
  --t-h3:        24px;
  --t-h4:        20px;
  --t-lead:      22px;
  --t-body:      18px;
  --t-small:     15px;
  --t-meta:      13px;
  --t-micro:     11px;

  --lh-tight:  0.92;
  --lh-snug:   1.05;
  --lh-body:   1.55;
  --lh-loose:  1.7;

  --tracking-display: -0.025em;
  --tracking-tight:   -0.015em;
  --tracking-meta:     0.12em;

  --s-1:   4px;   --s-2:   8px;   --s-3:  12px;  --s-4:  16px;
  --s-5:  20px;   --s-6:  24px;   --s-7:  28px;  --s-8:  32px;
  --s-10: 40px;   --s-12: 48px;   --s-16: 64px;  --s-20: 80px;
  --s-24: 96px;   --s-32: 128px;

  --r-0:   0px;
  --r-sm:  2px;
  --r-full: 9999px;

  --ease-snap:   cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --d-micro:  120ms;
  --d-base:   220ms;
  --d-layout: 400ms;
  --d-scene:  800ms;

  --page-pad-x: clamp(20px, 5vw, 80px);
  --measure:    68ch;
  --nav-h:      72px;
}

/* ---------- RESET + BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent-soft); color: var(--accent); }

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

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  color: var(--fg);
}

h1 { font-size: var(--t-h1); line-height: var(--lh-snug); font-weight: 600; }
h2 { font-size: var(--t-h2); line-height: var(--lh-snug); font-weight: 600; }
h3 { font-size: var(--t-h3); line-height: var(--lh-snug); font-weight: 500; letter-spacing: var(--tracking-tight); }

p { font-family: var(--font-body); font-size: var(--t-body); line-height: var(--lh-body); color: var(--fg); }

.t-meta {
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 500;
  color: var(--fg-muted);
  line-height: 1.4;
}

.t-micro {
  font-family: var(--font-display);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 500;
  color: var(--fg-faint);
}

/* Links — coral underline draws left→right on hover */
a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size var(--d-base) var(--ease-snap), color var(--d-micro);
  padding-bottom: 2px;
}
a:hover { background-size: 100% 1px; color: var(--accent); }

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 600;
  padding: var(--s-4) var(--s-6);
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  border-radius: var(--r-0);
  transition: background var(--d-base) var(--ease-snap),
              color var(--d-base) var(--ease-snap),
              border-color var(--d-base) var(--ease-snap),
              transform var(--d-micro);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background-image: none;
}
.btn:hover { background: var(--fg); color: var(--fg-invert); }
.btn:active { transform: translateY(1px); }

.btn--accent {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--accent:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--accent:active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad-x);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--d-base) var(--ease-snap),
              border-color var(--d-base) var(--ease-snap),
              transform var(--d-base) var(--ease-snap);
}

/* JS adds this class when scrolled > 40px */
.nav--solid {
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-color: var(--border);
}

/* JS adds this class when scrolling DOWN past hero */
.nav--hidden {
  transform: translateY(-100%);
}

.nav__logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: -0.02em;
  color: var(--fg);
  background-image: none;
  padding: 0;
  gap: 1px;
}
.nav__logo span:last-child { color: var(--fg-muted); font-weight: 400; }
.nav__logo:hover { color: var(--fg); background-size: 0; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav__links a {
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 500;
  color: var(--fg);
  background-image: none;
  padding: 0;
  transition: color var(--d-base) var(--ease-snap);
}
.nav__links a:hover { color: var(--accent); background-size: 0; }

/* ---------- HERO ---------- */
.hero {
  height: 100vh;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
}

.hero__photo {
  position: relative;
  overflow: hidden;
  height: 100%;
  /* Photo fades right into the dark bg — gradient mask on right edge */
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% top;
  filter: saturate(0.85) contrast(1.02);
  display: block;
}

/* Grain texture on hero photo */
.hero__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/grain.png');
  background-size: 200px 200px;
  opacity: 0.08;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Fade from photo into dark bg — left fade + rightward gradient */
.hero__photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 32%, transparent 48%, var(--bg) 90%),
              linear-gradient(to bottom, var(--bg) 0%, transparent 12%, transparent 88%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + var(--s-16)) var(--page-pad-x) var(--s-16) var(--s-12);
  gap: var(--s-6);
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.hero__tag {
  font-family: var(--font-display);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: var(--s-1) var(--s-3);
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: var(--tracking-display);
  color: var(--fg);
}

.hero__bio {
  font-family: var(--font-body);
  font-size: var(--t-lead);
  line-height: var(--lh-loose);
  color: var(--fg-muted);
  max-width: var(--measure);
  font-variation-settings: 'opsz' 32;
}

/* ---------- SECTION DIVIDER ---------- */
.section-label {
  padding-top: var(--s-12);
  margin-bottom: var(--s-8);
  display: flex;
  justify-content: center;
  align-items: baseline;
  text-align: center;
}

/* ---------- PROJETS ---------- */
.projets {
  padding: 0 0;
  min-height: 100vh;
  position: relative;
  z-index: 3;
  border-radius: 20px 20px 0 0;
  margin-top: -20px;
  background: var(--bg);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6);
  /* Scroll transition — initial state (JS will toggle .projets--visible) */
  transform: translateY(40px);
  opacity: 0;
  transition: transform var(--d-scene) var(--ease-snap),
              opacity var(--d-scene) var(--ease-snap);
}

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

.projets__layout {
  display: flex;
  flex-direction: column;
}

/* Featured row — 2 cards 50/50 */
.projets__featured-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Grid — remaining projects, 4 per row */
.projets__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.project-card--featured {
  cursor: pointer;
  display: block;
  position: relative;
}

.project-card--featured .project-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-sunken);
}

.project-card--featured .project-card__media img,
.project-card--featured .project-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02) brightness(0.5);
  transition: transform 600ms var(--ease-snap), filter 600ms var(--ease-snap);
}

.project-card--featured:hover .project-card__media img {
  transform: scale(1.02);
  filter: saturate(0.95) contrast(1.02) brightness(1);
}

/* Grain on featured card */
.project-card--featured .project-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/grain.png');
  background-size: 200px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
  transition: opacity var(--d-layout) var(--ease-snap);
}

.project-card--featured:hover .project-card__media::after { opacity: 0.16; }

/* "Ouvrir ↗" — top-right corner on hover */
.project-card__open-cue {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  padding: var(--s-2) var(--s-3);
  background: rgba(10,10,10,0.55);
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--d-base) var(--ease-snap);
}

.project-card--featured:hover .project-card__open-cue { opacity: 1; }

/* Play button — hidden, replaced by text overlay */
.project-card__play { display: none; }

/* Text overlay on the image — bottom gradient */
.project-card__info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  padding: var(--s-16) var(--s-6) var(--s-4);
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-6);
  margin-top: 0;
  border-top: none;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 36px);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-snug);
  color: var(--fg);
  transition: color var(--d-base) var(--ease-snap);
}

.project-card--featured:hover .project-card__title { color: var(--accent); }

.project-card__meta {
  margin-top: var(--s-2);
}

.meta-role { color: var(--accent); }

/* ---------- PROJECT CARDS — grid items (4-per-row) ---------- */
.project-card {
  cursor: pointer;
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-sunken);
}

.project-card .project-card__media {
  display: block;
  width: 100%;
  overflow: hidden;
}

/* aspect-ratio on the img itself — most reliable way to force height */
.project-card .project-card__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02) brightness(0.5);
  transition: transform 600ms var(--ease-snap), filter 600ms var(--ease-snap);
}

.project-card:hover .project-card__media img {
  transform: scale(1.02);
  filter: saturate(0.95) contrast(1.02) brightness(1);
}

/* Grain overlay on grid cards */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/grain.png');
  background-size: 200px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

/* Hover cues for grid cards */
.project-card:hover .project-card__open-cue { opacity: 1; }
.project-card:hover .project-card__title { color: var(--accent); }

/* Smaller text in compact grid cards */
.project-card .project-card__title {
  font-size: clamp(12px, 1.1vw, 16px);
}

.project-card .project-card__info {
  padding: var(--s-8) var(--s-3) var(--s-3);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
}

/* ---------- BIOGRAPHIE (above Projets, centered text) ---------- */
.biographie {
  padding: 0 var(--page-pad-x) var(--s-20);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
  border-radius: 20px 20px 0 0;
  background: #f5f1ea;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6);
  color: var(--bg);
}

/* Invert all text inside biographie for dark-on-light */
.biographie h2 { color: var(--bg); }
.biographie p { color: var(--bg); }
.biographie .t-meta { color: rgba(10, 10, 10, 0.45); }

/* Arrow on light bg — use dark tones, lower position */
.biographie .section-arrow {
  border-color: rgba(10, 10, 10, 0.2);
  color: rgba(10, 10, 10, 0.35);
  bottom: var(--s-12);
}
.biographie .section-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.biographie__content {
  margin-top: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  align-items: center;
}

.biographie__bio-text {
  font-family: var(--font-body);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: var(--lh-loose);
  color: var(--fg);
  max-width: 80ch;
  font-variation-settings: 'opsz' 32;
  text-align: center;
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bg-sunken);
  padding: var(--s-16) var(--page-pad-x) var(--s-8);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-16) var(--s-8);
}

.footer__mark {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.footer__mark span { color: var(--accent); }

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.footer__bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: var(--s-5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 5, 0.96);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: calc(var(--nav-h) + var(--s-8)) clamp(60px, 10vw, 160px) var(--s-10);
  gap: clamp(var(--s-8), 4vw, var(--s-16));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-snap);
}

.lightbox--open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__close {
  position: absolute;
  top: var(--s-6);
  right: var(--s-8);
  background: none;
  border: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  cursor: pointer;
  padding: var(--s-2);
  z-index: 10;
}

/* Media — takes all remaining horizontal space */
.lightbox__media {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__media video,
.lightbox__media img {
  max-width: 100%;
  max-height: calc(100vh - var(--nav-h) - var(--s-8) - var(--s-10));
  object-fit: contain;
}

/* Caption — right column, no border, vertically centered */
.lightbox__caption {
  width: clamp(200px, 22vw, 300px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-6);
}


/* Gallery nav — sits naturally below the text in the right column */
.lightbox__nav {
  display: flex;
  gap: var(--s-3);
  align-items: center;
}

.lightbox__nav button {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--t-meta);
  padding: var(--s-2) var(--s-4);
  cursor: pointer;
  transition: border-color var(--d-base), color var(--d-base);
}

.lightbox__nav button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- CONTACT DRAWER ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-snap);
}

.drawer-backdrop--open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 100;
  padding: calc(var(--nav-h) + var(--s-8)) var(--s-12) var(--s-8);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--d-layout) var(--ease-snap);
}

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

.drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-12);
}

.drawer__close {
  background: none;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  padding: var(--s-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer__title {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: var(--s-4);
}

.drawer__subtitle {
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-style: italic;
  color: var(--fg-muted);
  margin-bottom: var(--s-10);
  max-width: none;
}

.drawer__form {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.field label {
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  font-weight: 500;
  color: var(--fg-faint);
}

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: var(--t-body);
  background: transparent;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  padding: var(--s-3) 0;
  resize: none;
  border-radius: 0;
  width: 100%;
  transition: border-color var(--d-base);
}

.field input:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-faint); font-style: italic; }

.drawer__sent { display: none; }
.drawer__sent--visible { display: block; }

/* ---------- FLOATING CTA ---------- */
.floating-cta {
  position: fixed;
  right: var(--s-8);
  bottom: var(--s-8);
  z-index: 40;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-snap),
              transform var(--d-base) var(--ease-snap);
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.floating-cta--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- HERO ENTRANCE ANIMATIONS ---------- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__tag {
  opacity: 0;
  animation: heroFadeUp 0.55s var(--ease-snap) forwards;
}
.hero__tag:nth-child(1) { animation-delay: 0.05s; }
.hero__tag:nth-child(2) { animation-delay: 0.15s; }
.hero__tag:nth-child(3) { animation-delay: 0.25s; }
.hero__tag:nth-child(4) { animation-delay: 0.35s; }

.hero__name {
  opacity: 0;
  animation: heroFadeUp 0.65s var(--ease-snap) 0.45s forwards;
}

.hero__bio {
  opacity: 0;
  animation: heroFadeUp 0.6s var(--ease-snap) 0.65s forwards;
}

/* ---------- SECTION ARROWS — down chevron between sections ---------- */
.section-arrow {
  position: absolute;
  bottom: var(--s-16);
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: 1px solid rgba(245, 241, 234, 0.15);
  border-radius: var(--r-full);
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  z-index: 5;
  transition: border-color var(--d-base) var(--ease-snap),
              color var(--d-base) var(--ease-snap);
  animation: arrowBob 2.4s ease-in-out infinite;
}
.section-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@keyframes arrowBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ---------- PROJETS TRANSITION INITIAL STATE (B4 toggles .projets--visible) ---------- */
/* Featured title entrance — initial state set here, B4 JS toggles via .projets--visible */
.project-card--featured .project-card__title {
  transform: translateY(16px);
  opacity: 0;
  transition: transform 600ms 300ms var(--ease-snap),
              opacity 600ms 300ms var(--ease-snap);
}

.projets--visible .project-card--featured .project-card__title {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- ACCESSIBILITY ---------- */

/* Skip-to-content — visible on first Tab press */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--page-pad-x);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: var(--t-meta);
  text-transform: uppercase;
  letter-spacing: var(--tracking-meta);
  padding: var(--s-3) var(--s-6);
  z-index: 200;
  background-image: none;
  transition: top var(--d-micro);
}
.skip-link:focus {
  top: var(--s-3);
}

/* Focus rings — coral outline, brand-appropriate */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Remove default focus ring for mouse users (handled by :focus-visible above) */
:focus:not(:focus-visible) {
  outline: none;
}

/* Specific: project cards need a stronger signal */
.project-card:focus-visible,
.project-card--featured:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

/* Specific: form inputs already have outline:none — restore via :focus-visible */
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced-motion overrides */
@media (prefers-reduced-motion: reduce) {
  /* Kill all transitions and animations */
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  /* Projets reveal: skip to final state immediately */
  .projets {
    transform: none;
    opacity: 1;
  }

  /* Hero entrance + section arrows: skip animations */
  .hero__tag,
  .hero__name,
  .hero__bio {
    opacity: 1 !important;
    animation: none !important;
  }

  .section-arrow {
    animation: none;
  }

  /* Featured title: no translate */
  .project-card--featured .project-card__title {
    transform: none !important;
    opacity: 1 !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .hero__photo {
    height: 80vw;
    max-height: 520px;
    overflow: hidden;
  }

  .hero__photo img {
    object-position: center 15%;
  }

  .hero__photo::before {
    background: linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
  }

  .hero__content {
    padding: var(--s-8) var(--page-pad-x) var(--s-16);
  }

  .projets__featured-row {
    grid-template-columns: 1fr;
  }

  .projets__grid {
    grid-template-columns: 1fr;
  }

  /* Featured cards identical to grid cards on mobile */
  .project-card--featured .project-card__media {
    aspect-ratio: 4 / 3;
  }

  .project-card--featured .project-card__title {
    font-size: clamp(12px, 1.1vw, 16px);
  }

  .project-card--featured .project-card__info {
    padding: var(--s-8) var(--s-3) var(--s-3);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-1);
    justify-content: flex-start;
  }

  .nav__links {
    display: none;
  }

  /* Hide section arrows on small screens — not enough room */
  .section-arrow {
    display: none;
  }
}


@media (max-width: 600px) {
  .footer { grid-template-columns: 1fr; }

  .projets__grid {
    grid-template-columns: 1fr;
  }

  /* Hero name on small screens */
  .hero__name {
    font-size: clamp(36px, 12vw, 64px);
  }

  /* Hero tags wrap nicely */
  .hero__tags {
    gap: var(--s-2);
  }

  /* Lightbox — column layout on mobile: media top, caption below */
  .lightbox {
    flex-direction: column;
    justify-content: flex-start;
    padding: calc(var(--nav-h) + var(--s-6)) var(--s-4) var(--s-6);
    gap: var(--s-4);
    overflow-y: auto;
  }

  .lightbox__media {
    width: 100%;
    flex: 0 0 auto;
  }

  .lightbox__media video,
  .lightbox__media img {
    max-width: 100%;
    max-height: 70vh;
  }

  .lightbox__caption {
    width: 100%;
    flex-shrink: 0;
    flex-direction: column;
    gap: var(--s-3);
    align-items: flex-start;
    justify-content: flex-start;
  }

  /* Biographie: single column */
  .biographie__content {
    text-align: left;
    align-items: flex-start;
  }

  .biographie__bio-text {
    text-align: left;
  }
}
