/* ============================================================
   CHEVALERESQUE — main.css
   Design system, typographie, composants partagés.
   ============================================================ */

/* --- Variables globales -------------------------------------- */
:root {
  /* Base sombre */
  --bg: #0E0B0E;
  --bg-elev: #16121580;
  --surface: #1A1517;
  --surface-2: #221C1F;
  --text: #E8E1D4;
  --text-muted: #8C857B;
  --text-dim: #5A544D;
  --border: rgba(232, 225, 212, 0.08);
  --border-strong: rgba(232, 225, 212, 0.18);

  /* Accent par défaut (data) */
  --accent: #2D7A8E;
  --accent-light: #3A99B0;
  --accent-deep: #1F5969;
  --accent-glow: rgba(58, 153, 176, 0.18);
  --accent-tint: rgba(31, 89, 105, 0.12);

  /* Typo */
  --font-sans: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Rythme */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-card: 0 12px 40px -12px rgba(0, 0, 0, 0.6),
                 0 0 0 0.5px var(--border);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Palettes par section — pilotent les variables --accent-* via JS */
.theme-data {
  --accent: #2D7A8E;
  --accent-light: #3A99B0;
  --accent-deep: #1F5969;
  --accent-glow: rgba(58, 153, 176, 0.18);
  --accent-tint: rgba(31, 89, 105, 0.12);
}
.theme-art {
  --accent: #B68B2A;
  --accent-light: #D4A53F;
  --accent-deep: #876320;
  --accent-glow: rgba(212, 165, 63, 0.18);
  --accent-tint: rgba(182, 139, 42, 0.12);
}
.theme-contact {
  --accent: #9B3A4E;
  --accent-light: #B8526A;
  --accent-deep: #7A2738;
  --accent-glow: rgba(184, 82, 106, 0.16);
  --accent-tint: rgba(122, 39, 56, 0.12);
}
.theme-omnis {
  --accent: #5B4FCF;
  --accent-light: #7B6FE8;
  --accent-deep: #3D3499;
  --accent-glow: rgba(123, 111, 232, 0.18);
  --accent-tint: rgba(61, 52, 153, 0.12);
}

/* --- Reset léger --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* --- Typographie --------------------------------------------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 500; }
h4 { font-size: 1rem; font-weight: 500; }
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Background commun à toutes pages ------------------------ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at top, var(--accent-tint), transparent 55%),
    radial-gradient(ellipse at bottom right, var(--accent-glow), transparent 60%),
    var(--bg);
  transition: background 1.2s var(--ease-out);
}
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- Boutons ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: all 0.3s var(--ease-out);
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 6px 24px -8px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

/* --- Navigation interne (sub-pages) -------------------------- */
.subnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(14, 11, 14, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 0.5px solid var(--border);
}
.subnav-brand {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.subnav-brand-mark {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.subnav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.subnav-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.subnav-links a:hover,
.subnav-links a.active {
  color: var(--text);
}
.subnav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 1.5px;
  background: var(--accent);
}
.subnav-back {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}
.subnav-back:hover { color: var(--accent-light); }

/* --- Conteneurs ---------------------------------------------- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

/* --- Page sections ------------------------------------------- */
/* Vertical longhands only: these classes are combined with .container
   ("container page-section"), and a padding shorthand here would silently
   wipe the container's horizontal padding (same specificity, later rule). */
.page-hero {
  padding-top: 80px;
  padding-bottom: 50px;
}
.page-section {
  padding-top: 50px;
  padding-bottom: 50px;
  border-top: 0.5px solid var(--border);
}
.page-section:first-of-type { border-top: none; }

/* --- Cards portfolio (data + games) -------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.portfolio-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.portfolio-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7),
              0 0 0 0.5px var(--accent-glow);
}
.portfolio-card-media {
  aspect-ratio: 16/10;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.portfolio-card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(14, 11, 14, 0.55));
}
.portfolio-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--text-dim);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.portfolio-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.portfolio-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.portfolio-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.portfolio-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-light);
  border: 0.5px solid var(--border);
  letter-spacing: 0.02em;
}

/* --- Profil / hero data -------------------------------------- */
.profile-row {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.profile-avatar::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent-tint), transparent);
}
.profile-text { flex: 1; min-width: 280px; }
.profile-name {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.profile-role {
  color: var(--accent-light);
  font-size: 0.95rem;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.profile-bio {
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 22px;
}
.profile-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.profile-meta strong {
  color: var(--text);
  font-weight: 500;
  margin-right: 4px;
}

/* --- Liste prestations --------------------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.service-card {
  padding: 22px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-out);
}
.service-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.service-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint);
  color: var(--accent-light);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 1.2rem;
}
.service-title { font-size: 1rem; margin-bottom: 6px; }
.service-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* --- Footer -------------------------------------------------- */
.page-footer {
  margin-top: 80px;
  padding: 32px;
  border-top: 0.5px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.page-footer a { color: var(--text-muted); }
.page-footer a:hover { color: var(--text); }

/* --- Formulaires (contact) ----------------------------------- */
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  font-weight: 400;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; gap: 0; } }
.form-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}
.form-message {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: none;
}
.form-message.success {
  background: rgba(58, 153, 176, 0.1);
  border: 0.5px solid var(--accent);
  color: var(--accent-light);
  display: block;
}
.form-message.error {
  background: rgba(184, 82, 106, 0.1);
  border: 0.5px solid #B8526A;
  color: #D47A8C;
  display: block;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 720px) {
  .subnav { padding: 14px 20px; }
  .subnav-links { gap: 18px; }
  .subnav-links a { font-size: 0.78rem; }
  .container, .container-narrow { padding: 0 20px; }
  .page-hero { padding-top: 50px; padding-bottom: 30px; }
  .page-section { padding-top: 35px; padding-bottom: 35px; }
  .profile-avatar { width: 100px; height: 100px; }
  .profile-name { font-size: 1.5rem; }
}
