/* =====================================================
   Noann Ozier Lafontaine — accueil
   Monde : studio cinématique. Typo géante, champ de
   lumière qui respire, pilules, deux thèmes jumeaux.
   ===================================================== */

/* ── Fonte — Onest (SIL OFL), variable 300–800, auto-hébergée ── */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/Onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/Onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Thèmes jumeaux ───────────────────────────────── */
:root {
  --bg:        #0a0a0b;
  --fg:        #f5f5f4;
  --fg-2:      rgba(245, 245, 244, 0.78);
  --fg-3:      rgba(245, 245, 244, 0.68);
  --line:      rgba(255, 255, 255, 0.12);
  --line-hi:   rgba(255, 255, 255, 0.24);
  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --pill:      #f5f5f4;
  --pill-fg:   #0a0a0b;
  --l1: #ff8a5b;   /* corail */
  --l2: #ffd166;   /* ambre  */
  --l3: #7c5cff;   /* violet */
  --light-alpha: 0.66;
  --grain-alpha: 0.09;
  --halo-alpha: 0.5;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-theme: 900ms;
}

:root[data-theme="light"] {
  --bg:        #f6f5f2;
  --fg:        #0d0d0e;
  --fg-2:      rgba(13, 13, 14, 0.62);
  --fg-3:      rgba(13, 13, 14, 0.62);
  --line:      rgba(0, 0, 0, 0.13);
  --line-hi:   rgba(0, 0, 0, 0.22);
  --surface:   rgba(255, 255, 255, 0.8);
  --surface-2: rgba(255, 255, 255, 0.85);
  --pill:      #0d0d0e;
  --pill-fg:   #f6f5f2;
  --l1: #ff7a59;
  --l2: #ffc857;
  --l3: #6e5cff;
  --light-alpha: 0.5;
  --grain-alpha: 0.06;
  --halo-alpha: 0.7;
}

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

html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
html[data-theme="light"] { color-scheme: light; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
  transition: background-color var(--t-theme) ease, color var(--t-theme) ease;
}

svg { display: inline-block; vertical-align: middle; }
a { color: inherit; }
::selection { background: var(--l3); color: #fff; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 999px; }

/* ── Lumière & grain ──────────────────────────────── */
.light {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  filter: blur(64px) saturate(1.15);
  opacity: var(--light-alpha);
  pointer-events: none;
  transition: opacity var(--t-theme) ease;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-alpha);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ── Nav ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--pad);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Voile du fond derrière la nav : son opacité suit le défilement (--veil, 0 → 1) */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -28px 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 60%, transparent 100%);
  opacity: var(--veil, 0);
  pointer-events: none;
  transition: background var(--t-theme) ease;
}

.nav__mark {
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav__links { display: flex; align-items: center; gap: 4px; }

.nav__link {
  color: var(--fg-2);
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
  white-space: nowrap;
}

.nav__link:hover { color: var(--fg); background: var(--surface-2); }

.nav__link--pill {
  color: var(--pill-fg);
  background: var(--pill);
  padding: 10px 16px;
  margin-left: 6px;
  transition: transform 240ms var(--ease), background var(--t-theme) ease, color var(--t-theme) ease;
}
.nav__link--pill:hover { color: var(--pill-fg); background: var(--pill); transform: translateY(-1px); }

/* Interrupteur de thème — pilule soleil / lune */
.theme {
  margin-left: 10px;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 999px;
}

/* Piste : soleil à gauche, lune à droite, en retrait. Le bouton
   (knob) se pose du côté du thème actif et porte son icône. */
.theme__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 58px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color 160ms ease, background var(--t-theme) ease;
}

.theme:hover .theme__track { border-color: var(--line-hi); }

.theme__icon { width: 13px; height: 13px; color: var(--fg-3); transition: color 300ms ease; }

.theme__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--pill);
  color: var(--pill-fg);
  display: grid;
  place-items: center;
  transition: transform 420ms var(--ease), background var(--t-theme) ease, color var(--t-theme) ease;
}

.theme__knob svg { grid-area: 1 / 1; width: 13px; height: 13px; color: var(--pill-fg); transition: opacity 240ms ease, transform 420ms var(--ease); }

/* Sombre : knob à droite, lune dedans. Clair : knob à gauche, soleil dedans. */
:root[data-theme="dark"]  .theme__knob { transform: translateX(28px); }
:root[data-theme="dark"]  .theme__knob .theme__icon--sun  { opacity: 0; transform: rotate(-90deg); }
:root[data-theme="light"] .theme__knob .theme__icon--moon { opacity: 0; transform: rotate(90deg); }

/* ── Hero ─────────────────────────────────────────── */
main { position: relative; z-index: 2; flex: 1; }

.hero {
  min-height: 100svh;
  display: grid;
  align-content: end;
  padding: 96px var(--pad) clamp(24px, 4vh, 44px);
}

.hero__title {
  font-size: clamp(2.6rem, 9.4vw, 9.5rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  max-width: 13ch;
  display: flex;
  flex-direction: column;
}

.hero__line { display: block; }

.hero__lead {
  margin-top: clamp(22px, 3vh, 32px);
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--fg-2);
  max-width: 46ch;
  text-wrap: pretty;
}

.hero__lead strong { color: var(--fg); font-weight: 600; }

.hero__cta {
  margin-top: clamp(24px, 3.5vh, 36px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: clamp(40px, 8vh, 96px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--fg-3);
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg-3);
  transition: color 160ms ease;
}
.hero__scroll:hover { color: var(--fg); }
.hero__scroll-icon { width: 13px; height: 13px; transform: rotate(90deg); animation: nudge 2.4s var(--ease) infinite; }

@keyframes nudge {
  0%, 100% { transform: rotate(90deg) translateX(0); }
  50%      { transform: rotate(90deg) translateX(3px); }
}

/* ── Boutons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg);
  background: transparent;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 260ms var(--ease), background 160ms ease, border-color 160ms ease;
}

.btn:hover { transform: translateY(-2px); background: var(--surface-2); border-color: var(--line-hi); }

.btn--fill { background: var(--pill); color: var(--pill-fg); border-color: transparent; }
.btn--fill:hover { background: var(--pill); border-color: transparent; }

.btn__icon { width: 14px; height: 14px; flex-shrink: 0; transition: transform 260ms var(--ease); }
.btn:hover .btn__icon { transform: translateX(3px); }
.btn[target="_blank"]:hover .btn__icon { transform: translate(2px, -2px); }

/* ── Portes ───────────────────────────────────────── */
.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 14px var(--pad) clamp(40px, 8vh, 96px);
}

.door {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 280px;
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  transition: transform 360ms var(--ease), border-color 200ms ease, background var(--t-theme) ease;
}

.door:hover { transform: translateY(-4px); border-color: var(--line-hi); }

.door__halo {
  position: absolute;
  left: -20%; right: -20%; top: -45%;
  height: 120%;
  background: radial-gradient(closest-side, var(--halo), transparent 70%);
  opacity: var(--halo-alpha);
  filter: blur(28px);
  pointer-events: none;
  transition: opacity 400ms ease, transform 700ms var(--ease);
}
.door:hover .door__halo { opacity: 0.85; transform: translateY(6%); }

.door__arrow {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 360ms var(--ease), background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.door__arrow svg { width: 15px; height: 15px; }
.door:hover .door__arrow { background: var(--pill); color: var(--pill-fg); border-color: transparent; transform: rotate(-45deg); }
.door[target="_blank"]:hover .door__arrow { transform: rotate(0); }

.door__title { position: relative; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.door__text  { position: relative; font-size: 0.9375rem; color: var(--fg-2); line-height: 1.4; overflow-wrap: anywhere; }

/* ── Pied ─────────────────────────────────────────── */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 20px var(--pad) 24px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--fg-3);
}

.foot__link { color: var(--fg-3); text-decoration: none; overflow-wrap: anywhere; transition: color 160ms ease; }
.foot__link:hover { color: var(--fg); }

/* ── Motion ───────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.hero__line, .hero__lead, .hero__cta, .hero__foot {
  animation: rise 900ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 200px; }
}

@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .nav__mark { font-size: 0.8125rem; }
  .nav__link:not(.nav__link--pill) { display: none; }
  .nav__link--pill { padding: 9px 14px; margin-left: 0; }
  .hero { padding-top: 84px; }
  /* Titre en bloc fluide : les lignes se refondent, l'animation porte sur le h1 entier */
  .hero__title { letter-spacing: -0.04em; display: block; text-wrap: balance; animation: rise 900ms var(--ease) both; animation-delay: 120ms; }
  .hero__line { display: inline; animation: none; }
  .hero__foot span:last-child { display: none; }
}

/* ── Reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero__title, .hero__line, .hero__lead, .hero__cta, .hero__foot { animation: none; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__scroll-icon { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* =====================================================
   Pages intérieures — projetap.php, page404.php
   ===================================================== */

/* État courant dans la nav */
.nav__link[aria-current="page"] { color: var(--fg); }
.nav__link[aria-current="page"]:hover { background: transparent; }

/* Hero de page : plus court que l'accueil, même grammaire */
.hero--page { min-height: 64svh; padding-top: 120px; }
.hero--page .hero__title { font-size: clamp(3rem, 8.6vw, 8rem); }
.hero--404 { min-height: 100svh; }
.hero--404 .hero__title { font-size: clamp(5rem, 16vw, 15rem); }

/* ── Projets ──────────────────────────────────────── */
.projects {
  display: grid;
  gap: 14px;
  padding: 14px var(--pad) clamp(40px, 8vh, 96px);
}

.project {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 20px 48px;
  align-items: start;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 200ms ease, background var(--t-theme) ease;
}

.project:hover { border-color: var(--line-hi); }

.project__halo {
  position: absolute;
  right: -25%; top: -60%;
  width: 60%; height: 160%;
  background: radial-gradient(closest-side, var(--halo), transparent 70%);
  opacity: var(--halo-alpha);
  filter: blur(36px);
  pointer-events: none;
  transition: opacity 400ms ease;
}
.project:hover .project__halo { opacity: 0.85; }

.project__head { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.project__name {
  font-size: clamp(1.625rem, 2.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-2);
}

.project__body { position: relative; }

.project__desc {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.5;
  color: var(--fg-2);
  max-width: 56ch;
  text-wrap: pretty;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.btn--sm { padding: 10px 16px; font-size: 0.875rem; }

.project__restricted {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px dashed var(--line-hi);
  font-size: 0.875rem;
  color: var(--fg-3);
}

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; gap: 16px; }
  .hero--page { min-height: 56svh; padding-top: 104px; }
}
