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

:root {
  color-scheme: dark;
  --color-bg: #050505;
  --color-bg-alt: #0c0c0c;
  --color-bg-card: #0a0a0a;
  --color-text: #ebebeb;
  --color-text-muted: #555555;
  --color-accent: #c0c0c0;
  --color-accent-bright: #ffffff;
  --color-border: #1a1a1a;
  --color-glow: rgba(255, 255, 255, 0.04);
  --particle-rgb: 255, 255, 255;
  --selection-bg: rgba(255,255,255,0.12);
  --selection-fg: #fff;
  --font-primary: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.loading {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

address { font-style: normal; }

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

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(10) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(12%, 9%); }
  70% { transform: translate(9%, 4%); }
  90% { transform: translate(-1%, 7%); }
}

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loader__bar {
  width: 120px;
  height: 1px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.loader__bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--color-text);
  animation: loaderFill 1.8s var(--ease-out-expo) forwards;
}

@keyframes loaderFill {
  to { width: 100%; }
}

.loader__text {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  letter-spacing: 0.5em;
  color: var(--color-text-muted);
  animation: loaderPulse 1s ease infinite alternate;
}

@keyframes loaderPulse {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.reveal-up {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 1s var(--ease-out-expo),
              transform 1s var(--ease-out-expo);
}

.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up:nth-child(2) { transition-delay: 0.08s; }
.reveal-up:nth-child(3) { transition-delay: 0.16s; }
.reveal-up:nth-child(4) { transition-delay: 0.24s; }
.reveal-up:nth-child(5) { transition-delay: 0.32s; }
.reveal-up:nth-child(6) { transition-delay: 0.40s; }

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem 2.5rem;
  z-index: 1000;
  mix-blend-mode: difference;
  transition: transform 0.5s var(--ease-out-expo);
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav__logo {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: #fff;
  transition: opacity 0.3s ease;
}

.nav__logo:hover { opacity: 0.5; }

.nav__time {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav__menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  z-index: 1001;
}

.nav__menu-btn span {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--color-text);
  transition: transform 0.5s var(--ease-out-expo),
              width 0.5s var(--ease-out-expo),
              background-color 0.45s var(--ease-in-out);
  transform-origin: center;
}

.nav__menu-btn span:last-child {
  width: 20px;
  margin-left: auto;
}

.nav__menu-btn:hover span:last-child { width: 32px; }

.nav__menu-btn.active span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav__menu-btn.active span:last-child {
  width: 32px;
  transform: translateY(-4px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  clip-path: circle(0% at calc(100% - 3.5rem) 2.5rem);
  transition: clip-path 0.8s var(--ease-out-expo);
  pointer-events: none;
}

.menu-overlay.active {
  clip-path: circle(150% at calc(100% - 3.5rem) 2.5rem);
  pointer-events: all;
}

.menu-overlay__content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.menu-overlay__link {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  font-family: var(--font-primary);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text);
  padding: 0.3rem 0;
  opacity: 0;
  transform: translateY(60px) rotate(3deg);
  transition: opacity 0.5s ease,
              transform 0.6s var(--ease-out-expo),
              color 0.3s ease;
}

.menu-overlay.active .menu-overlay__link {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

.menu-overlay.active .menu-overlay__link:nth-child(1) { transition-delay: 0.15s; }
.menu-overlay.active .menu-overlay__link:nth-child(2) { transition-delay: 0.22s; }
.menu-overlay.active .menu-overlay__link:nth-child(3) { transition-delay: 0.29s; }
.menu-overlay.active .menu-overlay__link:nth-child(4) { transition-delay: 0.36s; }
.menu-overlay.active .menu-overlay__link:nth-child(5) { transition-delay: 0.43s; }

.menu-overlay__link:hover { color: var(--color-text-muted); }

.menu-overlay__link-num {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  vertical-align: super;
}

.menu-overlay__footer {
  position: absolute;
  bottom: 3rem;
  display: flex;
  gap: 2.5rem;
}

.menu-overlay__footer a {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

.menu-overlay__footer a:hover { color: var(--color-text); }

.hero {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero__content {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
  width: 100%;
  max-width: 100%;
}

.hero__eyebrow {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
}

.hero__title-line {
  font-family: var(--font-primary);
  font-size: clamp(3.5rem, 10vw, 9rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.05;
  color: var(--color-text);
  display: inline-block;
  overflow: hidden;
}

.hero__title-line--outline {
  -webkit-text-stroke: 1.5px var(--color-text);
  color: transparent;
  transition: color 0.5s ease;
}

.hero__title-line--outline:hover {
  color: var(--color-text);
}

/* text reveal clip */
.hero__title-line .char {
  display: inline-block;
  transform: translateY(120%);
  transition: transform 0.8s var(--ease-out-expo);
}

.hero__title-line .char.visible {
  transform: translateY(0);
}

.hero__subtitle {
  display: block;
  text-align: center;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  max-width: 32ch;
  margin: 1.5rem auto 0;
  text-wrap: balance;
}

.hero__subtitle-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--color-text-muted);
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  z-index: 1;
}

.hero__scroll span {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: var(--color-text-muted);
  font-weight: 500;
}

.hero__scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0.3; }
}

/* Corner decorations */
.hero__corners { position: absolute; inset: 2rem; z-index: 1; pointer-events: none; }

.hero__corner {
  position: absolute;
  width: 30px;
  height: 30px;
}

.hero__corner::before,
.hero__corner::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.08);
}

.hero__corner::before { width: 100%; height: 1px; }
.hero__corner::after { width: 1px; height: 100%; }

.hero__corner--tl { top: 0; left: 0; }
.hero__corner--tl::before { top: 0; left: 0; }
.hero__corner--tl::after { top: 0; left: 0; }

.hero__corner--tr { top: 0; right: 0; }
.hero__corner--tr::before { top: 0; right: 0; }
.hero__corner--tr::after { top: 0; right: 0; }

.hero__corner--bl { bottom: 0; left: 0; }
.hero__corner--bl::before { bottom: 0; left: 0; }
.hero__corner--bl::after { bottom: 0; left: 0; }

.hero__corner--br { bottom: 0; right: 0; }
.hero__corner--br::before { bottom: 0; right: 0; }
.hero__corner--br::after { bottom: 0; right: 0; }

.rpg-world {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #050510;
  padding: 0;
  margin: 0;
}

.rpg-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.rpg-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

.rpg-intro {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s var(--ease-out-expo);
}

.rpg-intro.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.rpg-intro__content {
  text-align: center;
  max-width: 520px;
  padding: 2rem;
}

.rpg-intro__badge {
  font-family: var(--font-primary);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.5em;
  color: #55efc4;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.rpg-intro__title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.rpg-intro__title span {
  background: linear-gradient(135deg, #e84393, #74b9ff, #55efc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rpg-intro__desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2rem;
}

.rpg-intro__desc strong {
  color: rgba(255,255,255,0.85);
}

.rpg-intro__biomes {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.rpg-intro__biome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-primary);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}

.rpg-intro__biome-icon {
  font-size: 0.9rem;
}

.rpg-intro__start {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: #050510;
  background: #fff;
  border: none;
  padding: 1rem 3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.4s var(--ease-out-expo);
  margin-bottom: 1.5rem;
}

.rpg-intro__start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255,255,255,0.15);
}

.rpg-intro__controls {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.05em;
}

.rpg-intro__controls kbd {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: rgba(255,255,255,0.5);
  margin: 0 0.1rem;
}

.rpg-intro__controls span {
  color: rgba(255,255,255,0.35);
}

.rpg-dialogue {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: min(90vw, 500px);
  background: rgba(5, 5, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.4s var(--ease-out-expo);
  box-shadow: 0 15px 50px rgba(0,0,0,0.5);
}

.rpg-dialogue.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.rpg-dialogue__name {
  font-family: var(--font-primary);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #55efc4;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.rpg-dialogue__text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  min-height: 1.4rem;
}

.rpg-dialogue__prompt {
  font-family: var(--font-primary);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.25);
  text-align: right;
  margin-top: 0.6rem;
  animation: dialogueBlink 1.5s ease-in-out infinite;
}

@keyframes dialogueBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.rpg-map-name {
  display: none;
}

.rpg-touch {
  display: none;
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 40;
  pointer-events: none;
}

.rpg-touch__dpad {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: all;
  position: relative;
}

.rpg-touch__action {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(85,239,196,0.15);
  border: 2px solid rgba(85,239,196,0.3);
  color: #55efc4;
  font-family: var(--font-primary);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.2s ease;
}

.rpg-touch__action:active {
  background: rgba(85,239,196,0.3);
  transform: scale(0.9);
}

@media (pointer: coarse), (max-width: 768px) {
  .rpg-touch { display: flex; }
  .rpg-intro__controls { display: none; }
  .rpg-dialogue { bottom: 10rem; }
}

.contact {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.contact__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.contact__content {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 2rem;
}

.contact__eyebrow {
  font-family: var(--font-primary);
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.contact__title {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
}

.contact__title-line {
  font-family: var(--font-primary);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.05;
  color: var(--color-text);
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}

.contact__title-line--outline {
  -webkit-text-stroke: 1.5px var(--color-text);
  color: transparent;
  transition: color 0.5s ease;
}

.contact__title-line--outline:hover {
  color: var(--color-text);
}

.contact__title-line .char {
  display: inline-block;
  transform: translateY(120%);
  transition: transform 0.8s var(--ease-out-expo);
}

.contact__title-line .char.visible {
  transform: translateY(0);
}

.contact__subtitle {
  display: block;
  text-align: center;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  max-width: 42ch;
  margin: 1.5rem auto 3rem;
}

.contact__subtitle-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--color-text-muted);
}

.contact__email {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--color-text);
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.3s ease;
}

.contact__email::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out-expo);
}

.contact__email:hover::after {
  transform: scaleX(1);
}

.footer {
  padding: 2.5rem 3rem;
  border-top: 1px solid var(--color-border);
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: rgba(235, 235, 235, 0.32);
  font-family: 'Space Grotesk', var(--font-primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
  padding: 4px 2px;
  margin: -4px -2px;
  transition: color 0.35s ease;
}

.footer__logo-text {
  display: inline-flex;
  align-items: baseline;
}

.footer__logo-hm {
  font-weight: 700;
  color: var(--color-text);
  transition: color 0.45s var(--ease-out-expo), -webkit-text-stroke-color 0.45s var(--ease-out-expo);
  -webkit-text-stroke: 0.6px transparent;
}

.footer__logo-three {
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 0.6px var(--color-text);
  transition: color 0.45s var(--ease-out-expo) 0.08s, -webkit-text-stroke-color 0.45s var(--ease-out-expo) 0.08s;
}

/* Au survol : inversion typographique HM ↔ 3 (HM passe en outline, 3 se remplit) */
.footer__logo:hover .footer__logo-hm,
.footer__logo:focus-visible .footer__logo-hm {
  color: transparent;
  -webkit-text-stroke-color: var(--color-text);
}

.footer__logo:hover .footer__logo-three,
.footer__logo:focus-visible .footer__logo-three {
  color: var(--color-text);
  -webkit-text-stroke-color: transparent;
}

.footer__logo:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .footer__logo,
  .footer__logo-hm,
  .footer__logo-three { transition: none; }
}

.footer__copy {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.footer__nav {
  display: flex;
  gap: 2rem;
}

.footer__nav a {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}

.footer__nav a:hover { color: var(--color-text); }

.footer__right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer__label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}

.footer__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
}

.cursor {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.4s var(--ease-out-expo),
              height 0.4s var(--ease-out-expo),
              background 0.3s ease,
              border-color 0.3s ease;
}

.cursor.hover {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

@media (max-width: 1024px) {
  .gp-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav { padding: 1.2rem 1.5rem; }
  .nav__time { font-size: 0.55rem; letter-spacing: 0.15em; }

  .hero__title-line { letter-spacing: 0.04em; }
  .hero__corners { inset: 1rem; }
  .hero__scroll { bottom: 1.8rem; }

  .contact__title-line {
    font-size: clamp(2.2rem, 11vw, 5rem);
    letter-spacing: 0.02em;
  }
  .contact__content { padding: 0 1.5rem; }
  .contact__subtitle { margin: 1rem auto 2rem; }

  .footer { padding: 2rem 1.5rem; }
  .footer__container { flex-direction: column; gap: 1rem; text-align: center; }
  .footer__nav { flex-wrap: wrap; justify-content: center; }
  .footer__left { flex-direction: column; gap: 0.4rem; }

  .cursor { display: none; }

  /* Game responsive */
  .game-ui { padding: 1.2rem 1.5rem; }
  .game-ui__title { font-size: 0.5rem; letter-spacing: 0.25em; }

  .game-popup { padding: 1.8rem; border-radius: 14px; }
  .gp-grid { grid-template-columns: 1fr; }
  .gp-project { flex-direction: column; align-items: flex-start; gap: 0.3rem; }

  .menu-overlay {
    clip-path: circle(0% at calc(100% - 2rem) 1.5rem);
  }
  .menu-overlay.active {
    clip-path: circle(150% at calc(100% - 2rem) 1.5rem);
  }
}

@media (max-width: 480px) {
  .nav { padding: 1rem 1.2rem; }
  .nav__time { font-size: 0.5rem; }

  .hero__corners { inset: 0.8rem; }
  .hero__corner { width: 22px; height: 22px; }

  .contact__title-line {
    font-size: clamp(1.9rem, 12vw, 3rem);
    letter-spacing: 0.01em;
  }

  .contact__email {
    font-size: 1.05rem;
    padding: 0.6rem 0;       /* tap target ~44px */
  }

  .footer { padding: 1.6rem 1.2rem; }
  .footer__logo, .footer__copy, .footer__label { font-size: 0.65rem; }

  .game-popup { padding: 1.5rem; width: min(96vw, 520px); }
  .island-label__name { font-size: 0.5rem; }
}

/* Désactive les effets coûteux/parasites sur mobile */
@media (hover: none) {
  .grain-overlay { animation: none; opacity: 0.025; }
  .hero__title-line--outline:hover { color: transparent; }
  .contact__email::after { transition: none; }
}

.nf-nav {
  margin-top: 3.5rem;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}
.nf-nav__rule {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.08);
  margin: 0.6rem 0;
}
.nf-link {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 2.5rem;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition: color .4s var(--ease-out-expo);
}
.nf-link__index {
  font-family: var(--font-primary);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--color-text-muted);
  opacity: 0.55;
  transition: opacity .4s var(--ease-out-expo), color .4s var(--ease-out-expo);
}
.nf-link__label {
  position: relative;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  padding-bottom: 0.35rem;
}
.nf-link__label::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s var(--ease-out-expo);
}
.nf-link:hover,
.nf-link:focus-visible {
  color: var(--color-text);
  outline: none;
}
.nf-link:hover .nf-link__index,
.nf-link:focus-visible .nf-link__index {
  opacity: 1;
  color: var(--color-text);
}
.nf-link:hover .nf-link__label::after,
.nf-link:focus-visible .nf-link__label::after {
  transform: scaleX(1);
}

@media (max-width: 540px) {
  .nf-link { padding: 0.4rem 1.5rem; }
  .nf-link__label { font-size: 0.65rem; letter-spacing: 0.35em; }
}

.snake {
  margin: 2.5rem auto 0;
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.snake__canvas {
  width: 100%;
  aspect-ratio: 8 / 3;
  height: auto;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  image-rendering: pixelated;
  touch-action: none;
  outline: none;
}
.snake__canvas:focus,
.snake__canvas:focus-visible {
  outline: none;
  border-color: var(--color-border);
}
.snake__hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: var(--font-primary);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* 404 — whisper (hint très discret pour l'easter egg snake) */
.nf-whisper {
  margin-top: 4rem;
  font-family: var(--font-primary);
  font-size: 0.55rem;
  letter-spacing: 0.6em;
  color: var(--color-text-muted);
  opacity: 0.35;
  text-align: center;
  user-select: none;
  transition: opacity 0.6s var(--ease-out-expo);
}
.nf-whisper:hover { opacity: 0.7; }

/* 404 — slide-up reveal du canvas */
.snake[hidden] { display: none; }
.snake {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.snake.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 404 — ajustements d'espacements */
#nf-title { gap: 1.2rem; }
#nf-title .hero__title-line:first-child { margin-bottom: 0.4rem; }
.snake { margin-top: 1rem; }

/* 404 — récompense (mailto à 20 fruits) */
.snake__reward {
  margin-top: 1.5rem;
  height: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  pointer-events: none;
}
.snake__reward.is-revealed {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.snake__email {
  position: relative;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text);
  padding-bottom: 0.25rem;
  text-decoration: none;
}
.snake__email::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  animation: emailUnderline 1s var(--ease-out-expo) 0.2s forwards;
}
@keyframes emailUnderline {
  to { transform: scaleX(1); }
}
.snake__email:hover::after {
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 0.55s var(--ease-out-expo);
}

/* 404 — toast partage */
.snake__toast {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  transform: translate(-50%, 1rem);
  font-family: var(--font-primary);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-text);
  background: rgba(10,10,10,0.9);
  border: 1px solid var(--color-border);
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.snake__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
