/* =====================================================================
   Page d'entrée : fond noir en grille animée, grand titre, connexion,
   bande de sites qui défile. Toutes les animations sont en CSS :
   le contenu s'affiche même si un script ne se charge pas.
   ===================================================================== */
body.entry {
  min-height: 100svh; background: #121210; color: #f4f2ec;
  display: grid; grid-template-rows: 1fr auto; overflow-x: hidden;
}

/* Fond : grille de secours en CSS, puis le canvas animé par-dessus */
.entry-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px;
}
.entry-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.entry-bg:has(canvas) { background-image: none; }
.entry-bg::after { /* vignette pour garder le centre lisible */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 30% 40%, transparent 40%, rgba(18,18,16,.85) 100%);
}

.entry-main {
  position: relative; z-index: 1;
  width: min(100%, 1240px); margin: 0 auto;
  padding: clamp(28px, 6vh, 72px) var(--gutter) 32px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px);
  align-items: center; gap: clamp(32px, 6vw, 96px);
}
/* pointer-events pour que la grille réagisse au curseur partout */
body.entry { cursor: default; }

/* ---------- Titre ---------- */
.entry-mark {
  display: block; width: clamp(22px, 2.4vw, 30px); aspect-ratio: 1;
  background: var(--honey); box-shadow: inset 0 0 0 6px #121210, 0 0 0 1px var(--honey);
  margin-bottom: clamp(20px, 3vw, 32px);
  animation: mark-in .9s var(--ease) both, mark-spin 9s linear 1.2s infinite;
}
@keyframes mark-in { from { transform: scale(0) rotate(-90deg); } }
@keyframes mark-spin { 0%, 80% { transform: rotate(0); } 90%, 100% { transform: rotate(90deg); } }

.entry-title h1 {
  font-size: clamp(3.6rem, 8.6vw, 8.4rem); line-height: .86; letter-spacing: -0.065em;
  color: #fff; font-weight: 750; white-space: nowrap;
}
.entry-title h1 .w { display: inline-block; overflow: hidden; padding-bottom: .08em; vertical-align: top; }
.entry-title h1 .w > span {
  display: inline-block;
  animation: letter-up 1s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms + 150ms);
}
.entry-title h1 .accent { color: var(--honey); }
@keyframes letter-up { from { transform: translateY(105%); } }

.entry-tag {
  display: flex; flex-wrap: wrap; gap: 0; margin: clamp(18px, 2.6vw, 30px) 0 0;
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: #8f8c85;
  animation: fade-up .8s var(--ease) .75s both;
}
.entry-tag span { padding: 8px 14px; border: 1px solid #2f2e2a; }
.entry-tag span + span { border-left: 0; color: #f4f2ec; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Panneau de connexion ---------- */
.entry-panel.panel {
  width: 100%; max-width: none; margin: 0;
  background: #fff; color: var(--text); border: 0;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: 10px 10px 0 var(--honey);
  animation: panel-in .9s var(--ease) .35s both;
}
@keyframes panel-in { from { opacity: 0; transform: translate(24px, 0); box-shadow: 0 0 0 var(--honey); } }
.entry-panel .tabs { margin: 0 0 22px; }
.entry-panel .panel-h { font-size: 1.6rem; margin-bottom: 20px; }
.entry-panel .btn-primary { justify-content: space-between; width: 100%; }

/* ---------- Bande de sites ---------- */
.browser {
  position: relative; background: var(--surface); border: 1px solid #000;
  overflow: hidden; container-type: inline-size;
}
.browser-bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 10px; border-bottom: 1px solid #000; background: var(--surface); }
.browser-bar .dots { display: flex; gap: 5px; flex: none; }
.browser-bar .dots i { width: 8px; height: 8px; background: var(--line-strong); }
.prompt {
  flex: 1; min-width: 0; height: 22px; display: flex; align-items: center; padding: 0 10px;
  background: var(--surface-2); font-family: var(--font-mono); font-size: .66rem;
  white-space: nowrap; overflow: hidden;
}
.prompt .label { color: var(--muted); }

.marquee {
  position: relative; z-index: 1; overflow: hidden;
  padding: 26px 0 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  animation: fade-up 1s var(--ease) 1s both;
}
.marquee-track {
  display: flex; gap: 22px; width: max-content;
  animation: slide 70s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(calc(-50% - 11px)); } }
.m-item {
  margin: 0; flex: none; width: clamp(240px, 24vw, 330px); aspect-ratio: 16 / 11;
  transition: transform .5s var(--ease);
}
.m-item:nth-child(odd) { transform: translateY(10px); }
.m-item:hover { transform: translateY(-6px); }
.m-item .browser { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.m-item .site-frame { position: relative; overflow: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .entry-main { grid-template-columns: 1fr; align-items: start; gap: 34px; padding-top: 40px; }
  .entry-title h1 { font-size: clamp(3.2rem, 17vw, 6rem); }
  .entry-panel.panel { box-shadow: 6px 6px 0 var(--honey); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
  .marquee { overflow-x: auto; }
}

/* ---------- Page 404 ---------- */
body.lost { grid-template-rows: 1fr; }
.lost-main {
  position: relative; z-index: 1; display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 48px var(--gutter); gap: 0;
}
.lost-brand {
  position: fixed; top: 24px; left: var(--gutter);
  font-family: var(--font-display); font-weight: 750; font-size: 1.2rem; letter-spacing: -.04em;
  color: #fff; text-decoration: none; display: inline-flex; align-items: center;
}
.lost-brand::before { content: ""; width: 16px; height: 16px; margin-right: 10px; background: var(--honey); box-shadow: inset 0 0 0 3px #121210, 0 0 0 1.5px var(--honey); }
.lost-code {
  font-size: clamp(8rem, 30vw, 20rem); line-height: .82; letter-spacing: -.07em;
  color: #fff; font-weight: 750; white-space: nowrap; display: flex; align-items: center; gap: .04em;
}
.lost-code .w { display: inline-block; overflow: hidden; padding-bottom: .06em; }
.lost-code .w > span { display: inline-block; animation: letter-up 1s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 150ms); }
/* le zéro est un carré miel qui tourne, comme le logo */
.lost-code .zero {
  width: .62em; height: .62em; margin: 0 .03em; vertical-align: middle;
  background: var(--honey); box-shadow: inset 0 0 0 .12em #121210, 0 0 0 .02em var(--honey);
  animation: letter-up 1s var(--ease) .24s both, mark-spin 6s linear 1.4s infinite;
}
.lost-main .entry-tag { justify-content: center; }
.lost-btn { margin-top: 28px; min-width: 220px; justify-content: space-between; animation: fade-up .8s var(--ease) .95s both; }
