:root {
  /* Mercury / Liquid Void Theme Variables */
  --void: #020617;
  /* Fond Principal */
  --deep-slate: #1e293b;
  /* Fond Secondaire */
  --mercury-base: #e2e8f0;
  /* Texte Principal */
  --mercury-shadow: #94a3b8;
  /* Texte Secondaire */
  --mercury-shine: #ffffff;
  /* Accent & Lumière */
  --accent-color: #00f3ff;
  /* Cyan électrique */
  --accent-glow: rgba(0, 243, 255, 0.4);
  --accent-secondary: #7000ff; /* Purple accent for bento variety */
  --header-bg: rgba(2, 6, 23, 0.8);

  /* Mapped Variables for Existing Code */
  --bg: var(--void);
  --bg-gradient: radial-gradient(circle at 50% 50%, #1e293b, #020617);
  --text-main: var(--mercury-base);
  --text-muted: var(--mercury-shadow);

  /* Liquid Glass Card Variables */
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  /* Bordures Subtiles */
  --card-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 20px 40px rgba(0, 0, 0, 0.6);
  --radius: 30px;
  /* Arrondis organiques */

  --accent: var(--accent-color);
  --accent-600: #00bcd4;
  /* Darker cyan */
  --glass: rgba(255, 255, 255, 0.03);

  --container: 1350px;

  /* Fonts */
  --font-main: 'Inter', sans-serif;
  --font-data: 'JetBrains Mono', monospace;
}

/* Force Dark Mode - No Light Mode allowed for this theme */
html[data-theme="light"] {
  /* Override to force dark mode values even if light is selected */
  --bg: #020617;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
}

/* ... existing code ... */

/* unified link styles (Contact same as others) */
.nav-top .nav-link,
.nav-top .btn-contact,
.nav-link {
  color: var(--text-muted);
  /* Fixed typo variable */
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  transition: color .15s, background .15s, transform .12s;
  font-size: clamp(0.85rem, 2.8vw, 1rem);
}

/* ... existing code ... */

/* hero */
.hero-section {
  padding: 5.5rem 0 3.5rem;
  text-align: center;
  background: var(--hero-bg-gradient);
  /* Use variable */
}

/* ... existing code ... */

.hero-desc {
  color: var(--text-muted);
  /* Use variable */
  margin-top: 1rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  /* Enforces centering */
}

/* ... existing code ... */

.btn-ghost {
  border: 1px solid var(--card-border);
  /* Use variable */
  padding: .55rem .9rem;
  border-radius: 10px;
  color: var(--text-muted);
  /* Use variable */
}

/* ... existing code ... */

/* Remove duplicate hardcoded card rule and ensure the main one works */
/* cards - updated for transparency */
/* The previous duplicate definition at lines 287-299 should be DELETED or MERGED into the main one. 
   Since I cannot easily delete a block far away in one go without context, I will just make sure this
   definition uses variables if it overwrites the previous one. */
/* Liquid Glass Cards */
.card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.4rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.3s;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* 3D Tilt Init */
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card i.icon-accent {
  color: var(--accent);
  margin-bottom: 1rem;
  width: 24px;
  height: 24px;
}

/* Mouse Follow Glare Effect (Dynamic) */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius);
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.06),
      transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 2;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Liquid Void Background Blobs */
.blob {
  position: absolute;
  background: var(--accent-color);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  z-index: -2;
  /* Behind valid canvas */
  animation: drift 20s infinite alternate;
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(30px, 30px);
  }
}

/* Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Behind everything */
  pointer-events: none;
  /* Let clicks pass through */
}

/* fonts */
html {
  background: var(--bg);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: transparent;
  /* Make body transparent for canvas */
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Ensure content sits above canvas */
.site-header,
main,
footer {
  position: relative;
  z-index: 10;
}

/* Canvas positioning */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* Behind content */
  pointer-events: none;
}

h1,
h2,
.section-title {
  font-family: 'Poppins', sans-serif;
}

/* layout container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem;
}

/* header: centered nav on one line */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 70;
  background: var(--header-bg);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
}

/* ... (context skipped) ... */

/* cards - updated for transparency */
.card {
  position: relative;
  /* Ensure z-index works */
  background: var(--card);
  /* Themed */
  /* More transparent */
  border: 1px solid var(--card-border);
  padding: 1.4rem;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  /* Blurring the background particles */
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s;
  z-index: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.3rem 0;
  position: relative;
}

.header-left {
  position: absolute;
  left: 1rem;
  width: 120px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* top nav (always visible, forced single-line) */
.nav-top {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.3rem 0;
}

/* hide scrollbar visually while keeping scroll on very narrow screens */
.nav-top::-webkit-scrollbar {
  height: 6px;
}

.nav-top::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

/* unified link styles (Contact same as others) */
.nav-top .nav-link,
.nav-top .btn-contact,
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  transition: color .15s, background .15s, transform .12s;
  font-size: clamp(0.85rem, 2.8vw, 1rem);
}

.nav-top .nav-link:hover,
.nav-top .btn-contact:hover,
.nav-link:hover {
  color: var(--text-main);
  background: rgba(96, 165, 250, 0.05);
  transform: translateY(-2px);
}

/* Nav Controls (Lang & Theme) */
.nav-select,
.nav-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.nav-select:hover,
.nav-btn:hover {
  background: var(--glass);
  border-color: var(--accent);
}

.nav-select option {
  background: var(--bg);
  color: var(--text-main);
}


/* hero */


.hero-inner {
  max-width: 1200px;
  /* Increased from 980px to fit single line title */
  margin: 0 auto;
  padding: 0 1rem;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 3.5rem);
  /* Adjusted scaling */
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  text-align: center;
}

/* Force single line on desktop */
@media (min-width: 1024px) {
  .hero-title {
    white-space: nowrap;
  }
}

.hero-sub {
  color: var(--accent);
  margin-top: .6rem;
  font-weight: 600;
  text-align: center;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
}



/* actions */
.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-600));
  color: var(--bg);
  padding: .6rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: transform .18s, box-shadow .18s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: .55rem .9rem;
  border-radius: 10px;
  color: var(--text-muted);
}

/* animations */
html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  /* Enable vertical scroll snapping */
  height: 100vh;
  /* Ensure html takes full height for snap to work */
  overflow-y: scroll;
}

/* sections & grid */
.section {
  min-height: 100vh;
  /* Full viewport height */
  scroll-snap-align: start;
  /* Snap to top of section */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Vertically center content */
  padding: 2rem 0;
  /* Reduced padding since we center content */
  box-sizing: border-box;
}

/* hero specific override if needed, but .section rules covering mostly. 
   Hero has separate class .hero-section */
.hero-section {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  /* Reset padding to let flex center it */
  text-align: center;
  background: var(--hero-bg-gradient);
}

.section-title {
  font-size: clamp(1.05rem, 3.2vw, 1.6rem);
  margin-bottom: 3rem;
  /* Increased spacing to prevent hover overlap */
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  text-align: center;
}

/* cards - updated for transparency */


.card:hover {
  background: rgba(30, 40, 60, 0.55);
  transform: translateY(-8px);
  /* Slightly more pronounced lift */
  border-color: var(--accent);
  z-index: 10;
  /* Bring to front on hover */
}

.grid-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Increased min-width for wider cards */
}

/* Wide Layout for Skills & Contact */
.wide-layout {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.card:nth-child(1) { grid-column: span 3; }
.card:nth-child(2) { grid-column: span 3; }
.card:nth-child(3) { grid-column: span 6; }

@media (max-width: 1024px) {
  .wide-layout {
    grid-template-columns: repeat(4, 1fr);
  }
  .card:nth-child(1), .card:nth-child(2) { grid-column: span 2; }
  .card:nth-child(3) { grid-column: span 4; }
}

@media (max-width: 768px) {
  .wide-layout {
    grid-template-columns: 1fr;
  }
  .card:nth-child(1), .card:nth-child(2), .card:nth-child(3) { grid-column: span 1; }
}

.wide-card {
  width: 100%;
  padding: 2.5rem;
  /* Spacious padding */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Ensure content inside wide cards is well distributed */
.wide-card .bullets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  /* Internal columns for list items */
  gap: 1.5rem;
}

.wide-card .card-title-sm {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

/* Mobile Adjustments for Wide Layout */
@media (max-width: 768px) {
  .wide-card {
    padding: 1.5rem;
  }

  .wide-card .bullets {
    grid-template-columns: 1fr;
    /* Stack internally on small screens */
  }
}

/* Remove old overrides that might conflict */
#competences .wide-layout,
#contact .wide-layout {
  display: flex;
}


@media (min-width: 1100px) {

  /* On very large screens, allow side-by-side but still wide */
  #competences .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}


/* Competences: Default Left Alignment */
#competences .card {
  min-width: 0;
  /* Remove fixed width */
  flex-shrink: 1;
  scroll-snap-align: none;
  text-align: left;
  display: flex;
  flex-direction: column;
}

#competences .card-title-sm {
  text-align: left;
}

/* Experience: Strict Vertical List & Centered Text */
/* Experience: Timeline Layout now controlled by timeline.css */
/* Legacy grid/center styles removed */


/* Scrollbar styling removed as no longer needed for layout */
#competences ::-webkit-scrollbar {
  height: 8px;
}

#competences ::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

#competences ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

/* typography */
.card-title {
  font-weight: 700;
  margin-bottom: .25rem;
  font-size: 1rem;
  text-align: left;
}

.card-title-sm {
  font-weight: 700;
  margin-bottom: .5rem;
  font-size: 1.02rem;
}

.muted {
  color: var(--text-muted);
  text-align: left;
}

/* forms */
.label {
  display: block;
  margin-bottom: .6rem;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: .6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: inherit;
  margin-top: .35rem;
}

/* bullets */
.bullets {
  color: var(--text-muted);
  margin-top: .5rem;
}

.bullets li {
  margin-bottom: .45rem;
  line-height: 1.45;
}

/* linkedin CTA (aside) */
/* linkedin Profile Card */
.linkedin-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.linkedin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.linkedin-icon-wrapper {
  background: rgba(255, 255, 255, 0.05);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.linkedin-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.linkedin-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.linkedin-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.btn-linkedin-full {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  background: #0077b5;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.btn-linkedin-full:hover {
  background: #006097;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 119, 181, 0.4);
}

/* divider */
.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.03), transparent);
  margin: 1rem 0;
}

/* Form Styles refined */
.required-star {
  color: #ef4444;
  /* Red color for required asterisk */
  margin-left: 2px;
}

/* Modern LinkedIn Button */
.btn-linkedin-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0077b5;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 119, 181, 0.2);
}

.btn-linkedin-modern:hover {
  background: #006097;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 119, 181, 0.3);
}

/* footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
}

/* animations */
/* html rule merged above */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive tweaks: force menu single-line with smaller gaps/font on small widths */
@media (max-width:900px) {
  .nav-top {
    gap: 0.5rem;
    padding: 0.4rem 0;
  }

  .nav-top .nav-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.92rem;
  }

  .hero-section {
    padding-top: 5rem;
  }

  .card-title,
  .muted {
    text-align: left;
  }
}

/* extremely small screens: allow horizontal overflow but keep centered visually */
@media (max-width:420px) {
  .nav-top {
    gap: 0.4rem;
  }

  .nav-top .nav-link {
    font-size: 0.86rem;
    padding: 0.35rem 0.5rem;
  }

  .container {
    padding: 0.8rem;
  }

  /* Widen container for timeline sections to allow "Wide Rectangles" in Zig-Zag */
  .card-title {
    font-size: 0.98rem;
  }
}

/* END of max-width: 420px media query */

/* GLOBAL FIXES (Desktop & Mobile) */

/* Fix vertical overlap in Skills section */
#competences .grid-2+.grid-2 {
  margin-top: 5rem !important;
  /* Fix overlap between Languages and main skills */
}

/* Responsive Navigation for Tablets & Mobile (Max 768px) */
@media (max-width: 768px) {
  .nav-top {
    flex-wrap: wrap;
    /* Allow items to break into multiple lines */
    justify-content: center;
    /* Center items */
    gap: 10px;
    /* Space between items */
    padding: 0.5rem;
    /* Add padding */
  }

  /* Make links slightly bigger/easier to tap on mobile */
  .nav-top .nav-link,
  .nav-top .nav-select,
  .nav-top .nav-btn {
    margin: 2px;
    font-size: 0.9rem;
  }
}

/* Force spacing for contact to prevent overlap */
#contact .grid-2 {
  margin-top: 3rem !important;
  grid-template-columns: 1fr;
  /* Stack by default for wide look */
  max-width: 800px;
  /* Center and limit width */
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1100px) {
  #contact .grid-2 {
    grid-template-columns: 1.2fr 0.8fr;
    /* Side by side on large desktop */
    max-width: 1200px;
  }
}