/* ------------------------------------------------------------
   Réglages faciles à changer
   ------------------------------------------------------------ */
:root {
  --rouge: #ff3d3d;          /* texte du terminal */
  --rouge-fonce: #8c0a0a;    /* point rouge (extérieur) */
  --rouge-vif: #e0161b;      /* point rouge (centre) */
  --noir: #000;
  --fond: #d9d9d9;           /* couleur derrière la photo pendant le chargement */
  --police: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--rouge);
  font-family: var(--police);
  -webkit-font-smoothing: antialiased;
}
body.home { overflow: hidden; height: 100dvh; }

/* ------------------------------------------------------------
   La photo (le script la place pour que la cagoule reste au centre)
   ------------------------------------------------------------ */
.stage {
  position: fixed;
  left: 0; top: 0;
  width: max(100vw, 94.8vh);
  aspect-ratio: 2400 / 2532;
  transform-origin: 0 0;
}
.photo {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  animation: fadein 1.2s ease both;
}
@keyframes fadein { from { opacity: 0; } }

/* ------------------------------------------------------------
   Terminal dans l'ouverture de la cagoule
   Positions en % de la photo → il reste collé à la cagoule.
   ------------------------------------------------------------ */
.visor {
  position: absolute;
  left: 39.17%;
  top: 43.05%;
  width: 23.33%;
  height: 10.27%;
  clip-path: ellipse(48% 46% at 50% 50%);
  container-type: inline-size;
  cursor: text;
}
.screen {
  position: absolute;
  inset: 8% 10% 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 4.6cqw;
  line-height: 1.3;
  letter-spacing: 0.005em;
}
.out {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: 3.9em;               /* 3 lignes visibles */
  overflow: hidden;
}
.out.full {                        /* fondu en haut quand ça déborde */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.1em);
          mask-image: linear-gradient(to bottom, transparent 0, #000 1.1em);
}
.out .l { white-space: nowrap; }
.out .dim { opacity: 0.55; }
.out a, .out button.entry {
  color: inherit;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0.35em;
  cursor: pointer;
  text-decoration: none;
}
.out a:hover, .out button.entry:hover,
.out a:focus-visible, .out button.entry:focus-visible { text-decoration: underline; outline: none; }
.prompt { white-space: nowrap; }
.ps { opacity: 0.6; }
.caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.08em;
  margin-right: -0.5em;            /* le curseur se pose sur la suggestion */
  position: relative;
  z-index: 1;
  vertical-align: -0.12em;
  background: var(--rouge);
  animation: blink 1s steps(1) infinite;
}
.visor:not(.focus) .caret { opacity: 0.45; }
.ghost { opacity: 0.35; }          /* suggestion de nom, validée par Tab ou → */
@keyframes blink { 50% { opacity: 0; } }

/* le vrai champ de saisie est invisible : on tape "dans" la cagoule */
.cmd {
  position: absolute;
  left: 50%; top: 50%;
  width: 1px; height: 1px;
  opacity: 0;
  border: 0; padding: 0;
  font-size: 16px;                 /* évite le zoom auto sur iPhone */
  pointer-events: none;
}

/* ------------------------------------------------------------
   Point rouge → dossiers dans le terminal
   ------------------------------------------------------------ */
.dot {
  position: absolute;
  left: 38.83%;
  top: 43.76%;
  width: 2.1%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--rouge-fonce);
  cursor: pointer;
  transition: scale .25s ease, background .25s ease;
}
.dot::before {                     /* zone de clic plus grande (doigts) */
  content: "";
  position: absolute;
  inset: -60%;
  border-radius: 50%;
}
.dot-orbit {                       /* tourne d'un tour à chaque clic */
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: rotate .8s cubic-bezier(.65, 0, .25, 1);
}
.dot-core {
  position: absolute;
  left: 52%; top: 56%;
  width: 30%; height: 30%;
  border-radius: 50%;
  background: var(--rouge-vif);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.dot:hover { scale: 1.15; background: #a80f0f; }
.dot:focus-visible { outline: 2px solid var(--rouge); outline-offset: 4px; }

/* ------------------------------------------------------------
   Logo boîte aux lettres (haut gauche)
   ------------------------------------------------------------ */
.mailbox {
  position: fixed;
  z-index: 10;
  left: clamp(12px, 1.4vw, 28px);
  top: clamp(12px, 1.5vw, 30px);
  width: clamp(32px, 2.6vw, 48px);
  color: var(--noir);
  line-height: 0;
  transition: color .2s ease, transform .2s ease;
}
.mailbox svg { width: 100%; height: auto; display: block; }
.mailbox:hover { color: var(--rouge); transform: translateY(-2px); }
.mailbox:focus-visible { outline: 2px solid var(--rouge); outline-offset: 3px; }

/* ------------------------------------------------------------
   Pages intérieures (photographie / architecture)
   ------------------------------------------------------------ */
body.page {
  background: var(--noir);
  min-height: 100dvh;
  padding: clamp(80px, 9vw, 140px) clamp(16px, 5vw, 80px) 60px;
}
.page .mailbox { color: var(--rouge); }
.page h1 {
  margin: 0 0 0.4em;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 56px);
}
.page .path { opacity: .55; margin: 0 0 2.5em; }
.page .back { color: var(--rouge); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(12px, 2vw, 28px);
  margin-bottom: 3em;
}
.grid figure { margin: 0; }
.grid .frame {
  aspect-ratio: 4 / 5;
  border: 1px solid #3a0c0c;
  display: grid;
  place-items: center;
  color: #6a1a1a;
}
.grid figcaption { margin-top: .6em; opacity: .7; font-size: 14px; }

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