/* Garden Fence Games — site V2
   1rem = 10 px de la maquette Figma (1440 × 900).
   Desktop : la maquette est mise à l'échelle de la fenêtre, une page fixe par section.
   Mobile  : 1rem = 10 px, sections empilées avec scroll. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-300-latin.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

:root {
  --ink: #141416;
  --graphite: #202023;
  --line: #38383c;
  --muted: #8c8a86;
  --paper: #ece8e0;
  --stone: #d9d4ca;
  --orange: #ff5b14;

  /* tokens de thème (Jour) */
  --bg: var(--paper);
  --fg: var(--ink);
  --surface: var(--stone);
  --rule: var(--ink);
  --nav-bg: var(--paper);

  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 8rem;
  --pad-x: 6.4rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: var(--ink);
  --fg: var(--paper);
  --surface: var(--graphite);
  --rule: var(--paper);
  --nav-bg: var(--ink);
}

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

html { font-size: 10px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 300; }

.mono {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.num { color: var(--orange); }

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--orange); color: var(--ink); padding: 1rem; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 1px solid var(--orange); outline-offset: 3px; }

/* ---------- petits éléments ---------- */
.dot, .led { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--orange); flex: none; }
.dot { width: .8rem; height: .8rem; }
.led { margin-right: .8rem; vertical-align: middle; animation: blink 2.4s steps(1) infinite; }
.led-ink { background: var(--ink); }
@keyframes blink { 0%, 85% { opacity: 1; } 86%, 100% { opacity: .25; } }

.tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--orange);
  color: var(--ink);
  padding: .5rem .8rem;
  text-transform: none;
}
.tag-ink { background: var(--ink); color: var(--orange); text-transform: uppercase; }

.placeholder {
  position: relative;
  background: var(--surface);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.8rem;
  color: var(--muted);
  overflow: hidden;
  transition: background-color .4s var(--ease);
}
.crosshair { position: relative; width: 4rem; height: 4rem; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--orange); }
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.crosshair::after { top: 50%; left: 0; right: 0; height: 1px; }

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--rule);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.logo { display: flex; align-items: center; gap: 1rem; }
.logo-mark { height: 3.4rem; width: auto; color: var(--fg); flex: none; margin-right: .2rem; transition: color .4s var(--ease), transform .4s var(--ease); }
.logo:hover .logo-mark { transform: translateY(-.2rem); }
.logo-name { font-size: 1.6rem; font-weight: 400; }
.logo-tag { color: var(--muted); }
.nav-right { display: flex; align-items: center; gap: 4rem; }
.links { display: flex; gap: 4rem; font-size: 1.4rem; }
.links a { position: relative; transition: color .2s; }
.links a:hover, .links a[aria-current="page"] { color: var(--orange); }

.lang {
  display: flex; gap: .6rem; align-items: center;
  border: 1px solid var(--muted); border-radius: 1.1rem;
  padding: .5rem 1.2rem; color: var(--muted);
}
.lang [data-lang] { transition: color .2s; }
html[lang="fr"] .lang [data-lang="fr"], html[lang="en"] .lang [data-lang="en"] { color: var(--orange); }
.lang:hover { border-color: var(--orange); }

.theme { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.switch {
  position: relative; width: 4rem; height: 2rem;
  border: 1px solid var(--fg); border-radius: 1rem;
  transition: border-color .4s;
}
.knob {
  position: absolute; top: 50%; left: .3rem;
  width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--orange);
  transform: translateY(-50%);
  transition: left .35s var(--ease);
}
[data-theme="dark"] .knob { left: calc(100% - 1.5rem); }

.burger { display: none; }

/* ---------- structure de page ---------- */
main { padding-top: var(--nav-h); }
.page {
  position: relative;
  isolation: isolate;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: 6.4rem var(--pad-x);
  transition: background-color .4s var(--ease);
}
.entete {
  display: flex; justify-content: space-between; gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.1rem;
}
.entete p:first-child { display: flex; gap: 1.6rem; }

.hud-row { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.hud-row p { white-space: nowrap; }

/* ---------- 01 accueil ---------- */
.page-accueil { padding: 0; }
.accueil-content { display: flex; flex-direction: column; gap: 2.8rem; padding: 4rem var(--pad-x) 4.4rem; }
.showreel {
  position: relative;
  background: var(--graphite);
  color: var(--muted);
  aspect-ratio: 1312 / 480;
  display: grid; place-items: center; align-content: center; gap: 2rem;
  overflow: hidden;
}
.showreel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.corner { position: absolute; width: 2rem; height: 2rem; border-color: var(--orange); border-style: solid; border-width: 0; pointer-events: none; z-index: 2; }
.corner.tl { top: 5%; left: 1.83%; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 5%; right: 1.83%; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 5%; left: 1.83%; border-bottom-width: 1px; border-left-width: 1px; border-color: var(--muted); }
.corner.br { bottom: 5%; right: 1.83%; border-bottom-width: 1px; border-right-width: 1px; border-color: var(--muted); }
.play { width: 7.2rem; height: 7.2rem; color: var(--muted); transition: color .2s, transform .3s var(--ease); }
.play svg { width: 100%; height: 100%; display: block; }
.play:hover { color: var(--orange); transform: scale(1.06); }
.reel-time { position: absolute; right: 10.4rem; bottom: 3.8rem; }
.showreel.is-playing .play, .showreel.is-playing .reel-label, .showreel.is-playing .reel-time { display: none; }

.hud-build { color: var(--fg); }
.accroche { display: flex; justify-content: space-between; align-items: flex-end; gap: 4rem; }
.accroche h1 { font-size: 5.2rem; line-height: 1.1; letter-spacing: -.02em; max-width: 72rem; }
.accroche-sub { font-size: 1.5rem; line-height: 1.5; color: var(--muted); white-space: nowrap; }

.bandeau { background: var(--orange); color: var(--ink); overflow: hidden; display: flex; align-items: center; min-height: 7.4rem; }
.bandeau-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.bandeau-set { display: flex; align-items: center; gap: 2.8rem; padding-left: 2.8rem; }
.bandeau-set span { font-size: 2.6rem; font-weight: 400; letter-spacing: -.01em; white-space: nowrap; }
.bandeau-set i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink); flex: none; }
.bandeau:hover .bandeau-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- 02 projets ---------- */
.page-projets { gap: 4rem; padding-top: 7.2rem; padding-bottom: 7.2rem; }
.projet { display: flex; gap: 8rem; align-items: flex-start; }
.keyart { flex: 0 0 72rem; aspect-ratio: 3 / 2; }
.projet-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2.8rem; }
.status { color: var(--orange); }
.projet-title { font-size: 6.4rem; line-height: 1; letter-spacing: -.03em; }
.projet-desc { font-size: 1.7rem; line-height: 1.6; }
.fiche > div { display: flex; justify-content: space-between; align-items: baseline; gap: 2rem; padding: 1.2rem 0; border-top: 1px solid var(--rule); }
.fiche dt { color: var(--muted); }
.fiche dd { font-size: 1.4rem; text-align: right; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2.4rem; }
.stats > div { border-top: 1px solid var(--rule); padding-top: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.stats .mono { font-size: .9rem; color: var(--muted); }
.stat-v { font-size: 2rem; letter-spacing: -.01em; }
.spark { width: 16rem; max-width: 100%; height: 2.4rem; }

/* ---------- 03 à propos ---------- */
.page-apropos { gap: 3.6rem; padding-bottom: 5.6rem; }
.apropos-title { font-size: 5.6rem; line-height: 1.05; letter-spacing: -.03em; max-width: 90rem; }
.apropos-title em { font-style: normal; color: var(--orange); }
.textes { display: flex; gap: 8rem; align-items: flex-start; }
.textes .lead { font-size: 2rem; line-height: 1.55; max-width: 56rem; }
.textes .second { font-size: 1.6rem; line-height: 1.65; color: var(--muted); max-width: 42rem; }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.2rem; }
.chiffres > div { border-top: 1px solid var(--rule); padding-top: 2.4rem; display: flex; flex-direction: column; gap: .6rem; }
.chiffres .big { font-size: 4rem; letter-spacing: -.02em; }
.chiffres .mono { color: var(--muted); }
.journal-title { font-size: .9rem; color: var(--muted); padding-bottom: .8rem; display: flex; align-items: center; }
.commit { display: flex; align-items: center; gap: 2.4rem; padding: .7rem 0; border-top: 1px solid var(--rule); text-transform: none; }
.commit .hash { color: var(--orange); }
.commit .msg { flex: 1; letter-spacing: .02em; }
.commit .when { font-size: .9rem; color: var(--muted); text-transform: uppercase; white-space: nowrap; }

/* ---------- 04 équipe ---------- */
.page-equipe { gap: 4rem; }
.cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 3.2rem; }
.carte { display: flex; flex-direction: column; gap: 2.4rem; min-width: 0; }
.photo { aspect-ratio: 640 / 340; }
.carte-head { display: flex; justify-content: space-between; align-items: flex-end; }
.carte-head h3 { font-size: 3.6rem; letter-spacing: -.02em; line-height: 1.2; }
.bio { font-size: 1.5rem; line-height: 1.6; color: var(--muted); max-width: 52rem; }
.meta { white-space: pre; }
.liens { display: flex; gap: 2.4rem; }
.liens a:hover, .socials a:hover { color: var(--orange); }

/* ---------- 05 contact ---------- */
.page-contact { background: var(--orange); color: var(--ink); gap: 5.6rem; padding-bottom: 4rem; }
.page-contact .entete { border-color: var(--ink); }
.contact-title { font-size: 9.6rem; line-height: 1; letter-spacing: -.04em; max-width: 110rem; }
.contact-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 4rem; }
.contact-text { font-size: 2rem; line-height: 1.55; max-width: 52rem; }
.contact-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 1.2rem; }
.contact-actions .tag { align-self: flex-end; }
.mail { font-size: 3.2rem; letter-spacing: -.01em; text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; white-space: nowrap; }
.mail:hover { text-decoration-thickness: 2px; }
.contact-links { display: flex; gap: 1.2rem; font-size: 1.2rem; }
.contact-links a { border: 1px solid var(--ink); padding: .8rem 1.4rem; transition: background-color .2s, color .2s; }
.contact-links a:hover { background: var(--ink); color: var(--orange); }
.spacer { flex: 1; }
.page-contact .hud-row { padding-bottom: .8rem; margin-top: -3.2rem; }
.footer { display: flex; justify-content: space-between; gap: 2rem; padding-top: 2.4rem; border-top: 1px solid var(--ink); margin-top: -3.2rem; }
.socials { display: flex; gap: 1.8rem; }
.socials a:hover { color: var(--paper); }


/* ---------- trames de fond ---------- */
:root { --trame: rgba(20, 20, 22, .07); --word: rgba(20, 20, 22, .045); }
[data-theme="dark"] { --trame: rgba(236, 232, 224, .06); --word: rgba(236, 232, 224, .045); }
.trame-cols::before, .trame-hud::before, .showreel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
/* trame A : colonnes fines, 12 colonnes comme le showreel V1 */
.trame-cols::before {
  background-image: linear-gradient(to right, var(--trame) 1px, transparent 1px);
  background-size: calc((100% - 2 * var(--pad-x)) / 12) 100%;
  background-position: var(--pad-x) 0;
  background-repeat: repeat-x;
  left: var(--pad-x); right: var(--pad-x);
  border-left: 1px solid var(--trame); border-right: 1px solid var(--trame);
}
/* trame B : repères HUD (croix + points), façon interface Marathon */
.trame-hud::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M34 40h12M40 34v12' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='1' fill='%23000'/%3E%3Ccircle cx='80' cy='0' r='1' fill='%23000'/%3E%3Ccircle cx='0' cy='80' r='1' fill='%23000'/%3E%3Ccircle cx='80' cy='80' r='1' fill='%23000'/%3E%3C/svg%3E");
  background-size: 8rem 8rem;
  background-position: calc(var(--pad-x) - 4rem) 0;
  opacity: .07;
}
[data-theme="dark"] .trame-hud::before { filter: invert(1); opacity: .08; }
.showreel { isolation: isolate; }
.showreel::before {
  background-image: linear-gradient(to right, rgba(236, 232, 224, .07) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  background-position: calc(100% / 12) 0;
}

/* ---------- mots géants en fond ---------- */
.bg-word { position: absolute; z-index: -1; pointer-events: none; overflow: visible; }
.bg-word text { fill: var(--word); font-family: var(--sans); font-weight: 400; font-size: 240px; letter-spacing: -.02em; }
.bg-ew { left: var(--pad-x); right: var(--pad-x); width: calc(100% - 2 * var(--pad-x)); bottom: 2rem; height: auto; }

/* ---------- accueil : showreel 16:9 centré, GARDEN FENCE derrière ---------- */
.stage { position: relative; isolation: isolate; display: grid; place-items: center; }
.bg-gf { inset: 0; width: 100%; height: 100%; }

/* =========================================================
   DESKTOP — une page fixe par section, maquette mise à l'échelle
   ========================================================= */
@media (min-width: 1024px) and (min-height: 600px) {
  html {
    /* 1rem = 10 px de maquette, mis à l'échelle pour tenir dans la fenêtre */
    font-size: calc(10 * min(100vw / 1440, 100vh / 900));
  }
  html.js, html.js body { height: 100%; overflow: hidden; }
  html.js main { position: fixed; inset: var(--nav-h) 0 0 0; padding: 0; }
  html.js .page {
    position: absolute; inset: 0;
    overflow: hidden auto; /* filet de sécurité sur écrans très bas */
    opacity: 0; visibility: hidden;
    transform: translateY(1.6rem);
    transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s .6s, background-color .4s var(--ease);
  }
  html.js .page.is-active {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .5s var(--ease) .05s, transform .6s var(--ease) .05s, visibility 0s, background-color .4s var(--ease);
  }

  /* l'accueil remplit la hauteur : la vidéo prend l'espace disponible */
  html.js .page-accueil .accueil-content { flex: 1; min-height: 0; }
  html.js .stage { flex: 1; min-height: 0; container-type: size; }
  html.js .showreel { width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; }

  html.js .page-projets .projet { flex: 1; min-height: 0; }
  html.js .keyart { aspect-ratio: auto; align-self: stretch; max-height: 48rem; }

  html.js .page-equipe .cartes { flex: 1; min-height: 0; }
  html.js .carte .photo { aspect-ratio: auto; flex: 1; min-height: 12rem; max-height: 34rem; }
}

/* =========================================================
   TABLETTE / MOBILE — sections empilées, scroll vertical
   ========================================================= */
@media (max-width: 1023.98px), (max-height: 599.98px) {
  :root { --nav-h: 6.4rem; --pad-x: 2.4rem; }
  html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
  .page { padding: 5.6rem var(--pad-x); gap: 3.2rem; }

  .nav-right { gap: 1.6rem; }
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: .6rem;
    width: 3.6rem; height: 3.6rem; margin-right: -.6rem; padding: .6rem;
  }
  .burger span { display: block; height: 1px; background: var(--fg); transition: transform .3s var(--ease); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(.35rem) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-.35rem) rotate(-45deg); }
  .theme-label { display: none; }

  .links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--rule);
    padding: .8rem var(--pad-x) 2.4rem;
    font-size: 3.2rem; letter-spacing: -.02em;
    transform: translateY(-1rem); opacity: 0; visibility: hidden;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .links a { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
  .links a:last-child { border-bottom: 0; }
  .nav.is-open .links { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }

  .page-accueil { padding: 0; gap: 0; }
  .accueil-content { padding: 2.4rem var(--pad-x) 3.2rem; gap: 2rem; }
  .stage { display: block; }
  .bg-gf { display: none; }
  .showreel { width: 100%; aspect-ratio: 16 / 9; }
  .reel-time { right: 2.4rem; bottom: 1.6rem; }
  .corner { width: 1.4rem; height: 1.4rem; }
  .play { width: 5.6rem; height: 5.6rem; }
  .hud-row { flex-wrap: wrap; justify-content: flex-start; column-gap: 2.4rem; row-gap: .8rem; }
  .accroche { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .accroche h1 { font-size: clamp(3.4rem, 9vw, 5.2rem); }
  .bandeau { min-height: 5.6rem; }
  .bandeau-set { gap: 2rem; padding-left: 2rem; }
  .bandeau-set span { font-size: 2rem; }

  .entete { flex-wrap: wrap; row-gap: .6rem; }
  .projet { flex-direction: column; gap: 3.2rem; }
  .keyart { flex: none; width: 100%; }
  .projet-title { font-size: clamp(4.4rem, 12vw, 6.4rem); }
  .fiche dd { max-width: 60%; }
  .stats { grid-template-columns: repeat(3, 1fr); row-gap: 2.4rem; }

  .apropos-title { font-size: clamp(3.4rem, 9vw, 5.6rem); }
  .textes { flex-direction: column; gap: 2.4rem; }
  .textes .lead { font-size: 1.8rem; }
  .chiffres { gap: 1.6rem; }
  .chiffres .big { font-size: 3.2rem; }
  .commit { gap: 1.2rem; }

  .cartes { grid-template-columns: 1fr; gap: 5.6rem; }
  .photo { aspect-ratio: 4 / 3; }
  .carte { gap: 2rem; }

  .page-contact { gap: 4rem; }
  .contact-title { font-size: clamp(4.4rem, 13vw, 9.6rem); }
  .contact-row { flex-direction: column; align-items: flex-start; gap: 3.2rem; }
  .contact-actions { align-items: flex-start; }
  .contact-actions .tag { align-self: flex-start; }
  .mail { font-size: clamp(2.2rem, 7vw, 3.2rem); white-space: normal; word-break: break-all; }
  .spacer { display: none; }
  .page-contact .hud-row, .footer { margin-top: 0; }
  .page-contact .hud-row { flex-direction: column; align-items: flex-start; }
  .footer { flex-direction: column; gap: 1.6rem; }
  .socials { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .chiffres { grid-template-columns: 1fr 1fr 1fr; }
  .lang { padding: .5rem 1rem; }
}

@media (max-width: 420px) {
  .logo-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
