:root {
  /* Core Colors - Apple iOS Dark Mode */
  --bg-color: #000000; /* Pure black */
  --bg-color-light: #1c1c1e; /* iOS System Gray 6 (Dark) */
  --text-color: #f5f5f7; /* Apple off-white */
  --text-muted: #86868b; /* Apple gray for secondary text */
  
  /* Accent Colors */
  --primary-color: #2997ff; /* Apple System Blue Light (Web) */
  --primary-hover: #147ce5;
  --secondary-color: #5e5ce6; /* Apple System Indigo Dark */
  
  /* Apple Liquid Glassmorphism */
  --glass-bg: rgba(28, 28, 30, 0.5); /* Translucent dark gray */
  --glass-border: rgba(255, 255, 255, 0.1); 
  --glass-highlight: rgba(255, 255, 255, 0.05);
  
  /* Soft Shadows */
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0; 
  --shadow-glow-hover: 0 12px 48px rgba(0, 0, 0, 0.8);
  
  /* Transitions - Optimized for fluidity without animating expensive properties like blur */
  --transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: transform 0.2s ease-out, background-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out, border-color 0.2s ease-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #48484a; /* iOS System Gray 3 */
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #636366; /* iOS System Gray 2 */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* Typography Enhancements (Refined weights for iOS feel) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em; /* Tighter tracking like SF Pro Display */
  margin-bottom: 1.25rem;
  line-height: 1.1;
  color: var(--text-color);
}

h1 { 
  font-size: clamp(3rem, 7vw, 5.5rem); /* Extra large headings */
  font-weight: 700;
  letter-spacing: -0.04em;
}

h2 { 
  font-size: clamp(2.2rem, 4vw, 3rem); 
  letter-spacing: -0.03em;
}
h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; }

p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.5;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  text-decoration: underline; /* Apple standard hover */
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 980px; /* Perfectly round pill buttons */
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
  text-align: center;
  background: var(--glass-highlight); /* Light translucent fill */
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  color: var(--text-color);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none; /* No underline on button text */
}

.btn:active {
  transform: scale(0.96); 
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  background: var(--text-color);
  border: none;
  color: var(--bg-color);
  font-weight: 500;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--bg-color);
  transform: scale(1.02);
}
.btn-primary:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.7);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
header {
  position: fixed;
  top: 1.5rem;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(28, 28, 30, 0.75); /* Dark translucent background */
  backdrop-filter: saturate(180%) blur(40px); /* Heavy apple blur */
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.15); 
  border-radius: 980px;
  box-shadow: var(--shadow-md);
  padding: 0 1.5rem;
  transition: var(--transition);
}

header .container {
  padding: 0;
  width: auto;
}

body {
  padding-top: 120px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 400; /* Thin nav links */
  font-size: 0.85rem;
  padding: 0.5rem 0;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-color);
  text-decoration: none; /* Never underline nav */
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
  z-index: 1001;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-color);
  transition: var(--transition);
  border-radius: 2px;
}

/* Main Content */
main {
  flex: 1;
  padding-top: 0;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

/* Subtle Aurora Background simulating Vision OS feel */
.hero::before {
  content: '';
  position: absolute;
  top: -10%; left: -10%;
  width: 50vw; height: 50vw;
  /* Reduced visual load by replacing filter: blur with native gradient fading */
  background: radial-gradient(circle, rgba(10, 132, 255, 0.15) 0%, rgba(10, 132, 255, 0.05) 40%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -10%;
  width: 60vw; height: 60vw;
  /* Reduced visual load by replacing filter: blur with native gradient fading */
  background: radial-gradient(circle, rgba(94, 92, 230, 0.1) 0%, rgba(94, 92, 230, 0.05) 40%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.hero-content {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  position: relative;
  z-index: 10;
}

.hero-subtitle {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: block;
}

/* Apple Liquid Glass Cards */
.card {
  background: var(--glass-bg);
  /* Reduced blur intensity slightly for 120hz performance */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Extremely subtle border */
  border-top: 1px solid rgba(255, 255, 255, 0.15); /* Top highlight simulating light */
  border-radius: 24px; /* Classic Apple squircle radius */
  padding: 2.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow, opacity;
  transform: translateZ(0); /* Hardware acceleration */
  backface-visibility: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: rgba(38, 38, 40, 0.7); /* Slightly lighter on hover */
}

/* Profile Picture Profile (No neon glow) */
.avatar-glow {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--bg-color); /* Cutout effect */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 2;
}

.avatar-glow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.4);
  transform-origin: center 25%;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05); /* Very light fill */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2); /* Apple focus ring */
}

/* Custom Lists */
.glass-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.glass-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: #e5e5ea; /* iOS System Gray 5 (Light) */
}

.glass-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Special Highlighting */
.text-highlight {
  color: var(--text-color);
  font-weight: 500;
  /* Remove dashed border, use subtle background chip */
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
}

/* Footer */
footer {
  background: transparent;
  padding: 3rem 0;
  text-align: center;
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  margin-top: 5rem;
  color: var(--text-muted);
}

/* ===== APPLE LAYOUT DISPOSITIONS ===== */

/* Apple Hero (Index) */
.layout-hero-apple {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-text-apple {
  text-align: center;
  max-width: 800px;
  margin-bottom: 2rem;
  z-index: 10;
}

.hero-title-apple {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle-apple {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 2.5rem;
}

.hero-actions-apple {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.hero-visual-apple {
  position: relative;
  z-index: 5;
  margin-top: -2rem; /* Pull image up slightly for tighter grouping */
}

/* Elegant Aurora Gradient (Restrained) */
.hero-visual-shape {
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05); /* Softer border */
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
}

.hero-visual-shape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
}

/* ===== APPLE CV ====== */
.layout-cv-apple {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.cv-header-apple {
  padding: 3rem;
  border-radius: 30px;
}

.cv-header-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.cv-avatar-apple {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  margin-bottom: 0;
}

.cv-header-text {
  text-align: left;
}

.cv-name {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.cv-intro {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.cv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem 1rem;
  border-radius: 980px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-link {
  color: var(--text-color);
  transition: var(--transition-fast);
}

.badge-link:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.cv-section-apple {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-title-apple {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cv-grid-apple {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: var(--transition);
  will-change: transform, opacity;
  transform: translateZ(0); /* Hardware acceleration */
  backface-visibility: hidden;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.feature-card p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.feature-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(41, 151, 255, 0.15);
  padding: 0.2rem 0.8rem;
  border-radius: 980px;
}

.cv-experience-card {
  padding: 2.5rem;
  border-radius: 24px;
  transition: var(--transition);
  will-change: transform, opacity;
  transform: translateZ(0); /* Hardware acceleration */
  backface-visibility: hidden;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.experience-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text-color);
}

.experience-role {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0;
}

.experience-date {
  background: rgba(255, 255, 255, 0.05);
}

.experience-details {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .cv-header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .cv-header-text {
    text-align: center;
  }
  
  .cv-badges {
    justify-content: center;
  }
}

/* Alternating Grid (Competences) */
.layout-alternating {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.layout-alternating > div {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 2fr;
  gap: 3rem;
  align-items: center;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 768px) {
  .grid-2-cols {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.layout-alternating > div:nth-child(even) {
  grid-template-columns: 2fr minmax(300px, 1fr);
}
.layout-alternating > div:nth-child(even) > div:first-child {
  order: 2;
}

/* Article Layout (Stage & Veille) */
.layout-article {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.article-main {
  font-size: 1.1rem;
  line-height: 1.7;
}
.article-sidebar {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Utility Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px) translateZ(0); }
  to { opacity: 1; transform: translateY(0) translateZ(0); }
}

.reveal-hidden {
  opacity: 0 !important;
  transform: translateY(30px) translate3d(0,0,0) !important;
}

/* Force hardware acceleration on hero content */
.hero-content {
  will-change: transform, opacity;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

/* Responsive Focus */
@media (max-width: 768px) {
  header {
    width: 90%;
    top: 1.5rem;
    bottom: auto;
    padding: 0 0.5rem;
  }
  .nav-links {
    display: flex;
    position: fixed;
    top: 90px;
    bottom: auto;
    left: 0;
    width: 100%;
    height: calc(100vh - 90px);
    background: rgba(0, 0, 0, 0.85); /* Darker backdrop on mobile */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    gap: 2rem;
    
    /* Animation settings */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  }
  
  .nav-links.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .nav-links a {
    font-size: 1.5rem;
    font-weight: 500;
  }
  
  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .layout-split-hero,
  .layout-sidebar-main,
  .layout-alternating > div,
  .layout-alternating > div:nth-child(even),
  .layout-article {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .sidebar-sticky {
    position: static;
  }
  
  .layout-alternating > div:nth-child(even) > div:first-child {
    order: 0;
  }
}

/* ===== HOME PAGE (NO SCROLL) ===== */
.home-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 105px;
}

.home-page main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-page .hero {
  flex: 1;
  min-height: 0;
  align-items: flex-start;
  padding-top: 0;
}

.home-page footer {
  margin-top: 0;
  padding: 1.5rem 0;
  flex-shrink: 0;
}

/* On disabled devices or small screens, allow scrolling so content isn't clipped out */
@media (max-width: 768px), (max-height: 700px) {
  .home-page {
    height: auto;
    overflow: auto;
  }
}

/* ===== LIGHTBOX FOR IMAGE ZOOM ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 2001;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--primary-color);
}

.zoomable {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.zoomable:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}
