/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:          #111e2e;
  --bg-surface:  #172638;
  --bg-card:     #1d3048;
  --bg-card-2:   #233a58;

  --coral:       #ee845a;
  --coral-dim:   #c0572e;
  --coral-glow:  rgba(238, 132, 90, 0.15);

  --text-primary:   #dce4ee;
  --text-secondary: #7a95b5;
  --text-muted:     #647fa0;

  --border:      rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.09);

  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;

  --nav-h: 70px;
  --max-w: 1100px;
  --section-gap: 7rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--coral-dim) var(--bg-surface);
  scrollbar-width: thin;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  width: 100%;
  min-height: 100dvh;
  background-color: #0d1a28;
  background-image:
    radial-gradient(ellipse 65% 55% at 92%  4%,  rgba(20, 184, 166, .13) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at  4%  88%, rgba(232, 110,  75, .08) 0%, transparent 52%),
    radial-gradient(ellipse 80% 70% at 50% 50%,  rgba(13,  35,  65, .40) 0%, transparent 75%);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 1rem;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}

::selection { background: var(--coral-glow); color: var(--coral); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: .75rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-glow);
}
textarea { resize: vertical; min-height: 140px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}
[tabindex="-1"]:focus { outline: none; }

/* ============================================================
   UTILITIES
   ============================================================ */
.mono   { font-family: var(--font-mono); }
.accent { color: var(--coral); }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--coral) 0%, #6b9ec4 60%, #4480b8 100%);
  z-index: 201;
  border-radius: 0 2px 2px 0;
  transition: width .08s linear;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  background: var(--coral);
  color: var(--bg);
  font-weight: 600;
  border-radius: 8px;
  transition: background .2s, transform .15s var(--ease-out), box-shadow .2s;
}
.btn-primary:hover {
  background: #f4a07e;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(238,132,90,.35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: .7rem 1.5rem;
  border: 1px solid var(--coral);
  color: var(--coral);
  border-radius: 8px;
  font-size: .9rem;
  transition: background .2s, transform .15s;
}
.btn-outline:hover { background: var(--coral-glow); transform: translateY(-2px); }
.btn-sm { padding: .5rem 1.1rem; font-size: .85rem; }

.not-found {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: calc(100vh - var(--nav-h));
  gap: 1rem; font-size: 1.5rem;
}
.not-found .accent { font-family: var(--font-mono); font-size: 5rem; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2rem; z-index: 9999;
  animation: splashFade 0.4s 2.2s forwards;
}
.splash-logo { font-family: var(--font-mono); font-size: 2.5rem; font-weight: 700; }
.splash-logo .logo-bracket { color: var(--coral); }
.splash-bar { width: 200px; height: 2px; background: var(--bg-card-2); border-radius: 999px; overflow: hidden; }
.splash-fill { height: 100%; background: var(--coral); border-radius: 999px; animation: splashLoad 2s var(--ease-out) forwards; }

/* ============================================================
   LAYOUT — section utilities (partagées entre composants)
   ============================================================ */
main {
  padding-top: var(--nav-h);
  position: relative;
  z-index: 0;
}

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-gap) clamp(1.5rem, 5vw, 2rem);
}
.section.will-animate {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.section.will-animate.visible { opacity: 1; transform: none; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
  color: var(--text-secondary);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.section-label::after {
  content: '';
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--text-muted);
  opacity: .45;
  border-radius: 1px;
}
.section-big-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 3rem;
}

/* ============================================================
   TECH TAG COLORS — variables réutilisées cross-composant
   ============================================================ */
.tech-tag, .skill-tag { --tag-c: #8892a4; }
[data-tech="Blazor WASM"],
[data-tech="Blazor"],
[data-tech="Blazor Server"] { --tag-c: #7c3aed; }
[data-tech="ASP.NET Core"]  { --tag-c: #0ea5e9; }
[data-tech=".NET 8"],
[data-tech=".NET"]          { --tag-c: #818cf8; }
[data-tech="EF Core"],
[data-tech="Entity Framework"] { --tag-c: #a78bfa; }
[data-tech="C#"]            { --tag-c: #34d399; }
[data-tech="SignalR"]       { --tag-c: #7c3aed; }
[data-tech="CQRS"]          { --tag-c: #f59e0b; }
[data-tech="Azure"]         { --tag-c: #0078d4; }
[data-tech="Docker"]        { --tag-c: #2496ed; }
[data-tech="Redis"]         { --tag-c: #dc382d; }
[data-tech="RabbitMQ"]      { --tag-c: #ff6600; }
[data-tech="SQL Server"]    { --tag-c: #cc2927; }
[data-tech="PostgreSQL"]    { --tag-c: #336791; }
[data-tech="MySQL"]         { --tag-c: #4479a1; }
[data-tech="TypeScript"]    { --tag-c: #3178c6; }
[data-tech="React"]         { --tag-c: #61dafb; }
[data-tech="JavaScript"]    { --tag-c: #f7df1e; }
[data-tech="Node.js"]       { --tag-c: #339933; }

/* ============================================================
   BLAZOR ERROR UI
   ============================================================ */
#blazor-error-ui {
  background: #1a1612; border-top: 2px solid var(--coral);
  bottom: 0; left: 0; right: 0; padding: .75rem 1.5rem;
  position: fixed; display: none; z-index: 9999;
  font-size: .9rem; align-items: center; gap: 1rem;
}
#blazor-error-ui .reload { color: var(--coral); text-decoration: underline; }
#blazor-error-ui .dismiss { color: var(--text-muted); font-size: 1.1rem; padding: 0 .5rem; }
#blazor-error-ui[style*="display"] { display: flex !important; }

/* ============================================================
   ANIMATIONS — globales (référencées par plusieurs composants)
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ambientPulse {
  from { opacity: .65; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes splashLoad { from { width: 0 } to { width: 100% } }
@keyframes splashFade { to { opacity: 0; pointer-events: none; visibility: hidden; } }
@keyframes hud-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #4ade80; }
  50%       { opacity: .6; box-shadow: 0 0 14px #4ade80; }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 1; }
  14%       { transform: scale(1.22); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.14); }
  56%       { transform: scale(1); opacity: .85; }
}

/* ============================================================
   RESPONSIVE — globals uniquement
   ============================================================ */
@media (max-width: 600px) {
  :root { --section-gap: 4.5rem; }

  .nav-links {
    background: #0d1a28 !important;
    backdrop-filter: none !important;
  }
}

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

/* ============================================================
   PROJECT BADGES (global — hors CSS isolation Blazor)
   ============================================================ */
.prj-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  border-radius: 999px; padding: .2rem .65rem;
  font-family: var(--font-mono); font-size: .7rem;
  font-weight: 600; letter-spacing: .06em;
}
.prj-badge--live, .prj-badge--stable {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  color: #34d399;
}
.prj-badge--live .prj-badge-dot,
.prj-badge--stable .prj-badge-dot { background: #10b981; }

.prj-badge--wip {
  background: rgba(251,146,60,.1);
  border: 1px solid rgba(251,146,60,.2);
  color: #fb923c;
}
.prj-badge--wip .prj-badge-dot { background: #f97316; }

.prj-badge--private {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.2);
  color: #f87171;
}
.prj-badge--private .prj-badge-dot { background: #ef4444; }
