/* Page layout, navigation and hero composition. */

/* Top Navigation */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: background-color var(--transition-normal);
}
.reading-progress {
  position: fixed;
  z-index: 101;
  top: 4.5rem;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

@media print {
  .reading-progress {
    display: none;
  }
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}
.brand-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}
.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}
.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}
.mobile-menu-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}
@media (max-width: 1180px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}
@media (max-width: 900px) {
  .nav-actions .btn-get-in-touch {
    display: none;
  }
}
@media (max-width: 640px) {
  .nav-container {
    height: 3.8rem;
    gap: 0.4rem;
  }
  .brand-avatar {
    width: 2.1rem;
    height: 2.1rem;
  }
  .brand-logo span {
    font-size: 1rem;
  }
  .nav-actions {
    gap: 0.25rem;
  }
  #topCvDownloadBtn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
  #topCvDownloadBtn .cv-text-long {
    display: none;
  }
  #topCvDownloadBtn .cv-text-short {
    display: inline;
  }
  #langToggleBtn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
  #langToggleBtn .lang-text-long {
    display: none;
  }
  #langToggleBtn .lang-text-short {
    display: inline;
  }
  #themeToggleBtn {
    width: 2rem;
    height: 2rem;
  }
  .mobile-menu-btn {
    width: 2rem;
    height: 2rem;
  }
}
@media (max-width: 420px) {
  .brand-logo span {
    display: none;
  }
}
.mobile-drawer {
  display: none;
  position: fixed;
  top: 4.5rem;
  left: 0;
  width: 100%;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}
.mobile-drawer.open {
  display: flex;
}

/* Page Sections */
.page-section {
  padding: 5rem 0;
  position: relative;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  transform: translateY(-160%);
}
.skip-link:focus-visible {
  transform: translateY(0);
}
.section-border-top {
  border-top: 1px solid var(--border-subtle);
}
.section-title-wrap {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem auto;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-full);
}
.section-heading {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}
.section-subheading {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.skills-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 1099px) {
  .skills-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .skills-categories-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
       HERO SECTION (THE BELOVED CAMERA CARD WITH STATS & SAFE FLOATING BADGES)
       ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseAnim 2s infinite;
}

.hero-title {
  font-size: 3.25rem;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.hero-headline {
  font-size: 1.25rem;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.hero-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 580px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2.5rem;
}
.hero-socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.social-icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.social-icon-btn:hover {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* THE HERO CARD */
.hero-visual-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 520px;
}
.hero-main-card {
  position: relative;
  z-index: 2;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-card);
  border-radius: 28px;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 400px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.hero-avatar-frame {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 1.25rem auto;
  position: relative;
  padding: 5px;
  background: var(--gradient-accent);
  box-shadow: 0 0 35px var(--primary-glow);
}
.hero-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: var(--bg-surface);
}
.hero-online-status {
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-emerald);
  border: 3px solid var(--bg-surface);
}
.card-hero-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.card-hero-title {
  font-size: 0.875rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}
.stat-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: all var(--transition-fast);
}
.stat-pill:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}
.stat-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.3;
}

/* CLOSER INTERACTIVE FLOATING BADGES (NEVER OVERLAPS CARD PHOTO/TEXT) */
#heroFloatingBadgesContainer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.floating-badge {
  pointer-events: auto;
  position: absolute;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: floatBadge 6s ease-in-out infinite;
}
.floating-badge:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--primary-light);
  box-shadow: 0 16px 36px var(--primary-glow);
  background: var(--bg-surface-elevated);
}
.floating-badge:hover .badge-arrow {
  transform: translate(2px, -2px);
  opacity: 1;
  color: var(--primary-light);
}
html.light .floating-badge {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}
html.light .floating-badge .badge-cat {
  color: var(--text-tertiary);
}
html.light .floating-badge .badge-title {
  color: var(--text-primary);
}
html.light .floating-badge:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.25);
}

/* DESKTOP (1200px+): Badges hug the card closely (12px-14px from card border) */
@media (min-width: 1200px) {
  /* LTR */
  html[dir="ltr"] .badge-pos-0 {
    top: 25px;
    left: calc(100% + 14px);
    right: auto;
    animation-delay: 0s;
  }
  html[dir="ltr"] .badge-pos-1 {
    bottom: 35px;
    right: calc(100% + 14px);
    left: auto;
    animation-delay: 2.5s;
  }
  html[dir="ltr"] .badge-pos-2 {
    top: 25px;
    right: calc(100% + 14px);
    left: auto;
    animation-delay: 1.2s;
  }
  html[dir="ltr"] .badge-pos-3 {
    bottom: 35px;
    left: calc(100% + 14px);
    right: auto;
    animation-delay: 3.7s;
  }
  html[dir="ltr"] .badge-pos-4 {
    top: 48%;
    right: calc(100% + 14px);
    left: auto;
  }
  html[dir="ltr"] .badge-pos-5 {
    top: 48%;
    left: calc(100% + 14px);
    right: auto;
  }

  /* RTL (French) Outside Placement */
  html[dir="rtl"] .badge-pos-0 {
    top: 25px;
    right: calc(100% + 14px);
    left: auto;
    animation-delay: 0s;
  }
  html[dir="rtl"] .badge-pos-1 {
    bottom: 35px;
    left: calc(100% + 14px);
    right: auto;
    animation-delay: 2.5s;
  }
  html[dir="rtl"] .badge-pos-2 {
    top: 25px;
    left: calc(100% + 14px);
    right: auto;
    animation-delay: 1.2s;
  }
  html[dir="rtl"] .badge-pos-3 {
    bottom: 35px;
    right: calc(100% + 14px);
    left: auto;
    animation-delay: 3.7s;
  }
  html[dir="rtl"] .badge-pos-4 {
    top: 48%;
    left: calc(100% + 14px);
    right: auto;
  }
  html[dir="rtl"] .badge-pos-5 {
    top: 48%;
    right: calc(100% + 14px);
    left: auto;
  }
}

/* SCREENS UNDER 1200px: Badges neatly sit underneath the card in an organized row */
/* MOBILE & TABLET HERO (<= 1199px): Hero Card First, Badges Below in Clean 2x2 Grid */
@media (max-width: 1199px) {
  .hero-visual-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: auto;
    width: 100%;
    overflow: visible;
  }
  .hero-main-card {
    order: 1;
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
  }
  #heroFloatingBadgesContainer {
    order: 2;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin: 1.5rem auto 0 auto;
    width: 100%;
    max-width: 400px;
    padding: 0;
    box-sizing: border-box;
  }
  .floating-badge {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    animation: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .floating-badge .badge-arrow {
    margin-left: auto;
  }
  html[dir="rtl"] .floating-badge .badge-arrow {
    margin-left: 0;
    margin-right: auto;
  }
}
@media (max-width: 440px) {
  #heroFloatingBadgesContainer {
    grid-template-columns: 1fr;
    max-width: 330px;
  }
  .hero-main-card {
    padding: 1.5rem 1.15rem;
  }
}

/* Step 2 visual system: calmer rhythm and contained desktop hero. */
.site-header {
  box-shadow:
    0 1px 0 var(--border-subtle),
    0 8px 24px rgba(0, 0, 0, 0.08);
}

.brand-logo {
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.nav-links {
  gap: 1rem;
}

.page-section {
  padding: 4.25rem 0;
}

.section-title-wrap {
  margin-bottom: 2.75rem;
}

.section-eyebrow {
  color: var(--accent-cyan);
  background: color-mix(in srgb, var(--accent-cyan) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent-cyan) 28%, transparent);
}

.hero-section {
  padding: 4rem 0 3rem;
}

.hero-grid {
  gap: 3rem;
}

.hero-title {
  font-size: 3rem;
  letter-spacing: 0;
}

.hero-headline {
  color: var(--primary-light);
}

@media (min-width: 1200px) {
  #heroFloatingBadgesContainer {
    width: 100%;
    max-width: 100%;
    left: 0;
    transform: none;
  }

  .floating-badge {
    max-width: 190px;
    white-space: normal;
    padding: 0.6rem 0.75rem;
  }

  html[dir="ltr"] .badge-pos-0 {
    left: 0;
    right: auto;
  }
  html[dir="ltr"] .badge-pos-1 {
    left: auto;
    right: 0;
  }
  html[dir="ltr"] .badge-pos-2 {
    left: auto;
    right: 0;
  }
  html[dir="ltr"] .badge-pos-3 {
    left: 0;
    right: auto;
  }
  html[dir="ltr"] .badge-pos-4 {
    left: auto;
    right: 0;
  }
  html[dir="ltr"] .badge-pos-5 {
    left: 0;
    right: auto;
  }

  html[dir="rtl"] .badge-pos-0 {
    left: auto;
    right: 0;
  }
  html[dir="rtl"] .badge-pos-1 {
    left: 0;
    right: auto;
  }
  html[dir="rtl"] .badge-pos-2 {
    left: 0;
    right: auto;
  }
  html[dir="rtl"] .badge-pos-3 {
    left: auto;
    right: 0;
  }
  html[dir="rtl"] .badge-pos-4 {
    left: 0;
    right: auto;
  }
  html[dir="rtl"] .badge-pos-5 {
    left: auto;
    right: 0;
  }

  html[dir="ltr"] .badge-pos-1 {
    top: auto;
    right: 0;
    bottom: -70px;
    left: auto;
    width: auto;
  }

  html[dir="rtl"] .badge-pos-1 {
    top: auto;
    right: auto;
    bottom: -70px;
    left: 0;
    width: auto;
  }
}

@media (max-width: 640px) {
  .page-section {
    padding: 3.5rem 0;
  }

  .hero-section {
    padding-top: 3rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

/* Keep the desktop floating badges clear of the statistics row. */
@media (min-width: 1200px) {
  .hero-visual-wrap {
    margin-bottom: 5rem;
  }

  html[dir="ltr"] .badge-pos-3,
  html[dir="rtl"] .badge-pos-3 {
    bottom: -70px;
  }
}

/* Give the compact mobile header enough room at the narrowest supported width. */
@media (max-width: 360px) {
  .ambient-blob-2 {
    display: none;
  }

  .nav-container {
    gap: 0;
  }

  .nav-container > nav {
    display: none;
  }

  .brand-logo {
    margin-right: 0;
  }

  .nav-actions {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 0.15rem;
  }

  #langToggleBtn {
    width: 2rem;
    height: 2rem;
    padding: 0;
  }

  #langToggleBtn #langBtnText {
    display: none;
  }
}
