/* ============================
   PORTFOLIO — YANNICK
   Noir & Blanc · Minimaliste
   ============================ */

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Scanlines CRT globales ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.06) 0px,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 4px
  );
  background-size: 100% 4px;
  animation: scanlines-scroll 8s linear infinite;
  pointer-events: none;
  z-index: 9998;
}

@keyframes scanlines-scroll {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

:root {
  --black: #0D100F;
  --white: #F3E7E6;
  --gray: #1a1a1a;
  --gray-mid: #333333;
  --gray-light: #888888;

  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
  --font-pixel: 'Press Start 2P', monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* TYPOGRAPHY IMPORTS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&family=JetBrains+Mono:wght@400;700&family=Press+Start+2P&display=swap');

/* ============================
   00. INTRO — DOOM × INSERT COIN
   ============================ */
#intro {
  position: fixed;
  inset: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 56px;
  z-index: 9999;
  cursor: pointer;
  user-select: none;
}

/* Scanlines CRT — intro (placeholder, l'effet réel est sur body::after) */
#intro-scanlines { display: none; }

/* Logo */
#intro-logo {
  width: min(160px, 38vw);
  opacity: 0;
  animation: intro-logo-in 0.9s ease forwards 0.4s;
  position: relative;
  z-index: 2;
}

@keyframes intro-logo-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Phase 1 : INSERT COIN ── */
#intro-coin {
  opacity: 0;
  animation: intro-logo-in 0.4s ease forwards 1.4s;
  position: relative;
  z-index: 2;
}

#intro-insert {
  font-family: var(--font-pixel);
  font-size: clamp(0.45rem, 1.4vw, 0.65rem);
  color: var(--white);
  letter-spacing: 0.08em;
  animation: blink 1.1s step-end infinite 1.8s;
}

/* ── Phase 2 : DOOM Loader ── */
#intro-loader {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: min(420px, 78vw);
  position: relative;
  z-index: 2;
}

#intro-loading-label {
  font-family: var(--font-pixel);
  font-size: clamp(0.38rem, 1.1vw, 0.52rem);
  color: var(--white);
  letter-spacing: 0.06em;
}

#intro-bar-wrap {
  width: 100%;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 3px;
}

#intro-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--white);
}

#intro-bar-pct {
  font-family: var(--font-pixel);
  font-size: clamp(0.32rem, 0.9vw, 0.42rem);
  color: var(--gray-light);
  align-self: flex-end;
}

/* ── Flash écran ── */
#intro-flash {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.18s ease;
}

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

/* ============================
   MAIN (hidden until intro ends)
   ============================ */
#main {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#main.hidden {
  visibility: hidden;
  opacity: 0;
}

#main.visible {
  visibility: visible;
  opacity: 1;
}

/* ============================
   NAV
   ============================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray);
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

#nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

#nav ul a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-light);
  text-decoration: none;
  letter-spacing: 0.2em;
  transition: color 0.2s;
}

#nav ul a:hover {
  color: var(--white);
}

/* ============================
   SECTIONS
   ============================ */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--gray);
}

.section__inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 120px 48px 80px;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--gray-light);
  margin-bottom: 40px;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

h2 em {
  font-style: normal;
  font-weight: 700;
}

.body-text {
  font-size: 1rem;
  color: var(--gray-light);
  max-width: 480px;
  line-height: 1.8;
}

/* ============================
   01. ACCUEIL
   ============================ */
.section--home {
  background: var(--black);
}

.headline {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.pixel-text {
  font-family: var(--font-pixel);
  font-size: 0.6em;
  letter-spacing: 0.02em;
  display: inline-block;
}

.subline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray-light);
  letter-spacing: 0.25em;
  margin-bottom: 64px;
}

.aoe-animation {
  margin-top: 64px;
}

.aoe-animation canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.aw-animation {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.aw-animation canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.mc-animation {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.mc-animation canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ============================
   02. DESIGN
   ============================ */
.section--design {
  background: var(--black);
}

.grid--design {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--gray);
  border: 1px solid var(--gray);
  margin-top: 48px;
}

.card {
  background: var(--black);
  padding: 32px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.2s;
  cursor: default;
}

.card:hover {
  background: var(--gray);
}

.card__num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gray-light);
  letter-spacing: 0.2em;
}

.card__bar {
  height: 1px;
  background: var(--gray-mid);
  margin: 16px 0;
}

.card__title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--gray-light);
}

/* ============================
   03. IA
   ============================ */
.section--ia {
  background: var(--black);
}

.terminal {
  margin: 48px 0;
  border: 1px solid var(--gray-mid);
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal__bar {
  background: var(--gray);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.terminal__bar span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-mid);
}

.terminal__body {
  padding: 24px;
  line-height: 2;
}

.prompt {
  color: var(--gray-light);
}

.cmd {
  color: var(--white);
}

.output {
  color: var(--gray-light);
  padding-left: 1em;
}

.cursor {
  animation: blink 1s step-end infinite;
}

.ia-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 560px;
}

.ia-card {
  border: 1px solid var(--gray-mid);
  padding: 24px;
  transition: border-color 0.2s;
}

.ia-card:hover {
  border-color: var(--white);
}

.ia-card__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gray-light);
  margin-bottom: 12px;
}

.ia-card__title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.ia-card__desc {
  font-size: 0.8rem;
  color: var(--gray-light);
  line-height: 1.6;
}

/* ============================
   04. JEUX VIDÉO
   ============================ */
.section--jeux {
  background: var(--black);
}

.pixel-text--large {
  font-family: var(--font-pixel);
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1.4;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
}

.pixel-grid {
  margin: 32px 0;
}

.pixel-grid svg {
  width: min(512px, 100%);
  image-rendering: pixelated;
  border: 1px solid var(--gray-mid);
  background: var(--black);
  padding: 16px;
}

/* ============================
   05. PHOTOGRAPHIE
   ============================ */
.section--photo {
  background: var(--black);
}

.photo-gallery {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 200px 200px;
  gap: 1px;
  background: var(--gray);
  border: 1px solid var(--gray);
}

.photo-slot--1 { grid-column: 1 / 3; grid-row: 1 / 3; }
.photo-slot--2 { grid-column: 3 / 4; grid-row: 1 / 2; }
.photo-slot--3 { grid-column: 4 / 5; grid-row: 1 / 2; }
.photo-slot--4 { grid-column: 3 / 5; grid-row: 2 / 3; }

.photo-placeholder {
  background: var(--gray);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  cursor: pointer;
}

.photo-placeholder:hover {
  background: var(--gray-mid);
}

.photo-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gray-light);
  letter-spacing: 0.2em;
}

/* ============================
   06. CONTACT
   ============================ */
.section--contact {
  background: var(--black);
  border-bottom: none;
}

.contact-links {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray);
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

.contact-item:first-child {
  border-top: 1px solid var(--gray);
}

.contact-item:hover .contact-item__value {
  color: var(--white);
}

.contact-item__type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--gray-light);
}

.contact-item__value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gray-light);
  transition: color 0.15s;
}

.footer-note {
  margin-top: 64px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gray-mid);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  #nav {
    padding: 16px 24px;
  }

  #nav ul {
    gap: 16px;
  }

  .section__inner {
    padding: 100px 24px 64px;
  }

  .grid--design {
    grid-template-columns: 1fr;
  }

  .ia-cards {
    grid-template-columns: 1fr;
  }

  .photo-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 160px);
  }

  .photo-slot--1 { grid-column: 1 / 3; grid-row: 1 / 2; }
  .photo-slot--2 { grid-column: 1 / 2; grid-row: 2 / 3; }
  .photo-slot--3 { grid-column: 2 / 3; grid-row: 2 / 3; }
  .photo-slot--4 { grid-column: 1 / 3; grid-row: 3 / 4; }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================
   DUKE NUKEM — easter egg
   ============================ */
#duke {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 220px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
  cursor: crosshair;
}

#duke.visible { opacity: 1; }

#duke-face {
  position: relative;
}

#duke-img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#duke-pupils {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Tooltip "Hail to the king." */
#duke::after {
  content: 'Hail to the king.';
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

#duke:hover::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  #duke { width: 56px; bottom: 0.75rem; right: 0.75rem; }
}
