/* =========================================================
   STYLE.CSS — ePortfolio Daniel M'Bouyou
   REDESIGN: UI/UX Pro Max Skill
   Style: Motion-Driven + Minimalism + Aurora UI
   Product: Portfolio/Personal
   Colors: Monochrome + Blue accent (#2563EB)
   ========================================================= */

/* ==================== DESIGN TOKENS ==================== */
:root {
  --container: min(1200px, 92vw);

  /* === DARK THEME (default) === */
  --bg: #0d1117;
  --bg-subtle: #161b22;
  --surface: #11161d;
  --surface-hover: #1b2230;
  --surface-card: #0f141b;
  --surface-glass: rgba(13, 17, 23, 0.9);

  --text: #f0f6fc;
  --text-dim: #b8c2cc;
  --text-mute: #7d8590;

  --pri: #58a6ff;
  --pri-light: #7cc0ff;
  --pri-dark: #1f6feb;
  --pri-700: #1f6feb;
  --sec: #8b949e;
  --sec-light: #c9d1d9;
  --sec-700: #6e7681;
  --ter: #3fb950;
  --accent: #58a6ff;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  /* Typography */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --logo-filter: grayscale(1) saturate(0) contrast(1.22) brightness(0.68);
  --logo-filter-hover: grayscale(1) saturate(0) contrast(1.28) brightness(0.54);
  --logo-opacity: 0.96;
  --logo-plate-bg: #f3f4f6;
  --logo-plate-border: rgba(255,255,255,.14);

  --fs-xxs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: clamp(1.875rem, 4vw, 2.25rem);
  --fs-4xl: clamp(2.25rem, 5vw, 3rem);
  --fs-5xl: clamp(3rem, 7vw, 4.5rem);
  --fs-hero: clamp(3.5rem, 10vw, 6rem);

  /* Spacing (8px base) */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem; --sp-24: 6rem; --sp-32: 8rem;
  --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 36px; --s-7: 48px; --s-8: 72px;

  /* Radius */
  --r-sm: 2px; --r-md: 4px; --r-lg: 6px; --r-xl: 8px;
  --r-2xl: 10px; --r-3xl: 12px; --r-full: 9999px;
  --r-8: 4px; --r-10: 6px; --r-12: 8px; --r-14: 10px; --r-18: 12px; --r-22: 14px; --r-28: 16px;

  /* Shadows */
  --shadow-xs: 0 1px 0 rgba(255,255,255,.03), 0 1px 2px rgba(0,0,0,.3);
  --shadow-s: 0 1px 0 rgba(255,255,255,.03), 0 6px 18px rgba(0,0,0,.22);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.03), 0 8px 18px rgba(0,0,0,.28);
  --shadow-m: 0 14px 36px rgba(0,0,0,.34);
  --shadow-md: 0 18px 44px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 56px rgba(0,0,0,.46);
  --shadow-xl: 0 28px 72px rgba(0,0,0,.56);
  --shadow-glow: 0 0 24px rgba(88, 166, 255, 0.08);
  --b-ghost: 1px solid var(--border);
  --glow-pri: 0 0 12px rgba(88, 166, 255, 0.12);

  /* Motion */
  --t-fast: 150ms; --t-med: 200ms; --t-base: 300ms; --t-slow: 500ms;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* Z-index */
  --z-bg: 0; --z-decor: 1; --z-content: 2;
  --z-float: 100; --z-sticky: 200; --z-overlay: 300; --z-top: 400; --z-modal: 500;

  /* Header */
  --header-h: 64px;
  --header-container: min(1680px, 97vw);
}

/* === DAWN (Light) THEME === */
html[data-theme="dawn"] {
  --bg: #f6f8fa;
  --bg-subtle: #eef2f6;
  --surface: #FFFFFF;
  --surface-hover: #f1f4f8;
  --surface-card: #FFFFFF;
  --surface-glass: rgba(246, 248, 250, 0.92);

  --text: #1f2328;
  --text-dim: #4b5563;
  --text-mute: #6b7280;

  --pri: #0969da;
  --pri-light: #0969da;
  --pri-dark: #0550ae;
  --pri-700: #0550ae;
  --sec: #57606a;
  --sec-light: #6e7781;
  --sec-700: #424a53;
  --ter: #1a7f37;
  --accent: #0969da;

  --border: rgba(31, 35, 40, 0.12);
  --border-hover: rgba(31, 35, 40, 0.22);

  --shadow-xs: 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(31,35,40,.06);
  --shadow-s: 0 1px 0 rgba(255,255,255,.7), 0 8px 18px rgba(31,35,40,.07);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.7), 0 10px 22px rgba(31,35,40,.08);
  --shadow-m: 0 16px 36px rgba(31,35,40,.1);
  --shadow-md: 0 20px 44px rgba(31,35,40,.12);
  --shadow-lg: 0 26px 54px rgba(31,35,40,.14);
  --shadow-xl: 0 30px 72px rgba(31,35,40,.16);
  --shadow-glow: 0 0 24px rgba(9, 105, 218, 0.08);
  --logo-filter: grayscale(1) saturate(0) contrast(1.18) brightness(0.3);
  --logo-filter-hover: grayscale(1) saturate(0) contrast(1.24) brightness(0.18);
  --logo-opacity: 1;
  --logo-plate-bg: #ffffff;
  --logo-plate-border: rgba(31,35,40,.12);
}

/* === NIGHT THEME (alias) === */
html[data-theme="night"] {
  --bg: #0d1117;
  --bg-subtle: #161b22;
  --surface: #11161d;
  --surface-hover: #1b2230;
  --surface-card: #0f141b;
  --surface-glass: rgba(13, 17, 23, 0.9);

  --text: #f0f6fc;
  --text-dim: #b8c2cc;
  --text-mute: #7d8590;

  --pri: #58a6ff;
  --pri-light: #7cc0ff;
  --pri-dark: #1f6feb;
  --sec: #8b949e;
  --ter: #3fb950;
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at top center, color-mix(in srgb, var(--pri) 12%, transparent) 0%, transparent 34%),
    linear-gradient(to right, color-mix(in srgb, var(--border) 72%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border) 58%, transparent) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
  background-attachment: fixed;
  font: 400 var(--fs-md)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; min-height: 100vh;
}
button, input, select, textarea {
  font-family: inherit;
}
img { max-width: 100%; display: block; }
a { color: var(--pri-light); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--pri); }
.container { width: var(--container); margin-inline: auto; padding-inline: clamp(16px, 3vw, 24px); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Hide old decorative layers */
.bg-noise, .aurora, .fx-canvas, .cursor, .cursor-core { display: none; }

/* ==================== HEADER ==================== */
.header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,.02);
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.header .container {
  width: var(--header-container);
  max-width: none;
}
html[data-theme="night"] .header { background: var(--surface-glass); }
.header__row {
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h); padding: 0;
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; min-width: max-content; text-decoration: none; }
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-sm);
  background: var(--pri);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pri) 45%, transparent);
}
.brand-text {
  font: 700 var(--fs-xs)/1 var(--mono);
  letter-spacing: .08em;
  color: var(--text);
  white-space: nowrap;
  text-transform: uppercase;
}
.brand-text::after {
  content: "_";
  color: var(--pri);
  margin-left: .16em;
}
.header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }

/* ==================== BUTTONS ==================== */
.btn {
  --btn-bg: var(--text); --btn-bg2: color-mix(in srgb, var(--text) 88%, #000 12%); --btn-txt: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); border: 1px solid color-mix(in srgb, var(--border-hover) 84%, transparent); cursor: pointer;
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--btn-bg), var(--btn-bg2));
  color: var(--btn-txt); font: 700 var(--fs-xs)/1 var(--mono);
  letter-spacing: .06em; text-transform: uppercase;
  box-shadow: var(--shadow-xs); white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden;
  touch-action: manipulation;
  transition: all var(--t-base) var(--ease);
}
.btn:hover {
  transform: translateY(-1px); color: var(--btn-txt);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn--ghost {
  --btn-bg: transparent; --btn-bg2: transparent; --btn-txt: var(--text);
  background: transparent; color: var(--text);
  border: 1px solid var(--border); box-shadow: none;
}
.btn--ghost:hover {
  background: var(--surface-hover); border-color: var(--border-hover);
  box-shadow: var(--shadow-sm); color: var(--text); transform: translateY(-1px);
}
.btn--sm { padding: 10px 12px; font-size: .72rem; border-radius: var(--r-sm); }
.btn .ico { width: 16px; height: 16px; display: inline-block; }
.btn:hover .ico { transform: translateX(1px); }
.btn::after { display: none; }

/* Scroll progress */
.scroll-progress { height: 2px; width: 0%; background: linear-gradient(90deg, var(--pri), color-mix(in srgb, var(--pri) 55%, var(--text) 45%)); opacity: .9; }

/* ==================== NAV HALO ==================== */
.halo ul, .halo__items { list-style: none; margin: 0; padding: 0; }
.halo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin-inline: clamp(20px, 4vw, 56px) 0;
}
.halo--compact { padding: 0; }
.halo__items { display: flex; align-items: center; justify-content: center; gap: 0; }
.halo__items li { display: flex; align-items: center; min-width: 0; }
.halo__items li + li::before {
  content: "//";
  display: inline-flex;
  align-items: center;
  margin-inline: clamp(10px, 1.8vw, 18px);
  color: var(--text-mute);
  font: 700 var(--fs-xs)/1 var(--mono);
  letter-spacing: .08em;
}
.halo__items a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  color: var(--text-dim);
  font: 600 .78rem/1 var(--mono);
  letter-spacing: .06em;
  text-transform: lowercase;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.halo__items a:hover { color: var(--text); background: transparent; }
.halo__items a.is-active {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}
.halo__items a.is-active::after {
  content: "_";
  color: var(--pri);
  margin-left: 3px;
}
.halo__glow, .halo__underline, .halo::after { display: none; }

/* ==================== BADGE ==================== */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 7px 10px; border-radius: var(--r-md);
  font: 700 .7rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); color: var(--text-dim);
}
.badge .dot { width: 6px; height: 6px; border-radius: 1px; background: var(--ter); }
.badge span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== NAV RAIL (sidebar) ==================== */
.nav-rail { position: fixed; right: 16px; top: 120px; z-index: var(--z-float); }
.rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.rail a {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-mute); font-size: var(--fs-sm); transition: all var(--t-base) var(--ease);
}
.rail a:hover { color: var(--text); border-color: var(--border-hover); }
.rail .ico { width: 18px; height: 18px; display: inline-block; transition: transform .5s var(--ease); }
.rail a:hover .ico { transform: rotate(18deg) scale(1.04); }
.rail a.is-active {
  color: var(--text); border-color: var(--pri); box-shadow: var(--shadow-glow); position: relative;
}
.rail a.is-active::before {
  content: ""; position: absolute; left: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pri); box-shadow: 0 0 10px var(--pri);
}
@keyframes pulseDot { 50% { transform: scale(1.4); opacity: .65; } }

/* ==================== SECTIONS & GRID ==================== */
.section { padding-block: clamp(48px, 8vh, 96px); }
.section-header { margin-bottom: var(--sp-8); }
.section-title {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.02em; color: var(--text);
}
.section-title .spark { display: none; }
.section-lead { color: var(--text-dim); margin: var(--sp-2) 0 0; font-size: var(--fs-lg); }
.grid { display: grid; gap: clamp(16px, 2.5vw, 24px); }
@media (min-width: 720px) {
  .grid--12 { grid-template-columns: repeat(12, 1fr); }
  .col-4 { grid-column: span 4; }
  .col-6 { grid-column: span 6; }
  .col-8 { grid-column: span 8; }
}

/* ==================== CARDS ==================== */
.card {
  position: relative; overflow: clip; padding: clamp(20px, 2.5vw, 28px);
  border-radius: var(--r-xl); border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-card) 96%, transparent), var(--surface-card));
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-hover); }
.card-title { margin: 0 0 var(--sp-2); font-size: var(--fs-xl); font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.card-text { color: var(--text-dim); }
.card .card-link { display: inline-flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); color: var(--pri-light); font-weight: 500; font-size: var(--fs-sm); }
.card .card-link:hover { color: var(--pri); }
.card::before, .card::after { display: none; }

/* ==================== HERO (generic) ==================== */
.hero { display: grid; gap: var(--sp-8); align-items: start; padding-block: clamp(80px, 15vh, 140px); }
@media (min-width: 860px) { .hero { grid-template-columns: 5fr 7fr; } }
.hero-portrait { position: relative; }
.hero-portrait .portrait-img { width: 100%; border-radius: var(--r-2xl); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.hero-portrait::before, .hero-portrait::after { display: none; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: 700 var(--fs-xs)/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pri-light);
  border: 0;
  border-radius: 0;
  background: transparent;
}
.kicker::before {
  content: "//";
  color: var(--text-mute);
}
.title {
  margin: .2em 0 .1em; font-size: var(--fs-5xl); line-height: 1.05; letter-spacing: -0.03em;
  color: var(--text); font-weight: 800;
}
.tagline { color: var(--text-dim); font-size: var(--fs-lg); max-width: 60ch; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.hero .btn { padding: 10px 14px; font-size: var(--fs-sm); }
.section--ghost { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.inline { position: relative; padding-bottom: 1px; border-bottom: 1px solid var(--border-hover); }
.inline::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 0%; background: linear-gradient(90deg, var(--pri), var(--sec)); }
.inline:hover::after { width: 100%; }

/* ==================== CONTACT ==================== */
.contact-grid .contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.input, .textarea {
  width: 100%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text); font-family: var(--mono); font-size: var(--fs-sm); outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:focus, .textarea:focus { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 18%, transparent); }
.textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.form-row label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-dim); }
.form-actions { display: flex; align-items: center; gap: var(--sp-4); }
.form-status { color: var(--text-dim); font-size: var(--fs-sm); }
.mt2 { margin-top: 8px; } .small { font-size: var(--fs-sm); }

/* ==================== FOOTER ==================== */
.footer { padding-block: var(--sp-12); color: var(--text-mute); border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-sm); }
.footer-social { display: flex; gap: var(--sp-4); }
.footer .social { color: var(--text-mute); font-weight: 500; transition: color var(--t-fast) var(--ease); }
.footer .social:hover { color: var(--text); }

/* ==================== CHATBOT ==================== */
.chatbot { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: var(--z-float); }
.chatbot-btn {
  width: 48px; height: 48px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-md); font-size: 1.2rem;
  display: grid; place-items: center; transition: all var(--t-base) var(--ease);
}
.chatbot-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.chatbot-panel {
  position: absolute; right: 0; bottom: 60px; width: min(420px, 90vw);
  border-radius: var(--r-xl); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-xl); overflow: hidden; display: none;
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.chatbot-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4); border-bottom: 1px solid var(--border); font-weight: 600; }
.chatbot-close { background: none; border: none; color: var(--text-mute); cursor: pointer; font-size: var(--fs-lg); }
.chatbot-close:hover { color: var(--text); }
.chatbot-log { max-height: 40vh; overflow: auto; padding: var(--sp-4); }
.chatbot-form { display: flex; gap: var(--sp-2); padding: var(--sp-3); border-top: 1px solid var(--border); }

/* ==================== MODAL ==================== */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal__panel { width: min(520px, 92vw); border-radius: var(--r-2xl); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xl); }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.modal__body { padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.modal__close { background: none; border: none; color: var(--text-mute); cursor: pointer; font-size: var(--fs-lg); }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ==================== SCROLL REVEAL ==================== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-stagger] > * { opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }

/* ==================== GSAP PAGE TRANSITIONS ==================== */
.page-wipe {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  transform-origin: top center;
  pointer-events: none;
}

/* --- Initial hidden states for GSAP-animated elements --- */
/* Heroes: GSAP handles visibility via inline style, no CSS hiding */

/* Section / card reveal: start invisible, GSAP sets inline opacity */
.gsap-ready [data-gsap-reveal] { opacity: 0; transform: translateY(40px); }
.gsap-ready [data-gsap-reveal].gsap-visible { opacity: 1 !important; transform: none !important; }

/* Character reveal for typing titles */
.char-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  will-change: opacity, transform;
  color: var(--text);
}

/* Custom cursor (global) */
.cursor-follow,
.cursor-follow-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-follow {
  width: 36px;
  height: 36px;
  background: rgba(88, 166, 255, 0.35);
  opacity: 0.35;
  will-change: transform, opacity, width, height;
}
.cursor-follow-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  will-change: transform;
}
@media (hover: none), (pointer: coarse) {
  .cursor-follow,
  .cursor-follow-dot { display: none !important; }
}

/* Scroll progress gradient */
.scroll-progress {
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--pri), #a78bfa, var(--pri-light));
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

/* Section title gradient underline */
.section-title {
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--pri), #a78bfa);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.2);
}

/* Footer link underlines */
.footer .social { position: relative; }
.footer .social::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--pri), #a78bfa);
  transition: width 0.4s var(--ease);
}
.footer .social:hover::after { width: 100%; }

/* Loading skeleton (global) */
.skeleton-pulse {
  background: linear-gradient(90deg,
    var(--surface-card) 25%,
    color-mix(in srgb, var(--surface-hover) 80%, var(--pri) 20%) 50%,
    var(--surface-card) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
  border-radius: var(--r-md);
}
.skeleton-card {
  min-height: 200px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
}
.skeleton-cert {
  min-height: 52px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Global loading spinner ---- */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: clamp(40px, 8vh, 80px) var(--sp-4);
  text-align: center;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--pri);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-indicator p {
  font: 600 var(--fs-sm)/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.loading-indicator .loading-sub {
  font-weight: 400;
  font-size: var(--fs-xs);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-mute);
}

/* Fade-in for dynamically loaded content */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.gsap-content-enter {
  animation: contentFadeIn 0.6s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
  .page-wipe { display: none !important; }
  .char-reveal { opacity: 1 !important; transform: none !important; }
  .cursor-follow, .cursor-follow-dot { display: none !important; }
  .skeleton-pulse { animation: none !important; }
  .gsap-content-enter { animation: none !important; }
  .loading-spinner { animation-duration: 1.5s !important; }
  [data-gsap-reveal] { opacity: 1 !important; transform: none !important; }
}
[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }

/* ==================== A11Y ==================== */
:focus-visible { outline: 2px solid var(--pri); outline-offset: 3px; border-radius: var(--r-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  [data-reveal], [data-stagger] > * { opacity: 1 !important; transform: none !important; }
}

/* ==================== MOBILE HAMBURGER ==================== */
.menu-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  width: 44px; height: 44px; padding: 0; background: transparent; border: none;
  cursor: pointer; color: var(--text); z-index: var(--z-overlay); touch-action: manipulation;
}
.menu-toggle__icon {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; position: relative; transition: background var(--t-fast);
}
.menu-toggle__icon::before, .menu-toggle__icon::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px; transition: transform var(--t-base) var(--ease);
}
.menu-toggle__icon::before { top: -7px; }
.menu-toggle__icon::after { bottom: -7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after { bottom: 0; transform: rotate(-45deg); }

/* Mobile menu drawer */
.mobile-menu {
  position: fixed; top: 0; left: 0; width: 300px; max-width: 85vw; height: 100vh;
  background: color-mix(in srgb, var(--bg-subtle) 94%, transparent); z-index: var(--z-overlay); overflow-y: auto;
  display: flex; flex-direction: column; padding-top: calc(var(--header-h) + var(--sp-4));
  transform: translateX(-100%); transition: transform var(--t-base) var(--ease);
  border-right: 1px solid var(--border);
}
.mobile-menu:not([hidden]) { transform: translateX(0); }
.mobile-menu__list { list-style: none; display: flex; flex-direction: column; }
.mobile-menu__item {
  display: flex; align-items: center; gap: 10px; padding: var(--sp-4) var(--sp-6); color: var(--text);
  text-decoration: none; font: 600 .9rem/1 var(--mono); letter-spacing: .05em; text-transform: lowercase;
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--border);
  text-align: left; transition: all var(--t-fast) var(--ease); position: relative; touch-action: manipulation;
}
.mobile-menu__item::before {
  content: '//';
  position: static;
  height: auto;
  width: auto;
  background: none;
  transform: none;
  color: var(--text-mute);
  font: 700 .84rem/1 var(--mono);
  transition: color var(--t-fast) var(--ease);
}
.mobile-menu__item:hover { background: var(--surface-hover); padding-left: var(--sp-6); }
.mobile-menu__item:hover::before { transform: none; color: var(--pri); }
.mobile-menu__item--button { appearance: none; text-transform: none; cursor: pointer; }

/* Overlay */
.mobile-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: calc(var(--z-overlay) - 1); opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.mobile-overlay:not([hidden]) { opacity: 1; pointer-events: auto; }

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text); cursor: pointer; font-size: 0;
  transition: all var(--t-fast) var(--ease); flex-shrink: 0; touch-action: manipulation;
}
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.theme-toggle__icon { font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1023px) {
  .halo { display: none !important; }
  .nav-rail { display: none !important; }
  .menu-toggle { display: flex; }

  /* Compact header actions on mobile */
  #btn-guest { display: none; }
  #btn-login-li { padding: 8px 10px; font-size: .66rem; gap: 0; }
  #btn-login-li .ico { display: none; }
  #login-name { display: none !important; }
  .header__actions { gap: 4px; }
  .theme-toggle { display: none; }
}
@media (min-width: 1024px) {
  .header__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(16px, 2vw, 30px);
  }
  .header__actions {
    margin-left: 0;
    justify-self: end;
    min-width: max-content;
  }
  .header .btn--sm {
    padding: 9px 10px;
    font-size: .68rem;
  }
  #login-name {
    max-width: min(18vw, 270px);
  }
  .halo { display: flex !important; }
  .halo {
    width: 100%;
    margin-inline: 0;
    justify-content: flex-start;
    overflow: hidden;
  }
  .halo__items {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .halo__items::-webkit-scrollbar { display: none; }
  .halo__items li + li::before {
    margin-inline: clamp(8px, 1.2vw, 14px);
  }
  .halo__items a {
    font-size: .74rem;
  }
  .menu-toggle { display: none; }
  .mobile-menu, .mobile-overlay { display: none !important; }
  .nav-rail { display: flex; }
}
@media (max-width: 900px) { .nav-rail { display: none; } .title { font-size: clamp(2rem, 7vw, 3rem); } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 56px 36px; gap: 18px; }
  .hero-portrait { max-width: 360px; margin: 0 auto 12px; }
  .hero .btn { min-height: 46px; padding: 12px 14px; border-radius: 12px; }
}
@media (max-width: 720px) {
  .section { padding-block: 32px; }
  .grid--12 { grid-template-columns: 1fr; }
  .col-4, .col-6, .col-8 { grid-column: auto; }
  .card { padding: 16px; border-radius: 16px; }
}
@media (hover: none) { .card:hover { transform: none; } }
@media (pointer: coarse) { .btn { min-height: 44px; } .input, .textarea { min-height: 44px; } }
@media (max-width: 540px) {
  .kicker { font-size: .68rem; padding: 4px 8px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chatbot { right: 12px; bottom: 12px; }
  .container { padding-inline: var(--sp-4); }
  .hero { grid-template-columns: 1fr; padding-block: 32px 24px; gap: 16px; }
  .hero-portrait { max-width: 240px; margin: 0 auto 8px; }
  .hero .btn { min-height: 44px; padding: 10px 12px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .card { padding: 14px; border-radius: 12px; }
  .input, .textarea { min-height: 44px; font-size: 16px; }
}
@media (min-width: 541px) and (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding-block: 40px 28px; gap: 20px; }
  .hero-portrait { max-width: 320px; margin: 0 auto 12px; }
  .grid--12 { grid-template-columns: repeat(2, 1fr); }
  .col-4, .col-6 { grid-column: auto; }
  .col-8 { grid-column: 1 / -1; }
}
@media (min-width: 769px) and (max-width: 1023px) {
  .hero { grid-template-columns: 1fr 1.1fr; padding-block: 48px 36px; }
  .hero-portrait { max-width: 380px; }
  .grid--12 { grid-template-columns: repeat(3, 1fr); }
  .col-6 { grid-column: span 2; }
}
@supports (padding: max(0px)) { body { padding-bottom: max(0px, env(safe-area-inset-bottom)); } }

/* ============================================================
   TIMELINE PAGE (ENGINEERING) — SCOPED STYLES
   ============================================================ */
.page-timeline {
  --railW: 120px; --ecw: 1200px;
  --padX: clamp(16px, 2vw, 28px);
  --space-section: clamp(140px, 14vh, 180px);
  --space-card: clamp(40px, 5vh, 60px);
  --cardMax: 860px; --cardPct: 68%;
  --tl-radius: var(--r-2xl); --tl-shadow: var(--shadow-lg);
  --tl-border: var(--border); --tl-glass: var(--surface-card);
  --tl-glass2: var(--surface); --tl-muted: var(--text-dim);
  --tl-txt: var(--text); --tl-accent: var(--pri);
}
.page-timeline #journey.timeline { position: relative; padding-left: calc(var(--railW) + 28px); }
.page-timeline .timeline.container { width: min(100%, var(--ecw)); margin-inline: auto; }
.page-timeline .timeline-rail { position: fixed; top: 96px; left: calc((100vw - var(--ecw))/2 + 8px); width: var(--railW); z-index: 10; pointer-events: auto; }
.page-timeline .rail { position: relative; list-style: none; margin: 0; padding: 0; }
.page-timeline .rail::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%); background: linear-gradient(180deg, var(--pri), var(--sec));
  opacity: 0.3; border-radius: 2px;
}
.page-timeline .rail__node { position: relative; display: grid; place-items: center; gap: 6px; min-height: 120px; text-align: center; color: var(--tl-muted); }
.page-timeline .rail__dot {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-full);
  background: var(--surface); border: 2px solid var(--border);
  font-weight: 700; font-size: var(--fs-xs); color: var(--text);
  transition: all var(--t-base) var(--ease);
}
.page-timeline .rail__label { font-size: var(--fs-xs); letter-spacing: .3px; opacity: .7; }
.page-timeline .rail__arrow { font-size: 18px; line-height: 1; opacity: .5; }
@keyframes tlArrow { 0% { transform: translateY(-3px); } 50% { transform: translateY(3px); } 100% { transform: translateY(-3px); } }
.page-timeline .rail__node.is-active .rail__dot {
  transform: scale(1.1); background: var(--pri); border-color: var(--pri); color: #fff;
  box-shadow: var(--shadow-glow);
}
.page-timeline .rail__node.is-active .rail__label { color: var(--tl-txt); opacity: 1; font-weight: 600; }
.page-timeline .rail__node:last-child .rail__arrow { display: none; }
.page-timeline .chapter {
  position: relative; padding: clamp(32px, 7vw, 64px) var(--padX);
  margin: var(--space-section) 0; color: var(--tl-txt);
  border-radius: var(--r-xl); background: var(--bg-subtle); border: 1px solid var(--border);
}
.page-timeline .chapter__wrap { width: min(100%, var(--ecw)); margin-inline: auto; }
.page-timeline .chapter__header { margin-bottom: clamp(18px, 3vw, 28px); }
.page-timeline .chapter__title { font-size: clamp(28px, 4.2vw, 44px); margin: 0 0 .35rem 0; font-weight: 700; letter-spacing: -0.02em; }
.page-timeline .chapter__lead { color: var(--tl-muted); margin: 0; }
.page-timeline .chapter::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(1000px 500px at 50% -10%, rgba(255,255,255,.02), transparent 70%);
}
.page-timeline .chapter[data-theme="origin"] { background: var(--bg-subtle); }
.page-timeline .chapter[data-theme="prepa"] { background: var(--bg-subtle); }
.page-timeline .chapter[data-theme="diplomas"] { background: var(--bg-subtle); }
.page-timeline .chapter[data-theme="s5"] { background: var(--bg-subtle); }
.page-timeline .chapter[data-theme="s6"] { background: var(--bg-subtle); }
.page-timeline .origin-cloud {
  width: min(100%, 980px); min-height: clamp(240px, 42vh, 440px);
  margin: var(--sp-8) auto; border-radius: var(--r-3xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden; display: grid; place-items: center; padding: var(--sp-6);
}
.page-timeline .badges.badges--center { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.page-timeline .badge {
  padding: 6px 10px; border-radius: 10px; font-size: 12.5px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.page-timeline .origin-cloud__hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--tl-muted); opacity: .85; }
.page-timeline .triptych { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(12px, 2vw, 24px); align-items: stretch; }
.page-timeline .triptych__item {
  position: static !important; inset: auto !important; transform: none !important; z-index: auto !important;
  width: 100% !important; aspect-ratio: 4 / 3; border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.page-timeline .triptych__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1000px) { .page-timeline .triptych { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .page-timeline .triptych { grid-template-columns: 1fr; } }
.page-timeline .lane { display: grid; justify-items: start; row-gap: var(--space-card); }
.page-timeline .card {
  background: var(--tl-glass); border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius); box-shadow: var(--tl-shadow);
  padding: clamp(16px, 2.4vw, 26px); width: min(var(--cardMax), var(--cardPct));
}
.page-timeline .card__title { font-size: clamp(20px, 2.6vw, 26px); margin: 0 0 .4rem 0; }
.page-timeline .card__text { color: var(--tl-txt); opacity: .92; margin: 0 0 .6rem 0; }
.page-timeline .card-media {
  position: relative; width: 100%; border-radius: var(--r-lg); overflow: hidden;
  background: var(--tl-glass2); border: 1px solid var(--tl-border); box-shadow: var(--tl-shadow);
  margin-bottom: 12px; aspect-ratio: 16 / 9;
}
.page-timeline .card-media[data-aspect="4x3"] { aspect-ratio: 4 / 3; }
.page-timeline .card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-timeline .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.page-timeline .timeline .btn {
  --btn-bg: var(--pri); --btn-bg2: var(--pri-dark); --btn-txt: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none;
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--btn-bg), var(--btn-bg2));
  color: var(--btn-txt); box-shadow: var(--shadow-sm);
}
.page-timeline .timeline .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.page-timeline .timeline .btn--ghost {
  --btn-txt: var(--tl-txt);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  color: var(--btn-txt); border: 1px solid var(--border); box-shadow: none;
}
.page-timeline .chips { list-style: none; padding: 0; margin: .6rem 0 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.page-timeline .chip {
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full); font-size: var(--fs-xs);
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border);
}
.page-timeline .media-2up { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: .8rem 0 .4rem 0; }
.page-timeline .media {
  display: block; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--tl-border); background: var(--tl-glass2); box-shadow: var(--tl-shadow);
}
.page-timeline .media img { width: 100%; height: auto; object-fit: cover; transform: translateZ(0); transition: transform .5s var(--ease); }
.page-timeline .media:hover img { transform: scale(1.03); filter: saturate(1.05) contrast(1.02); }
.page-timeline .skeleton {
  position: relative; padding: 12px; border-radius: 12px;
  background: linear-gradient(90deg, var(--surface), var(--surface-hover), var(--surface));
  background-size: 300% 100%; color: transparent;
}
.page-timeline .skeleton__line { width: 100%; height: 12px; border-radius: var(--r-full); margin: 10px 0; background: var(--border); }
@keyframes tlShimmer { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
.page-timeline .header { position: sticky; top: 0; z-index: 20; }
.page-timeline .header .header__row { width: min(100%, var(--ecw)); margin-inline: auto; padding-inline: var(--padX); }
.page-timeline .footer { border-top: 1px solid var(--tl-border); margin-top: var(--space-section); padding: 24px var(--padX); color: var(--tl-muted); }
.page-timeline .footer-inner { width: min(100%, var(--ecw)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.page-timeline .footer-nav a { color: var(--tl-muted); text-decoration: none; margin-right: 12px; }
.page-timeline .footer-nav a:hover { color: var(--tl-txt); }
@media (max-width: 1200px) { .page-timeline .timeline-rail { left: max(8px, 1.2vw); } }
@media (max-width: 980px) {
  .page-timeline #journey.timeline { padding-left: var(--padX); }
  .page-timeline .timeline-rail { position: sticky; top: 64px; left: 0; width: 100%; }
  .page-timeline .rail { display: flex; align-items: center; gap: 14px; padding: 10px var(--padX); }
  .page-timeline .rail::before { display: none; }
  .page-timeline .rail__node { min-height: auto; }
  .page-timeline .rail__dot { width: 34px; height: 34px; }
  .page-timeline .rail__arrow { display: none; }
  .page-timeline .card { width: 100%; }
  .page-timeline .media-2up { grid-template-columns: 1fr; }
}
.page-timeline a:focus-visible, .page-timeline button:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 8px; }
