/* ==========================================================================
   ARCADIUM — feuille de style
   Mise en page : un ciel de nuit en bandes de pixels (en-tête + accueil),
   puis des sections claires aux bords nets, façon interface Minecraft.
   ========================================================================== */

:root {
  /* Couleurs de la page */
  --bg: #eef5fd;
  --band: #dcebfc;
  --surface: #ffffff;
  --ink: #0c1f44;
  --ink-soft: #435980;
  --edge: #0c1f44;
  --shadow: #0c1f44;
  --link: #1558c0;
  --focus: #1c6fe3;

  /* Bouton principal (diamant) */
  --accent: #1c6fe3;
  --accent-hover: #2a7df0;
  --accent-hi: #5fa2f7;
  --accent-lo: #124a9c;
  --accent-ink: #ffffff;

  /* Bouton secondaire (pierre) */
  --stone: #c9d6ea;
  --stone-hover: #d7e2f2;
  --stone-hi: #eef4fc;
  --stone-lo: #8fa3c2;
  --stone-ink: #0c1f44;
  --btn-edge: #050d24;

  /* Ciel de l'accueil, du plus haut au plus bas */
  --sky-0: #050d24;
  --sky-1: #0a1a45;
  --sky-2: #0d2459;
  --sky-3: #112f70;
  --sky-4: #153b89;
  --sky-5: #1948a3;
  --sky-6: #1d56bd;
  --on-sky: #ffffff;
  --on-sky-soft: #cbdffc;

  /* Dé à vingt faces */
  --die-a: #b9dcff;
  --die-b: #7ab8fa;
  --die-c: #3f8ceb;
  --die-d: #1f62c9;
  --die-line: #0c1f44;
  --die-num: #0c1f44;
  --crit: #f2b33d;
  --crit-ink: #2b1b00;

  /* Typographie */
  --font-display: "Pixelify Sans", "Trebuchet MS", Verdana, sans-serif;
  --font-body: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081229;
    --band: #0b1a3a;
    --surface: #0f1e41;
    --ink: #e9f2ff;
    --ink-soft: #a6b9db;
    --edge: #3a5fa3;
    --shadow: #02060f;
    --link: #7db5ff;
    --focus: #7db5ff;
    --sky-0: #01040d;
    --sky-1: #030817;
    --sky-2: #060f29;
    --sky-3: #09173b;
    --sky-4: #0c1f4e;
    --sky-5: #102862;
    --sky-6: #143277;
    --die-line: #050d24;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #081229;
  --band: #0b1a3a;
  --surface: #0f1e41;
  --ink: #e9f2ff;
  --ink-soft: #a6b9db;
  --edge: #3a5fa3;
  --shadow: #02060f;
  --link: #7db5ff;
  --focus: #7db5ff;
  --sky-0: #01040d;
  --sky-1: #030817;
  --sky-2: #060f29;
  --sky-3: #09173b;
  --sky-4: #0c1f4e;
  --sky-5: #102862;
  --sky-6: #143277;
  --die-line: #050d24;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--link); }

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

.on-sky :focus-visible { outline-color: var(--on-sky); }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.55em 1.25em;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--btn-edge);
  border-radius: 0;
  box-shadow: inset 3px 3px 0 var(--accent-hi), inset -3px -3px 0 var(--accent-lo);
  cursor: pointer;
}

.btn:hover { background: var(--accent-hover); }

.btn:active {
  box-shadow: inset 3px 3px 0 var(--accent-lo), inset -3px -3px 0 var(--accent-hi);
}

.btn--stone {
  color: var(--stone-ink);
  background: var(--stone);
  box-shadow: inset 3px 3px 0 var(--stone-hi), inset -3px -3px 0 var(--stone-lo);
}

.btn--stone:hover { background: var(--stone-hover); }

.btn--stone:active {
  box-shadow: inset 3px 3px 0 var(--stone-lo), inset -3px -3px 0 var(--stone-hi);
}

.btn--small {
  min-height: 40px;
  font-size: 1rem;
  padding: 0.4em 0.9em;
}

/* ---------- En-tête ---------- */

.site-header {
  background: var(--sky-1);
  color: var(--on-sky);
  border-bottom: 2px solid var(--sky-0);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-sky);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand img { width: 36px; height: 36px; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.nav a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--on-sky-soft);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--on-sky);
  background: var(--sky-4);
}

@media (min-width: 700px) {
  .site-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
  }
}

/* ---------- Accueil ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--on-sky);
  background: linear-gradient(
    to bottom,
    var(--sky-1) 0 16.66%,
    var(--sky-2) 16.66% 33.33%,
    var(--sky-3) 33.33% 50%,
    var(--sky-4) 50% 66.66%,
    var(--sky-5) 66.66% 83.33%,
    var(--sky-6) 83.33% 100%
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(36px, 6vw, 72px) clamp(64px, 8vw, 104px);
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-sky-soft);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.02;
  text-shadow: 3px 3px 0 var(--sky-0);
}

.hero__lead {
  max-width: 34em;
  font-size: 1.15rem;
  color: var(--on-sky-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__logo {
  justify-self: center;
  width: 100%;
  max-width: 460px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Petites étoiles en croix, comme sur le logo */
.sparkles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  background: var(--on-sky-soft);
  clip-path: polygon(38% 0, 62% 0, 62% 38%, 100% 38%, 100% 62%, 62% 62%, 62% 100%, 38% 100%, 38% 62%, 0 62%, 0 38%, 38% 38%);
  opacity: 0.75;
  animation: twinkle 4s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.25; }
}

/* Relief en blocs entre le ciel et la suite de la page */
.terrain {
  position: relative;
  z-index: 1;
  height: 36px;
  margin-bottom: -1px;
  background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='36' shape-rendering='crispEdges'%3E%3Cpath d='M0 36V24H24V12H48V0H72V12H84V24H108V12H144V0H156V12H168V24H204V12H216V0H228V12H240V36Z'/%3E%3C/svg%3E") repeat-x left bottom / 240px 36px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='36' shape-rendering='crispEdges'%3E%3Cpath d='M0 36V24H24V12H48V0H72V12H84V24H108V12H144V0H156V12H168V24H204V12H216V0H228V12H240V36Z'/%3E%3C/svg%3E") repeat-x left bottom / 240px 36px;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 96px);
  scroll-margin-top: 64px;
}

.section--band {
  background: var(--band);
  border-block: 2px solid var(--edge);
}

.section h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }

.section__intro {
  max-width: 38em;
  margin-top: 16px;
  color: var(--ink-soft);
}

/* ---------- Présentation ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 36em;
}

.dice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--edge);
  box-shadow: 6px 6px 0 var(--shadow);
}

.dice h3 { font-size: 1.35rem; }

.die {
  display: block;
  width: 148px;
  max-width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.die svg { display: block; width: 100%; height: auto; overflow: visible; }

.die__face { stroke: var(--die-line); stroke-width: 2; stroke-linejoin: round; }
.die__face--a { fill: var(--die-a); }
.die__face--b { fill: var(--die-b); }
.die__face--c { fill: var(--die-c); }
.die__face--d { fill: var(--die-d); }

.die__num {
  fill: var(--die-num);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-anchor: middle;
}

.die.is-rolling svg { animation: roll 0.6s cubic-bezier(0.3, 0.7, 0.3, 1); }

@keyframes roll {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(0.86); }
  100% { transform: rotate(360deg) scale(1); }
}

.dice__result {
  min-height: 3.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.dice__result.is-crit span {
  padding: 2px 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--crit);
  color: var(--crit-ink);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(20px, 4vw, 48px);
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding: 0;
  list-style: none;
}

.pillars li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 2px solid var(--edge);
}

.pillars h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
}

.pillars h3::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  box-shadow: inset 3px 3px 0 var(--accent-hi), inset -3px -3px 0 var(--accent-lo);
}

.pillars p { color: var(--ink-soft); }

/* ---------- Réseaux ---------- */

.socials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.social {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 2px solid var(--edge);
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.social:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--shadow);
}

.social:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.social__name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.social__arrow { color: var(--link); font-family: var(--font-body); font-size: 1.25rem; }

.social__desc { color: var(--ink-soft); }

.social__handle {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--link);
  overflow-wrap: anywhere;
}

/* ---------- Pied de page ---------- */

.site-footer {
  background: var(--sky-1);
  color: var(--on-sky-soft);
  border-top: 2px solid var(--sky-0);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding-block: 28px;
}

.site-footer img { width: 112px; }

.site-footer__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 20em;
  min-width: 0;
  max-width: 40em;
}

.site-footer a { color: var(--on-sky); }

/* ---------- Petits écrans ---------- */

@media (max-width: 820px) {
  .hero__inner,
  .about { grid-template-columns: minmax(0, 1fr); }

  .hero__logo { order: -1; max-width: 300px; }

  .pillars,
  .socials { grid-template-columns: minmax(0, 1fr); }

  .dice { justify-self: start; width: 100%; max-width: 340px; }
}

@media (max-width: 820px) {
  /* Sur petit écran, on ne garde que les étoiles du haut, loin du texte */
  .sparkle:nth-child(even) { display: none; }
}

@media (max-width: 480px) {
  .nav a { padding: 6px 8px; font-size: 1rem; }
  .eyebrow { font-size: 0.875rem; letter-spacing: 0.08em; }
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- Moins d'animations si la personne le demande ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__logo,
  .sparkle,
  .die.is-rolling svg { animation: none; }
  .social { transition: none; }
}
