/* ============================================================
   PORTFOLIO HUGO IWANIEC — STYLE GLOBAL
   Thème : COCKPIT · Option A — Asphalte & Titane
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&family=Share+Tech+Mono&display=swap');

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
  --bg-main:        #141820;
  --bg-card:        #1E2535;
  --bg-secondary:   #252D40;
  --text-primary:   #F0F2F5;
  --text-secondary: #8892A4;
  --accent:         #E8002D;
  --accent-dim:     rgba(232, 0, 45, 0.18);
  --accent-glow:    rgba(232, 0, 45, 0.28);
  --border:         #2E3A52;
  --border-light:   rgba(46, 58, 82, 0.55);

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;

  --navbar-h:  64px;
  --radius:    6px;
  --transition: 0.25s ease;
}

/* ============================================================
   2. RESET
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ============================================================
   3. ÉCRAN DE CHARGEMENT — HUD BOOT SEQUENCE
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #08090D;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#loading-screen.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Scan line qui balaye l'écran */
.hud-scanline {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  animation: scanline-sweep 2.2s ease forwards;
  opacity: 0;
}
@keyframes scanline-sweep {
  0%   { top: 0;    opacity: 0; }
  5%   { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

/* Grille HUD en fond */
.hud-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,0,45,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,0,45,0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0;
  animation: hud-fade 0.5s ease 0.2s forwards;
}
@keyframes hud-fade { to { opacity: 1; } }

/* Coins du HUD */
.hud-corners { position: absolute; inset: 28px; pointer-events: none; }
.hud-corners::before, .hud-corners::after,
.hud-corner-br, .hud-corner-bl {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  opacity: 0;
  animation: corner-in 0.35s ease forwards;
}
.hud-corners::before { top:0;left:0; border-top:2px solid var(--accent); border-left:2px solid var(--accent); animation-delay:0.4s; }
.hud-corners::after  { top:0;right:0; border-top:2px solid var(--accent); border-right:2px solid var(--accent); animation-delay:0.5s; }
.hud-corner-br { position:absolute; bottom:0;right:0; border-bottom:2px solid var(--accent); border-right:2px solid var(--accent); animation-delay:0.55s; }
.hud-corner-bl { position:absolute; bottom:0;left:0;  border-bottom:2px solid var(--accent); border-left:2px solid var(--accent); animation-delay:0.6s; }
@keyframes corner-in { to { opacity: 1; } }

/* Zone centrale */
.hud-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  width: min(320px, 88vw);
}

/* Lignes de check */
.hud-checks { width:100%; display:flex; flex-direction:column; gap:5px; margin-bottom:16px; }
.hud-check-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  display: flex; justify-content: space-between; align-items: center;
  opacity: 0; transform: translateX(-10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.hud-check-line.visible { opacity:1; transform:translateX(0); }
.check-ok  { color:#2ed573; font-weight:700; }
.check-run { color:var(--accent); animation: blink-run 0.65s ease infinite; }
@keyframes blink-run { 50% { opacity:0.15; } }

/* Séparateur */
.hud-sep { width:100%; height:1px; background:var(--border); margin:4px 0; opacity:0; transition:opacity 0.3s ease; }
.hud-sep.visible { opacity:1; }

/* Monogramme */
.hud-monogram {
  font-family: var(--font-display);
  font-size: 4.2rem; font-weight:800;
  color: var(--text-primary); letter-spacing:0.12em; line-height:1;
  opacity:0; transform:scale(0.86);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.hud-monogram .mono-accent { color: var(--accent); }
.hud-monogram.visible { opacity:1; transform:scale(1); }

.hud-name {
  font-family: var(--font-mono); font-size:0.65rem;
  color: var(--text-secondary); letter-spacing:0.38em; text-transform:uppercase;
  opacity:0; transition:opacity 0.4s ease;
}
.hud-name.visible { opacity:1; }

/* Barre de progression */
.hud-prog-track {
  width:100%; height:2px; background:var(--border);
  margin-top:16px; border-radius:2px; overflow:hidden;
  opacity:0; transition:opacity 0.3s ease;
}
.hud-prog-track.visible { opacity:1; }
.hud-prog-fill {
  height:100%; width:0;
  background: linear-gradient(90deg, var(--accent), #FF6060);
  border-radius:2px; position:relative;
  transition: width 0.85s cubic-bezier(0.4,0,0.2,1);
}
.hud-prog-fill::after {
  content:''; position:absolute; right:0; top:-2px;
  width:4px; height:6px; background:#fff; border-radius:1px;
  box-shadow: 0 0 8px var(--accent);
}
.hud-prog-fill.full { width:100%; }

.hud-prog-label {
  font-family:var(--font-mono); font-size:0.6rem;
  color:var(--accent); letter-spacing:0.14em;
  margin-top:7px; opacity:0; transition:opacity 0.3s ease;
}
.hud-prog-label.visible { opacity:1; }

/* ============================================================
   5. NAVBAR — BARRE TÉLÉMÉTRIE
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: transparent;
  transition: background var(--transition), border-bottom var(--transition), opacity 0.4s ease;
  opacity: 0;
}
.navbar.page-ready { opacity: 1; }
.navbar.scrolled {
  background: rgba(20, 24, 32, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

/* Ligne de séparation rouge sous la navbar */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.navbar.scrolled::after { opacity: 0.4; }

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links li a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 18px;
  border-radius: 2px;
  position: relative;
  transition: color var(--transition);
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links li a:hover { color: var(--text-primary); }
.nav-links li a:hover::after,
.nav-links li a.active::after { width: calc(100% - 24px); }
.nav-links li a.active { color: var(--text-primary); }

.nav-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.status-dot {
  width: 6px; height: 6px;
  background: #2ED573;
  border-radius: 50%;
  animation: pulse-dot 2.4s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ============================================================
   6. HERO
   ============================================================ */
#hero {
  height: 100vh;
  min-height: 580px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 10%;
  overflow: hidden;
}
#bg-canvas {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  z-index: 0;
}

/* Voile dégradé bas */
#hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--bg-main));
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
}

/* Animations héros — déclenchées par .page-ready sur body */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
body.page-ready .hero-eyebrow { opacity: 1; transform: translateY(0); }

.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 11vw, 10rem);
  line-height: 0.88;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(48px) skewY(2deg);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.4s,
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}
body.page-ready .hero-name { opacity: 1; transform: translateY(0) skewY(0); }

.hero-name .name-accent { color: var(--accent); }

.hero-divider {
  width: 0; height: 3px;
  background: var(--accent);
  margin: 22px 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.85s;
}
body.page-ready .hero-divider { width: 70px; }

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 1s, transform 0.5s ease 1s;
}
body.page-ready .hero-subtitle { opacity: 0.85; transform: translateY(0); }

.hero-scroll {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  letter-spacing: 0.18em;
  opacity: 0;
  transition: opacity 0.5s ease 1.5s;
}
body.page-ready .hero-scroll { opacity: 0.6; }
.hero-scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-line 2.2s ease infinite;
}
@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ============================================================
   7. SECTIONS — BASE
   ============================================================ */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 48px;
}
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.content-section h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 0.95;
  position: relative;
  padding-left: 20px;
  margin-bottom: 52px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16,1,0.3,1);
}
.content-section h2.visible { opacity: 1; transform: translateY(0); }
.content-section h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   8. SECTION À PROPOS
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: start;
}
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.about-lead .name-red { color: var(--accent); }
.about-body {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--text-secondary);
}
.about-body strong { color: var(--text-primary); font-weight: 500; }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.45s ease, transform 0.45s ease,
              box-shadow var(--transition), border-color var(--transition);
}
.stat-item.visible { opacity: 1; transform: translateX(0); }
.stat-item:hover {
  border-color: var(--accent);
  box-shadow: -4px 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
  transform: translateX(4px) !important;
}
.stat-icon {
  font-size: 1.2rem;
  color: var(--accent);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.stat-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 2px;
}
.stat-text span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ============================================================
   9. TIMELINE — PARCOURS
   ============================================================ */
.timeline-wrap {
  position: relative;
  padding-left: 36px;
  max-width: 820px;
}
.timeline-rail {
  position: absolute;
  left: 0; top: 8px; bottom: 0;
  width: 2px;
  background: var(--border);
  overflow: hidden;
}
.timeline-rail-fill {
  width: 100%; height: 0;
  background: var(--accent);
  transition: height 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-rail-fill.filled { height: 100%; }

.t-item {
  position: relative;
  padding: 0 0 40px 36px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.t-item.visible { opacity: 1; transform: translateX(0); }
.t-item::before {
  content: '';
  position: absolute;
  left: -5px; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 2px solid var(--border);
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}
.t-item.visible::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.t-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.t-card:hover {
  border-color: rgba(232, 0, 45, 0.5);
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.t-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 5px;
}
.t-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 5px;
}
.t-place {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.t-place::before { content: '› '; color: var(--accent); }

/* ============================================================
   10. PDF / CV
   ============================================================ */
.pdf-container {
  width: 100%; height: 800px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pdf-container iframe { width: 100%; height: 100%; border: none; }
.pdf-fallback { display: none; padding: 20px; text-align: center; color: var(--text-secondary); }

/* ============================================================
   11. ATOUTS — PROFIL
   ============================================================ */
.atouts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.atout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.atout-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 20px 48px rgba(0,0,0,0.5), 0 0 24px var(--accent-glow);
}
.atout-img-wrap {
  height: 190px;
  overflow: hidden;
  position: relative;
}
.atout-img-wrap::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 70px;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
}
.atout-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.atout-card:hover .atout-img-wrap img { transform: scale(1.07); }
.atout-text { padding: 20px 22px 26px; }
.atout-text h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.atout-text p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.5;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.footer p { font-size: 0.78rem; color: var(--text-secondary); }
.social-links { display: flex; gap: 14px; }
.social-links a {
  color: var(--text-secondary);
  font-size: 1.15rem;
  transition: color var(--transition), transform var(--transition);
}
.social-links a:hover { color: var(--accent); transform: translateY(-3px); }

/* ============================================================
   13. PAGE HERO (sous-pages)
   ============================================================ */
.page-hero {
  height: 100vh;
  min-height: 480px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}
.page-hero #bg-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(transparent, var(--bg-main));
  z-index: 1; pointer-events: none;
}
.page-hero-content {
  position: relative; z-index: 3;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9.5rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 0.9;
  /* Animation CSS pure — aucune dépendance JS */
  animation: pageHeroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}
.page-title-accent { color: var(--accent); }

/* Hero index — déclenché par body.page-ready (loading screen) */
#hero .hero-name {
  /* override: la transition reste sur body.page-ready */
}

/* Animations sous-pages */
.page-hero .page-hero-label {
  animation: pageLabelIn 0.55s ease 0.1s both;
}
@keyframes pageHeroIn {
  from { opacity: 0; transform: translateY(36px) skewY(1deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0); }
}
@keyframes pageLabelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .atouts-grid { grid-template-columns: repeat(2, 1fr); }
  .content-section { padding: 72px 32px; }
  .navbar { padding: 0 32px; }
  .footer { padding: 24px 32px; }
}

@media (max-width: 768px) {
  :root { --navbar-h: 56px; }
  .navbar { padding: 0 16px; }
  .nav-status { display: none; }
  .nav-links li a { font-size: 0.72rem; padding: 6px 10px; letter-spacing: 0.08em; }
  .atouts-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 16px; text-align: center; padding: 20px 16px; }
  .content-section { padding: 56px 20px; }
  #hero { padding: 0 6%; }
  .content-section h2 { margin-bottom: 36px; }
  .about-grid { gap: 32px; }
}

@media (max-width: 480px) {
  .nav-links li a span { display: none; }
  .nav-links li a i { display: inline; font-size: 1rem; }
  .nav-links li a { padding: 8px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
  .nav-brand { font-size: 1.15rem; }
}
