/* ---------------------------------------------------------------
   MAISON NOIRE — feuille de style unique
   Noir absolu · machine à écrire · blanc · centré, non justifié
   --------------------------------------------------------------- */

:root {
  --noir: #000000;
  --blanc: #f2f0ed;
  --blanc-doux: rgba(242, 240, 237, 0.62);
  --ligne: rgba(242, 240, 237, 0.22);

  --mono: "Courier Prime", "Courier New", Courier, monospace;

  --texte: clamp(0.78rem, 0.72rem + 0.28vw, 0.94rem);
  --interligne: 2.05;

  /* Espace au-dessus du manifeste : pousse le texte vers le milieu de l'écran */
  --respiration-haut: clamp(4.5rem, 27vh, 16rem);

  --espace-1: 0.5rem;
  --espace-2: 1rem;
  --espace-3: 1.75rem;
  --espace-4: 3rem;
  --espace-5: 5rem;
  --espace-6: 7rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--mono);
  font-size: var(--texte);
  line-height: var(--interligne);
  text-align: center;      /* centré */
  text-wrap: balance;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Jamais justifié */
p, h1, h2, h3, li { text-align: center; }

a {
  color: var(--blanc);
  text-decoration: none;
  border-bottom: 1px solid var(--ligne);
  padding-bottom: 1px;
  transition: border-color 220ms ease, opacity 220ms ease;
}
a:hover,
a:focus-visible { border-color: var(--blanc); }

:focus-visible {
  outline: 1px solid var(--blanc);
  outline-offset: 3px;
}

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

/* ---------------------------------------------------------------
   Structure
   --------------------------------------------------------------- */

.shell {
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--espace-6) var(--espace-3) var(--espace-5);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--espace-6);
}

.page-home .shell {
  min-height: calc(100vh - 12rem);
  padding-top: var(--respiration-haut);
}

/* ---------------------------------------------------------------
   Manifeste
   --------------------------------------------------------------- */

.manifeste .line {
  margin: 0 0 var(--espace-2);
  letter-spacing: 0.01em;
}

/* Lignes 2 à 5 : fondu doux, révélé par le script après la frappe */
.manifeste .line--fondu {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 900ms ease, transform 900ms ease;
}
.manifeste .line--fondu.est-visible {
  opacity: 1;
  transform: none;
}

/* Première ligne : frappe machine à écrire */
.manifeste .line--frappe {
  min-height: calc(var(--interligne) * 1em);
}
.manifeste .line--frappe .curseur {
  display: inline-block;
  width: 0.62ch;
  margin-left: 0.12ch;
  border-bottom: 1px solid var(--blanc);
  vertical-align: baseline;
  animation: clignote 900ms steps(1, end) infinite;
}
.manifeste .line--frappe.est-finie .curseur { animation: none; opacity: 0; }

@keyframes clignote {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .manifeste .line--fondu { opacity: 1; transform: none; transition: none; }
  .manifeste .line--frappe .curseur { animation: none; opacity: 0; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------
   Porte (mot de passe)
   --------------------------------------------------------------- */

.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
}

.gate-label {
  color: var(--blanc-doux);
  letter-spacing: 0.02em;
}

.gate-field {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4ch;
  color: var(--blanc-doux);
}

.bracket { font-size: 1em; }

#password {
  width: 11ch;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ligne);
  color: var(--blanc);
  font: inherit;
  text-align: center;
  letter-spacing: 0.25em;
  padding: 0 0 2px;
  caret-color: var(--blanc);
  transition: border-color 220ms ease;
}
#password::placeholder {
  color: rgba(242, 240, 237, 0.3);
  letter-spacing: 0.08em;
}
#password:focus {
  outline: none;
  border-bottom-color: var(--blanc);
}

.gate-submit {
  background: transparent;
  border: 1px solid var(--ligne);
  color: var(--blanc-doux);
  font: inherit;
  font-size: 0.85em;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  padding: 0.35rem 1.4rem;
  cursor: pointer;
  transition: border-color 220ms ease, color 220ms ease;
}
.gate-submit:hover,
.gate-submit:focus-visible {
  border-color: var(--blanc);
  color: var(--blanc);
}

.gate-error {
  min-height: 1.5em;
  margin: 0;
  font-size: 0.85em;
  color: var(--blanc-doux);
  letter-spacing: 0.04em;
}
.gate.is-wrong { animation: secousse 320ms ease; }
@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  75%  { transform: translateX(4px); }
}

/* ---------------------------------------------------------------
   Contacts
   --------------------------------------------------------------- */

.contacts p {
  margin: 0 0 var(--espace-1);
  color: var(--blanc-doux);
}
.contacts a { color: var(--blanc); }

/* ---------------------------------------------------------------
   Pied de page + logo
   --------------------------------------------------------------- */

.footer {
  padding: var(--espace-4) var(--espace-3) var(--espace-5);
  display: flex;
  justify-content: center;
}

.logo {
  width: clamp(96px, 14vw, 148px);
  height: auto;
  opacity: 0.85;
  transition: opacity 300ms ease;
}
.logo:hover { opacity: 1; }

/* ---------------------------------------------------------------
   Page : Réalisations
   --------------------------------------------------------------- */

.entete {
  padding: var(--espace-5) var(--espace-3) var(--espace-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
}

.entete h1 {
  margin: 0;
  font-size: 0.95em;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--blanc);
}

.entete .retour {
  font-size: 0.8em;
  letter-spacing: 0.16em;
  color: var(--blanc-doux);
  border-bottom: none;
}
.entete .retour:hover { color: var(--blanc); }

.page-realisations .shell {
  max-width: 48rem;
  padding-top: var(--espace-3);
  gap: var(--espace-6);
  justify-content: flex-start;
}

/* Bloc générique */
.bloc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
}

.bloc h2 {
  margin: 0;
  font-size: 0.98em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.bloc .meta {
  margin: 0;
  font-size: 0.8em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blanc-doux);
}

.bloc p.texte {
  margin: 0 auto;
  max-width: 36rem;
  color: rgba(242, 240, 237, 0.86);
}

/* Média : vidéo Vimeo en 16/9 */
.media {
  width: 100%;
  margin-top: var(--espace-1);
}

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border: 1px solid var(--ligne);
  overflow: hidden;
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Média : image */
.image img {
  width: 100%;
  border: 1px solid var(--ligne);
  filter: grayscale(0);
}

.legende {
  margin: var(--espace-1) 0 0;
  font-size: 0.8em;
  letter-spacing: 0.04em;
  color: var(--blanc-doux);
}

/* Séparateur discret entre les blocs */
.bloc + .bloc::before {
  content: "·";
  display: block;
  color: var(--ligne);
  margin-bottom: var(--espace-4);
  letter-spacing: 0.6em;
}

@media (max-width: 640px) {
  :root { --interligne: 1.95; --respiration-haut: clamp(2.5rem, 14vh, 7rem); }
  .shell { gap: var(--espace-5); }
  .page-realisations .shell { padding-top: var(--espace-3); }
  .entete h1 { letter-spacing: 0.3em; }
}
