/* Archivo, hébergée avec le site (licence SIL OFL, voir fonts/OFL.txt) */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2-variations"),
       url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* Page plein écran : en-tête / scène / pied de page, sans défilement.
   Fond blanc, thème unique. */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --tile: #efefef;
  --tile-line: #e0e0e0;
  --veil: rgba(255, 255, 255, 0.9);
  --shadow: rgba(26, 26, 26, 0.16);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: light;
}

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

html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

/* ---------- En-tête ---------- */
.site-header {
  padding-top: max(var(--gutter), env(safe-area-inset-top, 0px));
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.name {
  margin: 0;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 100;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
}
.name { color: #C90808; font-weight: 300; }
/* Étoile à 8 branches, pointes légèrement arrondies */
.star {
  flex: none;
  /* Même hauteur que les capitales du nom */
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  width: 0.7em;
  height: 0.7em;
  fill: #C90808;
  stroke: #C90808;
  stroke-width: 6;
  stroke-linejoin: round;
}

/* ---------- Scène ---------- */
.stage {
  position: relative;
  z-index: 1; /* les carrés restent sous l'en-tête et le pied de page */
  min-height: 0;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.stage.dragging { cursor: grabbing; }

.orbit { position: absolute; inset: 0; }

.tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tile-size, 96px);
  height: var(--tile-size, 96px);
  margin: calc(var(--tile-size, 96px) / -2) 0 0 calc(var(--tile-size, 96px) / -2);
  background: var(--tile);
  border: 1px solid var(--tile-line);
  overflow: hidden;
  will-change: transform, opacity;
}
.tile { cursor: pointer; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tile img, .tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.center {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(100%, 1100px);
  text-align: center;
  pointer-events: none;
}

/* Titre : FreightBig Pro Light vectorisée (écart 7 %), voir CLAUDE.md */
.title {
  margin: 0;
  font-size: clamp(2.2rem, min(17.5vw, 20vh), 10.5rem);
  color: #C90808;
}
.title svg {
  display: block;
  height: 1.605em;
  width: auto;
  margin: 0 auto;
}

.subtitle {
  margin: clamp(14px, 2.4vh, 28px) 0 clamp(8px, 1.4vh, 16px);
  /* La taille baisse sur les petits écrans pour tenir sur une seule ligne */
  font-size: min(clamp(0.95rem, 1.6vw, 1.25rem), calc((100vw - 34px) / 25.7));
  white-space: nowrap;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.countdown {
  display: inline-flex;
  gap: clamp(14px, 3vw, 40px);
  justify-content: center;
}
.unit { display: grid; justify-items: center; gap: 2px; }
.num {
  font-size: clamp(1.8rem, 4.4vw, 3.6rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.lbl {
  font-size: 0.7rem;
  font-weight: 100;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* ---------- Pied de page ---------- */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px));
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  position: relative;
  z-index: 30;
}
/* Lien : texte souligné + flèche fine ↗ (la flèche n'est pas soulignée) */
.link {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-thickness: 0.75px;
  text-underline-offset: 0.17em;
  white-space: nowrap;
}
/* Flèche : du haut des capitales jusqu'au bas du soulignement */
.link::after {
  content: "";
  display: inline-block;
  width: 0.96em;
  height: 0.96em;
  margin-left: 0.53em;
  vertical-align: -0.28em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform 0.25s ease;
}
.link:hover::after { transform: translate(2px, -2px); }
:root {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.5 15.5 15.5 .5M3.2 .5H15.5V12.8' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---------- Agrandissement ---------- */
.zoom { position: fixed; inset: 0; z-index: 100; }
.zoom-veil {
  position: absolute;
  inset: 0;
  background: var(--veil);
  cursor: zoom-out;
}
.zoom-box { position: absolute; }
.zoom-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--tile);
  border: 1px solid var(--tile-line);
  box-shadow: 0 24px 70px var(--shadow);
}
.zoom-media img, .zoom-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.zoom-close {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 6px 0 6px 12px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
/* Légende : sous l'image, à gauche, jamais plus large qu'elle */
.zoom-caption {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 12px);
  margin: 0;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 100;
  line-height: 1.35;
  letter-spacing: 0.1em;
  color: #1a1a1a;
}
.caption-name { text-transform: uppercase; }
/* Tiret long et fin entre le nom du projet et sa description */
.caption-dash {
  display: inline-block;
  width: 1.54em;
  height: 0.75px;
  margin: 0 0.75em;
  vertical-align: 0.32em;
  background: currentColor;
}
.zoom-close span { font-size: 1.4em; line-height: 1; letter-spacing: 0; }
.zoom-close:focus, .zoom-close:focus-visible { outline: none; }

.f-center { justify-self: center; }
.f-left { justify-self: start; }
.f-right { justify-self: end; }

@media (prefers-reduced-motion: reduce) {
  .link::after { transition: none; }
}
