/* ==========================================================================
   Thibault Dubois — Développeur Web Freelance
   Design system
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6fb;
  --color-surface: #ffffff;
  --color-border: #e6e8f2;
  --color-text: #12131a;
  --color-text-muted: #5b5f73;
  --color-primary: #6c4ce0;
  --color-primary-dark: #5636c9;
  --color-primary-light: #efeaff;
  --color-accent: #16b8c4;
  --color-accent-light: #e3fbfd;
  --color-success: #1fa971;
  --color-warning: #e0a72e;

  --gradient-brand: linear-gradient(135deg, #6c4ce0 0%, #8b5cf6 45%, #16b8c4 100%);
  --gradient-text: linear-gradient(120deg, #7c5cff, #16b8c4);

  --shadow-sm: 0 1px 2px rgba(18, 19, 26, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(18, 19, 26, 0.16);
  --shadow-lg: 0 24px 64px -16px rgba(18, 19, 26, 0.24);
  --shadow-glow: 0 0 0 1px rgba(108, 76, 224, 0.12), 0 12px 40px -12px rgba(108, 76, 224, 0.35);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  --container-w: 1160px;
  --nav-h: 76px;

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

[data-theme='dark'] {
  --color-bg: #0b0e16;
  --color-bg-alt: #10131d;
  --color-surface: #151926;
  --color-border: #262c3d;
  --color-text: #eef0f6;
  --color-text-muted: #9aa0b8;
  --color-primary: #8b6cff;
  --color-primary-dark: #7c5cff;
  --color-primary-light: #221c3a;
  --color-accent: #2fd8e6;
  --color-accent-light: #10262a;
  --shadow-glow: 0 0 0 1px rgba(139, 108, 255, 0.25), 0 12px 40px -12px rgba(139, 108, 255, 0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #0b0e16;
    --color-bg-alt: #10131d;
    --color-surface: #151926;
    --color-border: #262c3d;
    --color-text: #eef0f6;
    --color-text-muted: #9aa0b8;
    --color-primary: #8b6cff;
    --color-primary-dark: #7c5cff;
    --color-primary-light: #221c3a;
    --color-accent: #2fd8e6;
    --color-accent-light: #10262a;
    --shadow-glow: 0 0 0 1px rgba(139, 108, 255, 0.25), 0 12px 40px -12px rgba(139, 108, 255, 0.45);
    color-scheme: dark;
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.02em;
}
p { margin: 0 0 1em; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 10px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ---- Section rhythm ---- */
section { padding: 96px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head p { color: var(--color-text-muted); font-size: 1.05rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .25s var(--ease-out), color .25s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(108,76,224,.55); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { color: var(--color-primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.95rem;
  box-shadow: var(--shadow-glow);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-text); background: var(--color-bg-alt); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  transition: transform .3s var(--ease-out), color .2s;
}
.theme-toggle:hover { color: var(--color-primary); transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
[data-theme='dark'] .icon-moon { display: none; }
[data-theme='dark'] .icon-sun { display: block; }
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -20% -10%;
  z-index: -1;
  background:
    radial-gradient(38% 45% at 18% 20%, rgba(108,76,224,.35), transparent 70%),
    radial-gradient(45% 50% at 85% 15%, rgba(22,184,196,.28), transparent 70%),
    radial-gradient(50% 60% at 50% 100%, rgba(139,92,246,.22), transparent 70%);
  filter: blur(10px);
  animation: hero-float 18s ease-in-out infinite;
}
@keyframes hero-float {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(0,-2%,0) scale(1.05); }
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}
.hero-kicker .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success) 20%, transparent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{ opacity:1 } 50%{ opacity:.4 } }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rotator {
  display: inline-block;
  position: relative;
  width: 23ch;
  min-width: 23ch;
  height: 1.2em;
  vertical-align: bottom;
  overflow: hidden;
}
.rotator span {
  display: block;
  white-space: nowrap;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: nowrap; align-items: flex-start; }
.hero-stat { min-width: 0; }
.hero-stat > span { display: block; white-space: nowrap; }
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--color-text);
}
.hero-stat span { color: var(--color-text-muted); font-size: 0.88rem; }

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit-card {
  position: absolute;
  z-index: 1;
  width: 174px;
  min-height: 66px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: float-card 7s ease-in-out infinite;
}
.orbit-card .ic {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items:center; justify-content:center;
  background: var(--color-primary-light); color: var(--color-primary);
  flex-shrink: 0;
}
.orbit-card svg { width: 18px; height: 18px; }
.orbit-1 { top: 5%; left: 50%; margin-left: -87px; animation-delay: 0s; }
.orbit-2 { top: 27%; right: 0; animation-delay: 1.2s; }
.orbit-3 { bottom: 14%; right: 7%; animation-delay: 2.4s; }
.orbit-4 { bottom: 14%; left: 7%; animation-delay: 3.6s; }
.orbit-5 { top: 27%; left: 0; animation-delay: 4.8s; }
.orbit-6 { bottom: 1%; left: 50%; margin-left: -87px; animation-delay: 6s; }
@keyframes float-card {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}
.hero-core {
  width: 35%;
  min-width: 190px;
  max-width: 250px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-glow);
  position: relative;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  animation: core-spin 24s linear infinite;
}
.hero-core::before {
  content: '';
  position: absolute; inset: 10%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.5);
}
.hero-core .code {
  color: #fff;
  font-family: 'Space Grotesk', monospace;
  font-weight: 700;
  font-size: 1.3rem;
  animation: core-spin-rev 24s linear infinite;
}
@keyframes core-spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }
@keyframes core-spin-rev { from { transform: rotate(0deg);} to { transform: rotate(-360deg);} }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---- Trust bar ---- */
.trust-bar { padding: 32px 0; border-bottom: 1px solid var(--color-border); }
.trust-bar .container { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 10px; color: var(--color-text-muted); font-size: 0.92rem; font-weight: 600; }
.trust-item svg { width: 20px; height: 20px; color: var(--color-primary); }

/* ---- Cards / grid ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s;
  position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border)); }
.card .ic-badge {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--gradient-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
}
.card .ic-badge svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 0; }
.card ul.check-list { margin-top: 14px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 8px; }
.check-list svg { width: 18px; height: 18px; color: var(--color-success); flex-shrink: 0; margin-top: 2px; }
.card-badge {
  position: absolute; top: -12px; right: 20px;
  background: var(--color-accent); color: #04252a;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 5px 12px; border-radius: var(--radius-full);
}

/* ---- Process timeline ---- */
.timeline { position: relative; max-width: 780px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--color-border), var(--color-border)) ;
  background-image: repeating-linear-gradient(to bottom, var(--color-primary) 0 8px, transparent 8px 16px);
  opacity: .5;
}
.timeline-item { position: relative; display: flex; gap: 24px; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-num {
  flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.timeline-content h3 { font-size: 1.1rem; margin-bottom: 6px; }
.timeline-content p { color: var(--color-text-muted); font-size: 0.95rem; }

/* ---- About / bio ---- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: start; }
.avatar-card {
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: 4px;
  box-shadow: var(--shadow-glow);
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.avatar-inner {
  background: var(--color-surface);
  border-radius: calc(var(--radius-lg) - 4px);
  padding: 28px;
  text-align: center;
}
.avatar-pic {
  width: 120px; height: 120px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 2.2rem;
}
.avatar-inner h3 { margin-bottom: 4px; }
.avatar-inner .role { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.avatar-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.tag {
  font-size: 0.78rem; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--color-bg-alt); color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.social-row { display: flex; gap: 10px; justify-content: center; }
.social-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  transition: all .25s var(--ease-out);
}
.social-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: translateY(-3px); }
.social-btn svg { width: 18px; height: 18px; }

.bio-block { margin-bottom: 36px; }
.bio-block h3 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.bio-block h3 svg { width: 22px; height: 22px; color: var(--color-primary); }
.bio-block p { color: var(--color-text-muted); }

.dual-activity {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px;
}
.dual-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 20px; background: var(--color-bg-alt);
}
.dual-card .label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-primary); margin-bottom: 8px; display:block; }
.dual-card p { font-size: 0.9rem; margin-bottom: 0; color: var(--color-text-muted); }

/* ---- FAQ ---- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--color-surface);
}
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none; border: none;
  font-weight: 600; font-size: 1rem;
  text-align: left;
  color: var(--color-text);
}
.faq-q svg { width: 20px; height: 20px; color: var(--color-primary); flex-shrink: 0; transition: transform .3s var(--ease-out); }
.faq-item[open] .faq-q svg { transform: rotate(45deg); }
.faq-a { padding: 0 24px 22px; color: var(--color-text-muted); }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }

/* ---- Contact / form ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
  outline: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 12px; }

.contact-info-item { display: flex; gap: 16px; margin-bottom: 28px; }
.contact-info-item .ic {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.contact-info-item svg { width: 22px; height: 22px; }
.contact-info-item h4 { margin-bottom: 4px; font-size: 1rem; }
.contact-info-item p { color: var(--color-text-muted); margin-bottom: 0; font-size: 0.92rem; }

.map-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-top: 24px;
  aspect-ratio: 16/10;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 28px; }
.cta-band .btn-secondary { background: #fff; color: var(--color-primary-dark); border-color: transparent; }
.cta-band .btn-ghost { color: #fff; }
.cta-band .btn-ghost:hover { color: #fff; opacity: .8; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--color-border); padding: 56px 0 28px; background: var(--color-bg-alt); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: var(--color-text-muted); font-size: 0.92rem; transition: color .2s; }
.footer-col a:hover { color: var(--color-primary); }
.footer-brand p { color: var(--color-text-muted); font-size: 0.9rem; max-width: 300px; }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  color: var(--color-text-muted); font-size: 0.85rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb { padding: 20px 0 0; font-size: 0.85rem; color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { margin: 0 6px; opacity: .5; }

/* ---- Page hero (secondary pages) ---- */
.page-hero { padding: 48px 0 72px; text-align: center; }
.page-hero .eyebrow { margin-bottom: 18px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero p { color: var(--color-text-muted); max-width: 620px; margin: 0 auto; font-size: 1.08rem; }

/* ---- Legal page ---- */
.legal-content { max-width: 760px; margin: 0 auto; }
.legal-content h2 { margin-top: 40px; font-size: 1.3rem; }
.legal-content p, .legal-content li { color: var(--color-text-muted); }
.legal-content ul { margin: 12px 0; padding-left: 20px; list-style: disc; }
.article-content { max-width: 820px; padding-bottom: 80px; }
.article-cover { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius-md); margin: 0 0 36px; }
.article-content #body { font-size: 1.08rem; }
.article-content #body h2 { margin-top: 42px; }
.article-content #body p { color: var(--color-text-muted); }
.article-content #body ul { margin: 18px 0 24px; padding-left: 24px; list-style: disc; color: var(--color-text-muted); }
.article-content #body li { margin-bottom: 8px; }
.article-diagram { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 28px 0; padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-alt); }
.article-diagram strong { width: 100%; text-align: center; color: var(--color-primary); margin-bottom: 4px; }
.article-diagram span { padding: 9px 13px; border-radius: var(--radius-sm); background: var(--color-surface); border: 1px solid var(--color-border); font-size: .88rem; font-weight: 700; }
.article-diagram i { color: var(--color-primary); font-style: normal; font-size: 1.2rem; }
.article-code { overflow-x: auto; margin: 24px 0; padding: 18px; border-radius: var(--radius-sm); background: #151926; color: #d7e8ff; font: .85rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-tip { margin: 28px 0; padding: 18px 20px; border-left: 4px solid var(--color-accent); background: var(--color-accent-light); color: var(--color-text-muted); }
.article-chart { margin: 28px 0; padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-alt); }
.article-chart > strong { display: block; margin-bottom: 14px; color: var(--color-primary); }
.article-chart > div { display: grid; gap: 8px; }
.article-chart span { display: block; width: var(--bar-width, 80%); padding: 8px 12px; border-radius: 5px; background: var(--color-primary); color: #fff; font-size: .82rem; font-weight: 700; }
.article-chart span:nth-child(2) { background: var(--color-accent); }
.article-chart span:nth-child(3) { background: #4356a6; }
.article-chart span:nth-child(4) { background: #78839b; }
.article-chart b { float: right; }
.article-chart small { display: block; margin-top: 12px; color: var(--color-text-muted); font-size: .78rem; }
.article-table-wrap { overflow-x: auto; margin: 28px 0; }
.article-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: .9rem; }
.article-table th, .article-table td { padding: 12px; border: 1px solid var(--color-border); text-align: left; }
.article-table th { background: var(--color-primary); color: #fff; }
.article-table tr:nth-child(even) { background: var(--color-bg-alt); }
.article-cta { margin: 48px 0; padding: 32px; text-align: center; background: var(--color-primary-light); border-radius: var(--radius-md); }
.article-cta p { color: var(--color-text-muted); }
.comments { margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.comment { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.comment small { color: var(--color-text-muted); margin-left: 10px; }
.comment p { margin: 5px 0 0; color: var(--color-text-muted); white-space: pre-wrap; }
.comment-reply { margin-top: 8px; padding: 5px 9px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-primary); font-size: .78rem; font-weight: 700; }
.comment-replies { margin: 16px 0 0 18px; padding-left: 18px; border-left: 2px solid var(--color-border); }
.comment-form { margin-top: 28px; padding: 24px; background: var(--color-bg-alt); border-radius: var(--radius-md); }
.comment-form label { display: block; font-weight: 600; }
.comment-form input, .comment-form textarea { display: block; width: 100%; margin-top: 6px; padding: 11px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; }
.comment-form textarea { min-height: 120px; resize: vertical; }

/* ---- Responsive ---- */
@media (max-width: 1260px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; margin: 0 auto; }
}
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .avatar-card { position: static; max-width: 360px; margin: 0 auto 40px; }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 720px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .dual-activity { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 64px 0; }
  .cta-band { padding: 48px 24px; }
  .orbit-card { width: 154px; padding: 11px 12px; font-size: .76rem; gap: 8px; }
  .orbit-card .ic { width: 30px; height: 30px; }
  .orbit-2 { right: -2%; }
  .orbit-3 { right: 0; }
  .orbit-4 { left: 0; }
  .orbit-5 { left: -2%; }
}
@media (max-width: 400px) {
  .navbar .nav-actions .btn-primary.btn-sm { display: none; }
}
@media (max-width: 360px) {
  .orbit-card { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .form-card { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .hero-stat > span { font-size: 0.72rem; }
  .rotator { width: 23ch; min-width: 23ch; font-size: .82em; }
  .orbit-card { width: 138px; min-height: 54px; padding: 8px 9px; font-size: .68rem; }
  .orbit-card .ic { width: 25px; height: 25px; border-radius: 7px; }
  .orbit-card svg { width: 14px; height: 14px; }
  .orbit-1 { top: 2%; margin-left: -69px; }
  .orbit-2 { top: 24%; right: -3%; }
  .orbit-3 { bottom: 13%; right: -2%; }
  .orbit-4 { bottom: 13%; left: -2%; }
  .orbit-5 { top: 24%; left: -3%; }
  .orbit-6 { bottom: 1%; margin-left: -69px; }
}

/* ---- Mobile nav drawer ---- */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--color-bg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  transform: translateX(100%);
  transition: transform .35s var(--ease-out);
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.mobile-drawer a {
  padding: 16px 8px; font-size: 1.1rem; font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.mobile-drawer .btn { margin-top: 20px; }

/* ---- Chatbot widget ---- */
.chat-launcher {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-glow);
  display: flex; align-items: center; justify-content: center;
  animation: launcher-in .5s var(--ease-out) .3s both, launcher-bob 4s ease-in-out infinite 1.5s;
}
@keyframes launcher-in { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }
@keyframes launcher-bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-6px);} }
.chat-launcher svg { width: 28px; height: 28px; }
.chat-launcher .ping {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--color-primary);
  animation: ping 2.4s cubic-bezier(0,0,0.2,1) infinite;
  z-index: -1;
}
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
.chat-launcher .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--color-accent); color:#04252a;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-bg);
}

.chat-window {
  position: fixed; bottom: 100px; right: 24px; z-index: 300;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 140px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.chat-window.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chat-head {
  background: var(--gradient-brand);
  color: #fff;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.chat-head .info { flex: 1; }
.chat-head .info strong { display: block; font-size: 0.95rem; }
.chat-head .info span { font-size: 0.78rem; opacity: .85; display: flex; align-items: center; gap: 6px; }
.chat-head .info span .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.chat-close { background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.chat-close svg { width: 16px; height: 16px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--color-bg-alt);
}
.msg { max-width: 85%; font-size: 0.92rem; line-height: 1.5; }
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; }
.msg .bubble { padding: 12px 16px; border-radius: 16px; }
.msg-bot .bubble { background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: 4px; }
.msg-user .bubble { background: var(--gradient-brand); color: #fff; border-bottom-right-radius: 4px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-self: flex-start; max-width: 100%; }
.chip {
  background: var(--color-surface); border: 1px solid var(--color-border);
  padding: 8px 14px; border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600; color: var(--color-primary);
  transition: all .2s;
}
.chip:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.typing-indicator { display: flex; gap: 4px; padding: 14px 16px; }
.typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-muted);
  animation: typing-bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%,60%,100%{ transform: translateY(0); opacity:.4; } 30%{ transform: translateY(-5px); opacity:1; } }

.quote-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 16px; align-self: flex-start; max-width: 100%;
  box-shadow: var(--shadow-sm);
}
.quote-card h4 { font-size: 0.9rem; margin-bottom: 10px; display:flex; align-items:center; gap:8px; }
.quote-card h4 svg { width: 16px; height: 16px; color: var(--color-primary); }
.quote-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.82rem; margin-bottom: 12px; }
.quote-card dt { color: var(--color-text-muted); }
.quote-card dd { margin: 0; font-weight: 600; }

.chat-form {
  border-top: 1px solid var(--color-border);
  padding: 14px;
  display: flex; gap: 10px;
  background: var(--color-surface);
}
.chat-form input {
  flex: 1;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  padding: 12px 18px;
  font: inherit;
  color: var(--color-text);
}
.chat-form input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.chat-send {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient-brand); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-send svg { width: 18px; height: 18px; }
.chat-send:disabled { opacity: .5; }

@media (max-width: 480px) {
  .chat-window { right: 12px; left: 12px; width: auto; bottom: 92px; }
  .chat-launcher { right: 16px; bottom: 16px; }
}
