:root {
  --bg-color: #000000;
  --text-main: #E5E5E5;
  --text-dim: #8a8a8a;
  --border-color: #262626;
  --accent: #FFFFFF;
  --header-h: 64px;
}

html {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--border-color); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Apparition au scroll */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .status-dot::after { animation: none; }
}

/* Accessibilité : lien d'évitement */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: #fff;
  color: #000;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
}
.skip-link:focus { top: 12px; }

/* ===== En-tête ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: #1a1a1a;
  background: rgba(0, 0, 0, 0.88);
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-dim);
}
.nav-link:hover,
.nav-link.is-active { color: #fff; background: #111; }

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* cible tactile confortable */
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.btn-primary { background: #fff; color: #000 !important; }
.btn-primary:hover { background: #d4d4d4; }
.btn-ghost { border: 1px solid #2a2a2a; color: #e5e5e5; }
.btn-ghost:hover { border-color: #666; background: #0f0f0f; }

/* Bouton burger */
.menu-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid #222;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.menu-bar {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.25s ease, top 0.25s ease;
}
.menu-bar:nth-child(1) { top: 17px; }
.menu-bar:nth-child(2) { top: 25px; }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  border-top: 1px solid #1a1a1a;
  background: rgba(0, 0, 0, 0.96);
}
.mobile-menu[hidden] { display: none; }
.mobile-link {
  display: block;
  padding: 14px 4px;
  border-bottom: 1px solid #141414;
  color: #e5e5e5;
}

/* Statut "disponible" */
.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: #22c55e;
  opacity: 0.35;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ===== Formulaires ===== */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #d4d4d4;
}
.field {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #262626;
  border-radius: 10px;
  background: #050505;
  color: #fff;
  font: inherit;
  font-size: 16px; /* évite le zoom automatique sur iOS */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea.field { line-height: 1.5; }
.field::placeholder { color: #5a5a5a; }
.field:hover { border-color: #3a3a3a; }
.field:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.field[aria-invalid="true"] { border-color: #ef4444; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
button.btn-primary, button.btn-ghost { cursor: pointer; font-family: inherit; }

.form-status { font-size: 14px; min-height: 20px; color: #9ca3af; margin: 0; }
.form-status[data-type="success"] { color: #4ade80; }
.form-status[data-type="error"] { color: #f87171; }

/* ===== Modale ===== */
.project-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #262626;
  border-radius: 18px;
  background: #0a0a0a;
  color: var(--text-main);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.project-dialog::backdrop { background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.project-dialog[open] { animation: dialog-in 0.22s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #262626;
  border-radius: 10px;
  background: transparent;
  color: #d4d4d4;
  cursor: pointer;
}
.dialog-close:hover { border-color: #666; color: #fff; }
html.modal-open { overflow: hidden; }

/* Titres de section */
.section-title {
  font-size: 1.5rem;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .section-title { font-size: 1.875rem; margin-bottom: 2.5rem; }
}

/* Image */
.img-grayscale {
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.4s ease;
}
.img-grayscale:hover { filter: grayscale(0%) contrast(1); }

/* Blocs de code */
pre {
  background-color: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85rem !important;
}
code { font-family: 'JetBrains Mono', monospace !important; }
