/* ==========================================================================
   MGXProduction — home.css (accueil)
   Style « standard », propre et moderne : l'accueil reste sobre,
   ce sont les cartes de projets qui apportent la couleur.
   ========================================================================== */

:root {
  --grid-line: rgba(154, 163, 181, .07);
  --halo-opacity: .5;
  --violet: #7c3aed;
}
:root[data-theme="light"] {
  --grid-line: rgba(14, 18, 26, .06);
  --halo-opacity: .3;
}

/* ---------- Textes communs ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.section-head { max-width: 680px; }
.section-title {
  margin-top: 10px;
  font-family: var(--font-head);
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -.03em;
}
.section-lead {
  margin-top: 16px;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--text-2);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: max(640px, 100svh);
  padding-block: calc(var(--header-h) + 56px) 120px;
  overflow: clip;
  text-align: center;
}
.hero__bg {
  position: absolute;
  inset: -12% 0;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}
.halo {
  position: absolute;
  width: 62vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--c) 0%, transparent 62%);
  opacity: var(--halo-opacity);
  will-change: transform;
  animation: halo-drift 24s ease-in-out infinite alternate;
}
.halo--1 { --c: var(--accent); top: -22%; left: -18%; }
.halo--2 { --c: var(--accent-2); top: 4%; right: -24%; width: 54vmax; animation-duration: 30s; animation-delay: -8s; }
.halo--3 { --c: var(--violet); bottom: -30%; left: 22%; width: 46vmax; animation-duration: 34s; animation-delay: -15s; opacity: calc(var(--halo-opacity) * .7); }
@keyframes halo-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vw, 5vh, 0) scale(1.08); }
  100% { transform: translate3d(-5vw, 8vh, 0) scale(.94); }
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 72% 58% at 50% 42%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 58% at 50% 42%, #000 25%, transparent 78%);
}
.hero__content { display: grid; justify-items: center; }
.hero__eyebrow {
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text-2);
  letter-spacing: .1em;
  font-size: .75rem;
}
.eyebrow__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 22%, transparent);
  animation: dot-pulse 2.6s ease-in-out infinite;
}
@keyframes dot-pulse { 50% { opacity: .45; } }
.hero__title {
  max-width: 14ch;
  margin-top: 28px;
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 7.4vw, 5.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--text) 72%, var(--accent-light)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  max-width: 44ch;
  margin-top: 24px;
  font-size: clamp(1.0625rem, 2vw, 1.3125rem);
  color: var(--text-2);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
}
.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--text-2), transparent);
  transform-origin: top;
  animation: scroll-line 2.4s var(--ease) infinite;
}
@keyframes scroll-line {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
@media (max-height: 640px) { .hero__scroll { display: none; } }

/* ---------- Projets ---------- */
.project-groups { display: grid; gap: 64px; margin-top: 56px; }
.project-group__head { display: flex; align-items: center; gap: 12px; }
.project-group__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-light);
}
.project-group__icon .icon { width: 20px; height: 20px; }
.project-group__title {
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.project-group__count {
  display: grid;
  place-items: center;
  min-width: 28px; height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: .8125rem;
  font-weight: 600;
}
.project-grid {
  display: grid;
  gap: 24px;
  margin-top: 22px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.project-item { display: flex; }

.project-card {
  --card-accent: #4d7cff;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--card-accent) 55%, var(--border));
  box-shadow:
    0 26px 60px -30px color-mix(in srgb, var(--card-accent) 75%, transparent),
    0 0 0 1px color-mix(in srgb, var(--card-accent) 30%, transparent);
}
.project-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-color: color-mix(in srgb, var(--card-accent) 55%, var(--border));
}
.project-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 24px;
}
.project-card__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.project-card__name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.project-card__tagline { color: var(--text-2); }
.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-weight: 600;
  color: var(--accent-light);
}
.project-card__arrow { display: inline-block; transition: transform .3s var(--ease-out); }
.project-card:hover .project-card__arrow { transform: translateX(5px); }

/* Badges de statut */
.badge--status { color: var(--text); }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, #9aa3b5); }
.badge--available { --dot: #22c55e; }
.badge--online { --dot: #2ee59d; }
.badge--coming-soon { --dot: #f5b041; }
.badge--in-development { --dot: #f97316; }

/* ---------- Couvertures ---------- */
.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #101218;
}

/* PMRS : capture du jeu, étoiles, bordure pixel au survol */
.cover--pmrs { background: #161122; }
.cover--pmrs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 47%;
  transition: transform .7s var(--ease-out);
}
.project-card:hover .cover--pmrs img { transform: scale(1.05); }
.cover--pmrs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(22, 17, 34, .1) 40%, rgba(22, 17, 34, .75));
}
.cover--pmrs::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 2;
  box-shadow: 0 -4px 0 0 #ffcc4d, 0 4px 0 0 #ffcc4d, -4px 0 0 0 #ffcc4d, 4px 0 0 0 #ffcc4d;
  opacity: 0;
  transition: opacity .3s steps(3, end);
}
.project-card--pmrs:hover .cover--pmrs::after,
.project-card--pmrs:focus-visible .cover--pmrs::after { opacity: 1; }
.cover__stars { position: absolute; inset: 0; z-index: 1; }
.cover__stars i {
  position: absolute;
  width: 4px; height: 4px;
  background: #ffde66;
  box-shadow: 0 0 0 1px #0e0a17;
  animation: px-twinkle 2.4s steps(3, end) infinite;
}
.cover__stars i:nth-child(3n) { width: 6px; height: 6px; background: #f5f1fc; }
@keyframes px-twinkle { 50% { opacity: .15; } }
.cover__chip {
  position: absolute;
  left: 16px; bottom: 16px;
  z-index: 3;
  padding: 2px 10px;
  font-family: "Pixelify Sans", var(--font-head);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: .06em;
  color: #0e0a17;
  background: #ffcc4d;
  box-shadow: 0 3px 0 0 #9e661a, 0 -2px 0 0 #ffd469 inset;
}
.project-card--pmrs .project-card__name {
  font-family: "Pixelify Sans", var(--font-head);
  font-size: 1.625rem;
  letter-spacing: .01em;
  color: #ffcc4d;
  text-shadow:
    2px 0 #0e0a17, -2px 0 #0e0a17, 0 2px #0e0a17, 0 -2px #0e0a17,
    2px 2px #0e0a17, -2px 2px #0e0a17, 2px -2px #0e0a17, -2px -2px #0e0a17;
}

/* Afterlight : nuit cendrée, brouillard, ville en ruine, lueur d'incendie, grain, REC */
.cover--afterlight { background: #0b0b0c; }
.al-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 72% 100%, rgba(224, 122, 46, .42), transparent 60%),
    linear-gradient(180deg, #1c1b1d 0%, #121214 55%, #0b0b0c 100%);
}
.al-glow {
  position: absolute;
  right: 8%;
  bottom: 14%;
  width: 55%;
  aspect-ratio: 2 / 1;
  background: radial-gradient(closest-side, rgba(229, 96, 40, .7), rgba(143, 42, 28, .25) 55%, transparent);
  animation: al-glow 5s ease-in-out infinite alternate;
}
@keyframes al-glow { from { opacity: .65; } to { opacity: 1; } }
.al-city {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 72%;
}
.al-city__far { fill: #26252a; }
.al-city__near { fill: #070708; }
.al-fog {
  position: absolute;
  left: -50%;
  bottom: 0;
  width: 200%;
  height: 55%;
  background:
    radial-gradient(40% 60% at 20% 80%, rgba(170, 160, 150, .22), transparent 70%),
    radial-gradient(35% 50% at 60% 90%, rgba(170, 160, 150, .18), transparent 70%),
    radial-gradient(30% 60% at 90% 70%, rgba(170, 160, 150, .16), transparent 70%);
  animation: al-fog 26s linear infinite alternate;
}
@keyframes al-fog { to { transform: translate3d(22%, 0, 0); } }
.al-grain {
  position: absolute;
  inset: -50%;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1s steps(5, end) infinite;
}
@keyframes grain-shift {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-6%, 4%, 0); }
  40% { transform: translate3d(5%, -7%, 0); }
  60% { transform: translate3d(-3%, 8%, 0); }
  80% { transform: translate3d(7%, 3%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.al-frame {
  position: absolute;
  inset: 10px;
  --c: rgba(214, 211, 204, .7);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 16px,
    linear-gradient(var(--c), var(--c)) top right / 16px 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 16px,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 16px,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 16px;
  background-repeat: no-repeat;
}
.al-rec {
  position: absolute;
  top: 18px; left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Oswald", var(--font-head);
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .18em;
  color: #f2efe9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.al-rec i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #e5322d;
  box-shadow: 0 0 8px rgba(229, 50, 45, .8);
  animation: rec-blink 2s ease-in-out infinite;
}
@keyframes rec-blink { 0%, 45% { opacity: 1; } 60%, 90% { opacity: .2; } 100% { opacity: 1; } }
.project-card--afterlight .project-card__name {
  font-family: "Oswald", var(--font-head);
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Vitalia : identité de l'appli (olive, sauge, or) + progression de l'année en direct */
.cover--vitalia {
  --vt-bg: #15140f;
  --vt-sage: #6fae8a;
  --vt-gold: #d8ae5c;
  --vt-ink: #eeeae0;
  --vt-ink-2: #b6b0a1;
  display: grid;
  place-items: center;
  background: var(--vt-bg);
}
:root[data-theme="light"] .cover--vitalia {
  --vt-bg: #f7f5f0;
  --vt-sage: #35594a;
  --vt-gold: #b08a2e;
  --vt-ink: #1d1c19;
  --vt-ink-2: #635f55;
}
.vt-orb-mini {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: vt-float 12s ease-in-out infinite alternate;
}
.vt-orb-mini--a { left: -18%; top: -40%; background: radial-gradient(circle, color-mix(in srgb, var(--vt-sage) 40%, transparent), transparent 66%); }
.vt-orb-mini--b { right: -16%; bottom: -46%; background: radial-gradient(circle, color-mix(in srgb, var(--vt-gold) 32%, transparent), transparent 66%); animation-duration: 15s; animation-delay: -5s; }
@keyframes vt-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8%, 10%, 0) scale(1.12); }
}
.vt-cover { position: relative; width: 46%; max-width: 180px; aspect-ratio: 1; }
.vt-cover-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.vt-cover-ring__track { fill: none; stroke: color-mix(in srgb, var(--vt-ink) 12%, transparent); stroke-width: 7; }
.vt-cover-ring__bar { fill: none; stroke: var(--vt-sage); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.vt-cover__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.vt-cover__pct {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.125rem, 2.6vw, 1.5rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--vt-ink);
}
.vt-cover__label {
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--vt-ink-2);
}
.vt-cover__word {
  position: absolute;
  left: 18px; top: 14px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .12em;
  color: var(--vt-gold);
}
.project-card--vitalia .project-card__name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.875rem;
  letter-spacing: 0;
}

/* Couverture générique (futurs projets sans visuel dédié) */
.cover--generic {
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 80% at 20% 0%, color-mix(in srgb, var(--card-accent) 45%, transparent), transparent 70%),
    linear-gradient(140deg, var(--surface-2), var(--surface));
}
.cover--generic img { width: 100%; height: 100%; object-fit: cover; }
.cover__initials {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 3rem;
  color: var(--card-accent);
}

/* Repli sans JavaScript */
.noscript-list { display: grid; gap: 8px; }
.noscript-list a { font-weight: 600; color: var(--accent-light); }

/* ---------- À propos ---------- */
.about__grid { display: grid; gap: 48px; }
@media (min-width: 920px) {
  .about__grid { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 80px; }
}
.about__text { margin-top: 20px; }
.about__text p { max-width: 56ch; font-size: 1.125rem; color: var(--text-2); }
.about__text p + p { margin-top: 12px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat dd {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--accent-light), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat dt { color: var(--text-2); font-size: .875rem; line-height: 1.35; }
.pillars { display: grid; gap: 14px; }
.pillar {
  display: flex;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.pillar__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #1b8fd6);
}
.pillar__icon .icon { width: 22px; height: 22px; }
.pillar__title { font-family: var(--font-head); font-size: 1.125rem; font-weight: 600; }
.pillar__text { margin-top: 4px; color: var(--text-2); }

/* ---------- Contact ---------- */
.contact__card {
  position: relative;
  display: grid;
  justify-items: center;
  max-width: 820px;
  margin-inline: auto;
  padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 56px);
  text-align: center;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}
.contact__card .section-lead { max-width: 46ch; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 18px; }
.contact__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-light);
  font-weight: 600;
  text-underline-offset: 4px;
}

/* ---------- Page 404 : « Ce niveau n'existe pas » ---------- */
.nf { min-height: max(560px, calc(100svh - 120px)); padding-bottom: 72px; }
.nf__code {
  display: flex;
  gap: .04em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(6rem, 24vw, 13rem);
  line-height: .9;
  letter-spacing: -.04em;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}
/* Le « 0 » est une tuile manquante qui clignote doucement, comme un niveau mal chargé */
.nf__zero {
  position: relative;
  animation: nf-glitch 3.2s steps(1, end) infinite;
}
@keyframes nf-glitch {
  0%, 82%, 100% { transform: none; opacity: 1; }
  84% { transform: translate3d(-.04em, 0, 0) skewX(-8deg); opacity: .55; }
  87% { transform: translate3d(.03em, 0, 0); opacity: .85; }
  90% { transform: none; opacity: 1; }
}
.nf__title { max-width: 16ch; font-size: clamp(2.25rem, 6vw, 4.25rem); margin-top: 22px; }
.nf__footer { margin-top: 0; padding-top: 0; border-top: 0; }
.nf__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nf__links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .nf__zero { animation: none !important; }
  .halo, .eyebrow__dot, .hero__scroll-line, .cover__stars i, .al-glow, .al-fog, .al-grain, .al-rec i, .vt-orb-mini {
    animation: none !important;
  }
}
