/* ==========================================================================
   CKZ Games — couleurs reprises de la page itch.io (orange, bleu-vert, doré)
   ========================================================================== */
@font-face {
  font-family: "Tiny5";
  src: url("assets/fonts/Tiny5.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --orange: #f29400;
  --orange-dark: #ea8c00;
  --orange-deep: #c96f00;
  --gold: #ebb052;
  --cream: #fff4e0;
  --teal: #008997;
  --teal-bright: #19c6d4;
  --teal-dark: #006d78;
  --brown: #594628;
  --brown-dark: #3b2c17;
  --navy: #141a33;
  --ink: #1b1208;
  --ink-soft: rgba(27, 18, 8, 0.78);
  --ink-muted: rgba(27, 18, 8, 0.55);
  --pixel: "Tiny5", "Segoe UI", system-ui, sans-serif;
  --text: Lato, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--orange); color: var(--ink); font: 17px/1.65 var(--text); -webkit-font-smoothing: antialiased; font-synthesis: none; }
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 3px; }

/* Rendu net pour tout le pixel art */
.mascot, .card img, .hero-sky { image-rendering: pixelated; }

/* ---------------------------------------------------------------- Barre du haut */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(59, 44, 23, 0.88); backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--brown-dark); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; }
.brand-logo { width: 40px; height: 40px; background: var(--navy); border-radius: 10px; padding: 2px; }
.brand-name { font: 700 22px/1 var(--pixel); letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: #f3e2c2; text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a.nav-itch { color: var(--orange); }

/* ---------------------------------------------------------------- Boutons pixel */
.btn { --c: var(--ink); --t: #fff; --s: var(--brown-dark);
  display: inline-flex; align-items: center; gap: 8px; font: 700 18px/1 var(--pixel); letter-spacing: .02em;
  color: var(--t); background: var(--c); text-decoration: none; padding: 15px 22px; position: relative;
  /* coins en escalier façon pixel */
  clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.35), inset 0 3px 0 rgba(255, 255, 255, 0.15);
  transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); transform: translateY(-2px); color: var(--t); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); }
.btn-primary { --c: var(--teal); }
.btn-ghost { --c: var(--cream); --t: var(--ink); }

/* ---------------------------------------------------------------- Accueil */
.hero { position: relative; overflow: hidden; background: #f39a4a; padding: 72px 0 120px; }
.hero-sky { position: absolute; inset: 0; background: url("assets/banner.png") center 30% / cover no-repeat; }
.hero-sky::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(242, 148, 0, 0) 50%, rgba(242, 148, 0, 0.85) 80%, var(--orange) 100%),
    linear-gradient(90deg, rgba(242, 148, 0, 0.92) 0%, rgba(242, 148, 0, 0.7) 45%, rgba(242, 148, 0, 0) 75%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; min-height: 440px; }
.tag { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; background: var(--brown-dark); color: var(--cream);
  font: 600 14px/1 var(--pixel); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 6px; }
.tag .dot { width: 8px; height: 8px; background: var(--teal-bright); box-shadow: 0 0 10px var(--teal-bright); animation: blink 1.6s steps(2) infinite; }
h1 { font: 700 clamp(56px, 9vw, 104px)/0.95 var(--pixel); margin: 0 0 22px; color: var(--ink);
  text-shadow: 4px 4px 0 var(--gold), 8px 8px 0 rgba(59, 44, 23, 0.25); }
.h1-small { display: block; font-size: clamp(22px, 3vw, 30px); font-weight: 600; margin-bottom: 10px; text-shadow: none; color: var(--brown-dark); }
.caret { color: var(--teal); animation: blink 1s steps(2) infinite; text-shadow: none; }
.lead { font-size: 20px; color: var(--ink-soft); max-width: 31em; margin: 0 0 30px; }
.lead strong { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-art { position: relative; display: grid; justify-items: center; align-self: end; }
.mascot { width: min(320px, 70vw); height: auto; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(59, 44, 23, 0.25)); position: relative; z-index: 2; }
.platform { width: min(260px, 56vw); height: 26px; margin-top: -26px; background: var(--brown-dark);
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% 100%, 0 100%);
  box-shadow: inset 0 6px 0 #6b5230; }
.bubble { position: absolute; top: 4%; right: 2%; z-index: 3; background: var(--cream); color: var(--ink); font: 700 18px/1 var(--pixel);
  padding: 12px 14px; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); animation: pop 4s ease-in-out infinite; }
.bubble::after { content: ""; position: absolute; left: 18px; bottom: -12px; width: 12px; height: 12px; background: var(--cream);
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: skewX(-30deg); }

/* Bord inférieur en escalier pixel */
.pixel-edge { position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 24px, transparent 24px 48px); opacity: .7; }

/* ---------------------------------------------------------------- Sections */
.section { padding: 88px 0; position: relative; }
.section-alt { background: var(--orange-dark); border-top: 3px solid var(--gold); border-bottom: 3px solid var(--gold); }
.eyebrow { font: 600 15px/1 var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dark); margin: 0 0 12px; }
h2 { font: 700 clamp(30px, 4.4vw, 46px)/1.1 var(--pixel); margin: 0 0 36px; max-width: 18em; }
.section-lead { color: var(--ink-soft); margin: -18px 0 32px; max-width: 36em; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--cream); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--brown-dark); padding: 26px 24px 24px;
  transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--brown-dark); }
.card img { width: 80px; height: 80px; margin: -6px 0 12px -6px; }
.card h3 { font: 700 24px/1.15 var(--pixel); margin: 0 0 8px; color: var(--teal-dark); }
.card p { margin: 0; color: var(--ink-soft); }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.slot { aspect-ratio: 315 / 250; border-radius: 150px; background: repeating-linear-gradient(45deg, rgba(59,44,23,.08) 0 12px, transparent 12px 24px), var(--orange);
  border: 3px dashed var(--brown); display: grid; place-items: center; align-content: center; gap: 4px; }
.slot-q { font: 700 64px/1 var(--pixel); color: var(--brown); animation: bob 3s ease-in-out infinite; }
.slot:nth-child(2) .slot-q { animation-delay: .4s; }
.slot:nth-child(3) .slot-q { animation-delay: .8s; }
.slot-label { font: 600 16px/1 var(--pixel); letter-spacing: .1em; text-transform: uppercase; color: var(--brown); }

/* ---------------------------------------------------------------- Launcher */
.launcher { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink-soft); }
.steps strong { color: var(--ink); }
.step-n { flex: none; width: 38px; height: 38px; display: grid; place-items: center; background: var(--ink); color: var(--orange);
  font: 700 20px/1 var(--pixel); box-shadow: 3px 3px 0 var(--brown-dark); }
.note { font-size: 14px; color: var(--ink-muted); max-width: 32em; margin: 18px 0 0; }

.window { background: #0f1117; border: 3px solid var(--ink); box-shadow: 10px 10px 0 var(--brown-dark); max-width: 440px; margin: 0 auto; transform: rotate(1.5deg); }
.window-bar { display: flex; gap: 6px; padding: 10px 12px; background: #171a23; border-bottom: 2px solid #2a2f40; }
.window-bar span { width: 10px; height: 10px; background: #2a2f40; }
.window-bar span:first-child { background: var(--orange); }
.window-body { padding: 34px 28px 30px; display: grid; justify-items: center; gap: 14px; background:
  radial-gradient(circle at 50% 30%, rgba(0, 137, 151, 0.25), transparent 60%), #0f1117; }
.window-body img { width: 112px; height: 112px; animation: bob 2.6s ease-in-out infinite; }
.window-title { font: 700 26px/1 var(--pixel); color: #e7e9ef; }
.window-btn { font: 700 18px/1 var(--pixel); color: #fff; background: #2fae7a; padding: 12px 48px; border-radius: 8px; }
.window-progress { width: 80%; height: 8px; background: #1e2230; border-radius: 99px; overflow: hidden; }
.window-progress div { height: 100%; width: 40%; background: #6c8cff; animation: load 3.2s ease-in-out infinite; }

/* ---------------------------------------------------------------- Pied de page */
.footer { position: relative; background: var(--brown-dark); color: #e9d8b8; margin-top: 40px; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px;
  background: repeating-linear-gradient(90deg, var(--brown-dark) 0 32px, transparent 32px 64px); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 36px; padding-bottom: 36px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 48px; height: 48px; background: var(--navy); border-radius: 10px; padding: 2px; }
.footer-brand strong { display: block; font: 700 20px/1.1 var(--pixel); color: var(--cream); }
.footer-brand span { font-size: 14px; opacity: .75; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--orange); font-weight: 700; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.copy { margin: 0; font-size: 14px; opacity: .7; width: 100%; }

/* ---------------------------------------------------------------- Animations */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes load { 0% { width: 5%; } 70% { width: 100%; } 100% { width: 100%; } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.cards .card:nth-child(2), .slots .slot:nth-child(2) { transition-delay: .1s; }
.cards .card:nth-child(3), .slots .slot:nth-child(3) { transition-delay: .2s; }

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

/* ---------------------------------------------------------------- Tablette / téléphone */
@media (max-width: 900px) {
  .hero-inner, .launcher { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 96px; }
  .hero-sky::after { background: linear-gradient(180deg, rgba(242, 148, 0, 0.35) 0%, rgba(242, 148, 0, 0.85) 45%, rgba(242, 148, 0, 0.95) 100%); }
  .hero-art { order: -1; }
  .mascot { width: 200px; }
  .platform { width: 170px; }
  .bubble { right: 50%; transform-origin: center; margin-right: -190px; font-size: 15px; }
  .cards, .slots { grid-template-columns: 1fr; }
  .slots { max-width: 360px; }
  .launcher-art { order: -1; }
  .section { padding: 64px 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav a:not(.nav-itch) { display: none; }
  .brand-name { font-size: 19px; }
  .lead { font-size: 18px; }
  .bubble { display: none; }
  .window { transform: none; }
}
