/* Vilaincastle — site vitrine. Palette tirée du jeu : roche violette, cristal améthyste, titre doré. */

:root {
  color-scheme: dark;
  --bg: #120e1a;
  --bg-2: #181224;
  --panel: #211a33;
  --panel-2: #2a2142;
  --line: #3b2f5c;
  --purple: #7b5cb8;
  --purple-hi: #a98cf0;
  --glow: #b46bff;
  --gold: #ffcc33;
  --gold-deep: #6b4a00;
  --red: #e0584a;
  --text: #ece6f7;
  --muted: #a99dc6;
  --shadow: #07040d;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--purple-hi); }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; }
.section { padding: clamp(56px, 9vw, 110px) 16px; }
.section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 .6rem;
  color: var(--gold);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: .01em;
}
h3 { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.lead { max-width: 62ch; color: var(--muted); font-size: 1.15rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  background: rgba(18, 14, 26, .82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--gold-deep);
}
.nav ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 22px; }
.nav li a { color: var(--text); font-size: .95rem; text-decoration: none; opacity: .85; }
.nav li a:hover { opacity: 1; color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(100svh, 900px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px 16px 90px;
}
.hero-img {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(18, 14, 26, .2) 0%, rgba(18, 14, 26, .78) 72%),
    linear-gradient(to bottom, rgba(18, 14, 26, .6), rgba(18, 14, 26, 0) 35%, var(--bg) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: -1;
  width: min(760px, 90vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(180, 107, 255, .28), transparent 62%);
  animation: pulse 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { opacity: .65; transform: translate(-50%, -50%) scale(.96); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.04); }
}
.badge {
  display: inline-block;
  margin-bottom: 1.4rem;
  padding: .35rem .9rem;
  background: rgba(33, 26, 51, .85);
  border: 1px solid var(--purple);
  color: var(--purple-hi);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.title {
  margin: 0;
  color: var(--gold);
  font-size: clamp(2.5rem, 10.5vw, 7rem);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 4px 0 var(--gold-deep), 0 9px 0 rgba(0, 0, 0, .5);
}
.tagline {
  margin: 1.4rem auto .6rem;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 700;
}
.sub { max-width: 54ch; margin: 0 auto 2.2rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

.btn {
  display: inline-block;
  padding: .85rem 1.5rem;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { color: #fff; background: var(--panel-2); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn.primary { background: var(--purple); border-color: var(--purple-hi); color: #fff; }
.btn.primary:hover { background: #8d6dd0; }

/* ---------- Piliers ---------- */
.pillars {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 20px;
}
.pillar {
  padding: 1.4rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--purple);
  box-shadow: 4px 4px 0 var(--shadow);
}
.pillar .n { display: block; margin-bottom: .4rem; color: var(--gold); font-size: .85rem; font-weight: 800; letter-spacing: .2em; }
.pillar p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- Fonctionnalités ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
  margin-top: clamp(48px, 7vw, 92px);
}
.feature:nth-of-type(even) .shot { order: 2; }
.shot {
  margin: 0;
  background: #000;
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
}
.shot img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.feature h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.feature p { margin: 0 0 1rem; color: var(--muted); }
.ticks { margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 1.5rem; margin-bottom: .45rem; }
.ticks li::before { content: "◆"; position: absolute; left: 0; color: var(--purple-hi); font-size: .8rem; top: .25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.chips li {
  padding: .25rem .7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: .85rem;
  font-weight: 600;
}

/* ---------- Camps ---------- */
.camps { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.camp {
  padding: 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--purple);
  box-shadow: 6px 6px 0 var(--shadow);
}
.camp.foe { border-top-color: var(--red); }
.camp h3 { margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.camp dl { margin: 0; }
.camp dt { margin-top: .85rem; font-weight: 800; }
.camp.foe dt { color: #ffb3a8; }
.camp dt:first-child { margin-top: 0; }
.camp dd { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- Chiffres ---------- */
.facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  text-align: center;
}
.facts li { padding: 1.2rem .5rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 4px 4px 0 var(--shadow); }
.facts b { display: block; color: var(--gold); font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.1; text-shadow: 3px 3px 0 var(--gold-deep); }
.facts span { color: var(--muted); font-size: .92rem; }
.comfort { margin: 2rem auto 0; max-width: 70ch; text-align: center; color: var(--muted); font-size: .98rem; }

/* ---------- Galerie ---------- */
.gallery { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile {
  position: relative;
  padding: 0;
  border: 3px solid var(--line);
  background: #000;
  box-shadow: 5px 5px 0 var(--shadow);
  cursor: zoom-in;
  overflow: hidden;
  transition: transform .12s, border-color .12s;
}
.tile:first-child { grid-column: span 2; }
.tile:hover { transform: translate(-2px, -2px); border-color: var(--purple-hi); }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; image-rendering: pixelated; }
.tile:first-child img { aspect-ratio: 8 / 3; }
.tile span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem .9rem .7rem;
  background: linear-gradient(to top, rgba(7, 4, 13, .92), transparent);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
}

/* ---------- Saisons ---------- */
.seasons { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.season { position: relative; margin: 0; border: 3px solid var(--line); box-shadow: 5px 5px 0 var(--shadow); background: #000; }
.season img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; image-rendering: pixelated; }
.season figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: .3rem .9rem;
  background: var(--panel);
  border-top: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  color: var(--gold);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- Statut ---------- */
.status { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.status .box { padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 5px 5px 0 var(--shadow); }
.status h3 { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: 1.05rem; }

/* ---------- Pied de page ---------- */
footer { padding: 40px 16px 56px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .92rem; }
footer .logo { display: inline-block; margin-bottom: .6rem; font-size: 1.1rem; }
footer p { margin: .2rem 0; }

/* ---------- Visionneuse ---------- */
dialog#lightbox {
  width: min(96vw, 1200px);
  max-height: 96vh;
  padding: 0;
  border: 3px solid var(--purple);
  background: #05030a;
  color: var(--text);
  box-shadow: 0 0 0 9999px rgba(5, 3, 10, .88);
  overflow: visible;
}
dialog#lightbox::backdrop { background: transparent; }
#lightbox figure { margin: 0; }
#lightbox img { display: block; width: 100%; max-height: 82vh; object-fit: contain; image-rendering: pixelated; background: #000; }
#lightbox figcaption { padding: .8rem 1rem; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; }
#lightbox figcaption small { color: var(--muted); font-weight: 400; white-space: nowrap; }
.lb-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--purple-hi);
  background: var(--panel);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
}
.lb-btn:hover { background: var(--purple); }
.lb-close { top: -20px; right: -20px; }
.lb-prev  { top: 40%; left: -24px; }
.lb-next  { top: 40%; right: -24px; }

/* ---------- Apparition au défilement ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Adaptation ---------- */
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature .shot, .feature:nth-of-type(even) .shot { order: 0; }
  .camps, .status { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .seasons { grid-template-columns: repeat(2, 1fr); }
  .tile:first-child img { aspect-ratio: 8 / 3; }
  .lb-close { top: 8px; right: 8px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (max-width: 620px) {
  .nav ul { display: none; }
  .nav-in { justify-content: center; }
  .gallery { grid-template-columns: 1fr; }
  .tile:first-child { grid-column: auto; }
  .tile:first-child img { aspect-ratio: 4 / 3; }
  .cta .btn { width: 100%; text-align: center; }
  .badge { font-size: .7rem; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::after { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .tile { transition: none; }
}
