:root {
  --black: #0b0b0b;
  --white: #ffffff;
  --red: #d50f2b;
  --red-dark: #a80b21;
  --grey: #8a8a8a;
  --line: #e4e4e4;
  --font: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.intro-running { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .4em; font-weight: 500; letter-spacing: -.01em; }
b { font-weight: 900; font-style: italic; letter-spacing: -.01em; }
#app { outline: none; }

/* ---------- Petit logo empilé ---------- */
.mini-logo {
  font-weight: 800; font-size: 17px; line-height: .82; letter-spacing: -.03em;
  color: var(--white); text-decoration: none; display: inline-block;
}
.mini-logo span { color: var(--red); }
.hand { font-family: var(--hand); color: var(--white); font-size: 22px; letter-spacing: .04em; }

/* ---------- INTRO ---------- */
.intro {
  position: fixed; inset: 0; z-index: 1000; background: var(--black);
  transition: opacity .6s ease;
}
.intro.out { opacity: 0; pointer-events: none; }
.intro > .mini-logo { position: absolute; top: 22px; left: 28px; }
.intro > .hand { position: absolute; top: 18px; right: 30px; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-word, .intro-logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-weight: 800; font-size: clamp(20px, 2.6vw, 34px); color: var(--white); white-space: nowrap;
}
.intro-word { letter-spacing: .02em; }
.intro-word .w { color: var(--white); }
.intro-word .r { color: var(--red); }
.intro-word .w:nth-child(4) { margin-right: .35em; }
.intro-logo { letter-spacing: -.03em; opacity: 0; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.9,.3,1.2); transform: translate(-50%, -50%) scale(.9); }
.intro-logo span { color: var(--red); }
.intro-logo.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.intro-skip {
  position: absolute; bottom: 24px; right: 28px; background: none; border: 0;
  color: var(--grey); font: 500 14px var(--font); cursor: pointer;
}
.intro-skip:hover { color: var(--white); }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 16px 28px; background: var(--black); color: var(--white);
}
.topnav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.topnav a { text-decoration: none; color: #cfcfcf; }
.topnav a:hover, .topnav a.active { color: var(--white); }
.topnav a.active { font-weight: 800; font-style: italic; }
.search { position: relative; width: 210px; }
.search input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid #555;
  color: var(--white); font: 15px var(--font); padding: 6px 0; outline: none;
}
.search input:focus { border-bottom-color: var(--red); }
.search input::placeholder { color: #8a8a8a; }
.search-results {
  position: absolute; top: calc(100% + 10px); right: 0; width: 280px;
  list-style: none; margin: 0; padding: 6px 0;
  background: var(--white); color: var(--black); box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.search-results a { display: block; padding: 8px 16px; text-decoration: none; font-size: 15px; }
.search-results a:hover, .search-results a.active { background: var(--black); color: var(--white); }
.search-results .empty { padding: 8px 16px; color: var(--grey); font-size: 15px; }
.site-icon { flex: none; display: block; width: 46px; height: 46px; border-radius: 50%; transition: transform .25s; }
.site-icon img { width: 100%; height: 100%; }
.site-icon:hover { transform: rotate(-12deg) scale(1.12); }

/* ---------- Accueil : bannière ---------- */
.banner { background: var(--red); line-height: 0; }
.banner img { width: 100%; height: auto; max-height: calc(100vh - 78px); object-fit: cover; }

/* ---------- Wiki ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 64px 28px 96px; }
.home-intro { max-width: 820px; margin-bottom: 56px; }
.home-intro h1, .page-title { font-size: clamp(38px, 5.2vw, 72px); }
.lead { font-size: 21px; color: #333; }
.breadcrumb { font-size: 14px; color: var(--grey); margin-bottom: 18px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.section-title {
  font-size: 28px; font-weight: 800; margin: 72px 0 24px;
  padding-top: 18px; border-top: 1px solid var(--black);
}
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.link-arrow { color: var(--red); font-weight: 700; font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font); }

.grid { display: grid; gap: 40px 28px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { text-decoration: none; display: flex; flex-direction: column; gap: 4px; position: relative; }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: #f1f1f1; margin-bottom: 12px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .4s, transform .6s; }
.card:hover .card-img img { filter: none; transform: scale(1.04); }
.card-meta { font-size: 13px; color: var(--grey); }
.card h3 { font-size: 23px; font-weight: 700; margin: 0; }
.card p { margin: 0; font-size: 16px; color: #444; }
.card .arrow { color: var(--red); font-size: 22px; transition: transform .2s; }
.card:hover .arrow { transform: translateX(6px); }
.card:hover h3 { color: var(--red); }

.card-mystery .card-img { background: var(--black); display: grid; place-items: center; }
.card-mystery .card-img span { color: var(--red); font-size: 120px; font-weight: 900; font-style: italic; animation: pulse 2.4s ease-in-out infinite; }
.card-mystery h3 em { color: var(--red); font-style: italic; font-weight: 900; }
@keyframes pulse { 50% { transform: scale(1.12) rotate(-6deg); } }

.feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; text-decoration: none; }
.feature-img { aspect-ratio: 16 / 10; overflow: hidden; }
.feature-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.feature:hover .feature-img img { transform: scale(1.04); }
.feature h3 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 800; margin: 8px 0 12px; }
.feature p { color: #444; }

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: 32px 0 40px; }
.tabs a { text-decoration: none; padding: 10px 0; font-size: 17px; color: var(--grey); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--black); }
.tabs a.active { color: var(--black); font-weight: 800; border-bottom-color: var(--red); }

/* ---------- Bloc Daniel ---------- */
.daniel-quote {
  display: grid; grid-template-columns: 130px 1fr; gap: 32px; align-items: center;
  background: var(--black); color: var(--white); padding: 36px 40px; margin: 56px 0;
}
.daniel-face {
  width: 130px; height: 130px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--red); transform: rotate(-4deg);
}
.daniel-quote p { font-size: clamp(19px, 2vw, 24px); line-height: 1.35; margin: 8px 0 10px; }
.daniel-quote .sig { color: var(--grey); font-size: 14px; }

/* ---------- Article ---------- */
.nickname { font-size: 22px; font-weight: 800; font-style: italic; color: var(--red); margin: 0 0 40px; }
.article-grid { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: start; }
.article-body h2 { font-size: 30px; font-weight: 800; margin: 44px 0 12px; }
.article-body p { margin: 0 0 16px; }
.article-body .daniel-quote { margin: 40px 0; }
.infobox { border-top: 4px solid var(--black); position: sticky; top: 96px; }
.infobox figure { margin: 0; }
.infobox figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.infobox figcaption { font-size: 12px; color: var(--grey); padding: 8px 0; line-height: 1.4; }
.infobox dl { display: grid; grid-template-columns: 110px 1fr; margin: 8px 0 0; font-size: 15px; }
.infobox dt, .infobox dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.infobox dt { color: var(--grey); }
.infobox dd { font-weight: 500; }

.btn {
  display: inline-block; text-decoration: none; font: 800 16px var(--font);
  background: var(--red); color: var(--white); padding: 14px 26px; border-radius: 999px;
  transition: background .2s;
}
.btn:hover { background: var(--black); }

/* ---------- Easter egg : Danielosaurus ---------- */
.egg-hero {
  position: relative; overflow: hidden; background: var(--black); color: var(--white);
  min-height: calc(88vh - 66px); padding: 10vh 8vw 18vh;
  display: flex; flex-direction: column; justify-content: center;
}
.egg-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.egg-badge {
  position: relative; align-self: flex-start; background: var(--red); color: var(--white);
  font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px;
  animation: pop .5s .2s both cubic-bezier(.2,.9,.3,1.4);
}
.egg-title {
  position: relative; font-size: clamp(38px, 13vw, 190px); font-weight: 900; font-style: italic;
  letter-spacing: -.04em; line-height: .9; margin: 24px 0 12px;
  animation: rise .8s .1s both cubic-bezier(.2,.9,.3,1);
}
.egg-title span { color: var(--red); }
.egg-sub { position: relative; font-size: clamp(20px, 2.4vw, 30px); margin: 0; color: #ccc; }
.egg-sub b { color: var(--white); }
@keyframes pop { from { transform: scale(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(60px) skewY(4deg); } }

.pixel-frame {
  margin: 0; padding: 0; position: relative;
  box-shadow: 8px 8px 0 var(--red), 16px 16px 0 var(--black);
}
.pixel-frame img { aspect-ratio: 3 / 4 !important; }
.egg-infobox { border-top: 0; }
.egg-infobox dl { margin-top: 32px; }
.status { display: inline-block; background: var(--red); color: var(--white); font-weight: 800; font-style: italic; padding: 2px 12px; margin-right: 8px; }

.egg-gallery { columns: 4 220px; column-gap: 20px; }
.egg-gallery figure { break-inside: avoid; margin: 0 0 20px; position: relative; }
.egg-gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .3s; }
.egg-gallery figure:nth-child(odd) img { transform: rotate(-1.5deg); }
.egg-gallery figure:nth-child(even) img { transform: rotate(1.5deg); }
.egg-gallery figure:hover img { transform: scale(1.03) rotate(0); }
.egg-gallery figcaption { font-size: 14px; color: #444; padding-top: 10px; }
.egg-gallery figcaption b { display: block; color: var(--red); font-size: 13px; }

.egg-cta { background: var(--red); color: var(--white); padding: 14vh 8vw; }
.egg-cta p { font-size: clamp(34px, 5vw, 72px); line-height: 1.1; margin: 0 0 40px; }
.egg-cta .btn { background: var(--white); color: var(--black); }
.egg-cta .btn:hover { background: var(--black); color: var(--white); }

/* ---------- Footer + œuf ---------- */
.footer { background: var(--black); color: #9a9a9a; font-size: 14px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 28px; display: flex; align-items: center; gap: 32px; }
.footer p { margin: 0; flex: 1; }
.egg {
  width: 30px; height: 38px; border: 0; cursor: pointer; padding: 0;
  background:
    radial-gradient(circle at 35% 40%, var(--red) 3px, transparent 4px),
    radial-gradient(circle at 65% 65%, var(--red) 3px, transparent 4px),
    radial-gradient(circle at 60% 25%, var(--red) 2px, transparent 3px),
    #f3efe6;
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  animation: eggwiggle 5s ease-in-out infinite;
}
.egg.hatch { animation: hatch .7s ease-in forwards; }
@keyframes eggwiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 94% { transform: rotate(12deg); } 97% { transform: rotate(-6deg); } }
@keyframes hatch { 30% { transform: scale(1.3) rotate(-20deg); } 60% { transform: scale(1.3) rotate(20deg); } 100% { transform: scale(0); opacity: 0; } }

/* ---------- Daniel flottant ---------- */
.daniel-float { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.daniel-float-btn {
  width: 74px; height: 74px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer;
  border: 4px solid var(--red); background: var(--black); box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transition: transform .2s;
}
.daniel-float-btn:hover { transform: scale(1.08) rotate(-6deg); }
.daniel-float-btn img { width: 100%; height: 100%; object-fit: cover; }

/* Bulle « Daniel dit » en pixel art, avec un T-rex qui marche dessus */
.dino-say { position: relative; width: min(340px, calc(100vw - 44px)); --px: 5px; }
.dino-say canvas { position: absolute; left: 0; bottom: calc(100% + var(--px)); width: 100%; height: 100px; pointer-events: none; }
.say-box {
  position: relative; background: var(--black); color: var(--white);
  font-family: "Pixelify Sans", monospace; padding: 16px 18px 14px;
  box-shadow:
    var(--px) 0 0 0 var(--red), calc(-1 * var(--px)) 0 0 0 var(--red),
    0 var(--px) 0 0 var(--red), 0 calc(-1 * var(--px)) 0 0 var(--red),
    calc(2 * var(--px)) calc(3 * var(--px)) 0 0 rgba(0,0,0,.25);
  animation: pixelin .45s steps(6) both;
}
/* petite queue en escalier vers le bouton Daniel */
.say-box::after {
  content: ""; position: absolute; right: 30px; top: 100%; width: var(--px); height: var(--px);
  background: var(--red);
  box-shadow: 0 var(--px) 0 var(--red), var(--px) var(--px) 0 var(--red),
    var(--px) calc(2 * var(--px)) 0 var(--red), calc(2 * var(--px)) calc(2 * var(--px)) 0 var(--red),
    calc(2 * var(--px)) calc(3 * var(--px)) 0 var(--red);
}
.say-head { color: var(--red); font-weight: 700; font-size: 15px; letter-spacing: .08em; }
.say-box p { font-size: 17px; line-height: 1.35; margin: 8px 0 12px; min-height: 4.1em; }
.say-box p::after { content: "█"; color: var(--red); animation: blink .7s steps(1) infinite; margin-left: 2px; }
.say-next, .say-close {
  font-family: "Pixelify Sans", monospace; cursor: pointer; border: 0;
}
.say-next { background: var(--red); color: var(--white); font-size: 14px; font-weight: 700; padding: 6px 12px; }
.say-next:hover { background: var(--white); color: var(--black); }
.say-next:disabled { opacity: .5; cursor: wait; }
.say-close { position: absolute; top: 8px; right: 10px; background: none; color: var(--grey); font-size: 18px; }
.say-close:hover { color: var(--red); }
.dino-say.leaving .say-box { animation: pixelout .35s steps(5) both; }
.daniel-float-btn.stomp { animation: stomp .35s steps(3); }
@keyframes pixelin { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 -20px -40px -20px); } }
@keyframes pixelout { from { clip-path: inset(0 -20px -40px -20px); } to { clip-path: inset(0 0 100% 0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes stomp { 33% { transform: translateY(-10px) rotate(-8deg); } 66% { transform: translateY(2px) rotate(4deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .article-grid { grid-template-columns: 1fr; gap: 24px; }
  .infobox { position: static; order: -1; }
  .feature { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; }
  .topnav { gap: 12px; font-size: 14px; }
  .search { width: 100%; order: 3; }
  .site-icon { width: 36px; height: 36px; }
  .search-results { left: 0; right: auto; width: 100%; }
  .wrap { padding: 40px 16px 80px; }
  .daniel-quote { grid-template-columns: 1fr; gap: 14px; padding: 24px 20px; margin: 40px 0; }
  .daniel-face { width: 72px; height: 72px; }
  .egg-hero { min-height: 70vh; padding: 8vh 16px 16vh; }
  .egg-title { font-size: 14vw; }
  .egg-cta { padding: 10vh 16px; }
  .intro > .mini-logo { left: 16px; }
  .intro > .hand { right: 16px; }
  .footer-inner { padding: 32px 16px; gap: 20px; }
  .daniel-float { right: 14px; bottom: 14px; }
  .daniel-float-btn { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
