/* Sections CSS */

/* ==========================================================================
   Top Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

@media (min-width: 768px) {
  .site-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(10, 9, 7, 0.88);
  }
  [data-theme="light"] .site-header {
    background-color: rgba(255, 255, 255, 0.88);
  }
}

/* Symmetrical 3-column header layout (Spacer Left - Centered Nav - Actions Right) */
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  gap: var(--space-4);
}

.header-left-spacer {
  min-width: 0;
}

/* Centered Navigation Capsule */
.nav-container {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--card-shadow);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-link {
  font-size: var(--font-xs);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

.nav-link.is-active {
  color: var(--accent);
  background-color: var(--accent-subtle);
  font-weight: 600;
}

/* Top Right Actions (Light / Dark Mode Toggle & Optional CV) */
.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  border: 1px solid var(--border);
  background-color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text);
  border-color: var(--border-focus);
  background-color: var(--surface-hover);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
}

.theme-toggle-btn .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: stroke var(--transition-fast);
}

.theme-toggle-btn:hover .icon {
  stroke: var(--accent);
}

/* Export CV Action Button */
.btn-export-cv {
  height: 40px;
  min-height: 40px;
  padding: 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
}

.btn-export-cv:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--surface-hover);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-export-cv:active {
  transform: scale(0.97);
}

.btn-export-cv .export-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform var(--transition-fast);
}

.btn-export-cv:hover .export-icon {
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .btn-export-text {
    display: none;
  }
  .btn-export-cv {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
}

.btn-header-cv {
  height: 38px;
  min-height: 38px;
  padding: 0 var(--space-3);
  font-size: var(--font-xs);
  white-space: nowrap;
}

/* Page Scroll Progress Indicator */
.scroll-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background-color: var(--accent);
  transition: width 80ms linear;
  pointer-events: none;
}

/* Responsive: Tablet and Mobile Header */
@media (max-width: 860px) {
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
  }

  .header-left-spacer {
    display: none;
  }

  .nav-container {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 50px);
    padding: 3px 4px;
    gap: 2px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .header-actions {
    margin-left: auto;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
  position: relative;
  overflow: hidden;
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
}

.hero-container {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.hero-content {
  max-width: min(760px, 100%);
  width: 100%;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-headline {
  font-size: var(--font-hero);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  color: var(--text);
  letter-spacing: var(--heading-spacing);
  text-align: left;
}

.hero-line {
  display: block;
  text-align: left;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-word.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Typewriter & Rotating Role Engine */
.typewriter-container {
  display: inline-flex;
  align-items: center;
  font-size: clamp(1.35rem, 2.2vw + 0.8rem, 2.15rem);
  line-height: 1.35;
  min-height: clamp(2.4rem, 3.6vw, 3.2rem);
  white-space: nowrap;
  margin-bottom: var(--space-5);
}

.typewriter-prefix {
  margin-right: 0.45rem;
  color: var(--text-muted);
}

.typewriter-text {
  color: var(--text-primary);
  display: inline-block;
  letter-spacing: -0.02em;
}

.typewriter-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.15em;
  margin-left: 4px;
  background-color: var(--accent);
  vertical-align: middle;
  animation: cursor-pulse 0.9s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes cursor-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .typewriter-cursor {
    display: none;
  }
}

.text-muted {
  color: var(--text-muted, var(--body));
}

.text-primary {
  color: var(--text-primary, var(--text));
}

.font-bold {
  font-weight: 700;
}

.hero-sub {
  font-size: clamp(1.25rem, 1.8vw + 0.9rem, 1.85rem);
  line-height: 1.4;
  color: var(--body);
  max-width: 820px;
  margin-bottom: var(--space-4);
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.hero-subsub {
  font-size: var(--font-small);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: var(--space-2);
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

/* Ambient Accent Gradients (Scrolls with section background) */
.section-ambient-gradient {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  z-index: 1;
}

.hero-gradient {
  width: clamp(520px, 55vw, 900px);
  height: clamp(520px, 55vw, 900px);
  right: -240px;
  bottom: -240px;
  background: radial-gradient(circle closest-side, var(--accent) 0%, transparent 75%);
  opacity: 0.08;
  filter: blur(100px);
}

[data-theme="light"] .hero-gradient {
  opacity: 0.04;
  filter: blur(90px);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
  background-color: var(--bg);
  position: relative;
  overflow: hidden;
}

.about-container {
  position: relative;
  z-index: 2;
}

.about-gradient {
  width: clamp(360px, 40vw, 600px);
  height: clamp(360px, 40vw, 600px);
  left: -120px;
  bottom: -100px;
  background: radial-gradient(circle closest-side, var(--accent) 0%, transparent 75%);
  opacity: 0.10;
  filter: blur(80px);
}

[data-theme="light"] .about-gradient {
  opacity: 0.06;
  filter: blur(70px);
}

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
}

@media (max-width: 840px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.about-body {
  font-size: clamp(1.15rem, 1vw + 0.95rem, 1.35rem);
  line-height: 1.7;
  color: var(--text);
  max-width: 820px;
}

.about-meta-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-2);
}

.about-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-meta-label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.about-meta-value {
  font-size: var(--font-small);
  color: var(--body);
  font-weight: 500;
}

/* ==========================================================================
   Projects Section: Scrollytelling Deck
   ========================================================================== */
.projects-section {
  padding: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  background-color: var(--bg);
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
}

/* Desktop scrollytelling container */
@media (min-width: 1024px) {
  .projects-scroller {
    position: relative;
    /* Height will be set dynamically via JS: panelsCount * 100vh */
  }

  .projects-stage {
    position: sticky;
    top: var(--header-height);
    height: calc(100svh - var(--header-height));
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    z-index: 20;
  }

  .projects-track-viewport {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
  }

  .projects-track {
    display: flex;
    height: 100%;
    width: 100%;
    will-change: transform;
    align-items: center;
  }

  .project-panel {
    width: 100vw;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) var(--space-6);
    box-sizing: border-box;
  }
}

/* Header bar inside deck */
.deck-topbar {
  padding: 0;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  width: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 25;
}

.deck-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-4);
}

.deck-title-group {
  flex: 0 0 140px;
  min-width: 140px;
}

.deck-section-title {
  font-family: var(--font-heading);
  font-size: var(--font-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.deck-tabs-wrapper {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.deck-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  padding: 4px 0;
}

.deck-tabs::-webkit-scrollbar {
  display: none;
}

.deck-tab {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background-color: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.deck-tab:hover {
  color: var(--text);
  border-color: var(--border-focus);
}

.deck-tab[aria-selected="true"] {
  color: var(--accent);
  background-color: var(--accent-subtle);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.deck-spacer {
  flex: 0 0 140px;
  min-width: 140px;
}

/* Mobile & Tablet < 1024px: Native scroll-snap */
@media (max-width: 1023px) {
  .projects-section {
    min-height: calc(100svh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: var(--space-8);
    padding-bottom: var(--space-16);
    scroll-margin-top: var(--header-height);
    box-sizing: border-box;
  }

  .projects-stage {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

  .deck-topbar {
    height: auto;
    padding: var(--space-3) 0;
  }

  .deck-topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .deck-title-group {
    flex: auto;
    min-width: auto;
  }

  .deck-tabs-wrapper {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }

  .deck-tabs {
    justify-content: flex-start;
  }

  .deck-spacer {
    display: none;
  }

  .projects-track-viewport {
    width: 100%;
  }

  .projects-track {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-2) var(--space-4) var(--space-6) var(--space-4);
    scrollbar-width: none;
  }

  .projects-track::-webkit-scrollbar {
    display: none;
  }

  .project-panel {
    flex: 0 0 88vw;
    max-width: 88vw;
    scroll-snap-align: center;
    background-color: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-card);
    padding: var(--space-6);
  }
}

/* Inside each Panel */
.panel-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  align-items: center;
}

@media (max-width: 1023px) {
  .panel-container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.panel-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 660px;
}

.panel-header-line {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel-num {
  font-family: var(--font-heading);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  line-height: 1.2;
}

.panel-title {
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2.25rem);
  color: var(--text);
}

.panel-status {
  font-size: var(--font-xs);
  color: var(--muted);
  font-weight: 500;
}

.panel-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.panel-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-row-label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.panel-row-text {
  font-size: var(--font-small);
  line-height: 1.6;
  color: var(--body);
}

.panel-how {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.panel-how-title {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.panel-how-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
}

.panel-how-item {
  font-size: var(--font-small);
  color: var(--body);
  line-height: 1.5;
  position: relative;
  padding-left: var(--space-4);
}

.panel-how-item::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.panel-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.panel-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Media / Typographic Visual Slot (Soft Ambient Box) */
.panel-media-slot {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 480px;
  background-color: var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  box-shadow: 
    0 22px 55px -15px rgba(0, 0, 0, 0.22),
    0 35px 85px -20px rgba(0, 0, 0, 0.16),
    0 0 40px -10px color-mix(in srgb, var(--accent) 8%, transparent),
    inset 0 1px 0 rgba(255, 248, 230, 0.05);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.panel-media-slot:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: 
    0 28px 70px -15px rgba(0, 0, 0, 0.25),
    0 45px 100px -25px rgba(0, 0, 0, 0.18),
    0 0 50px -10px color-mix(in srgb, var(--accent) 12%, transparent),
    inset 0 1px 0 rgba(255, 248, 230, 0.08);
}

[data-theme="light"] .panel-media-slot {
  border-color: rgba(15, 14, 12, 0.08);
  box-shadow: 
    0 20px 48px -16px rgba(0, 0, 0, 0.06),
    0 36px 72px -20px rgba(0, 0, 0, 0.04),
    0 0 35px -10px color-mix(in srgb, var(--accent) 8%, transparent);
}

[data-theme="light"] .panel-media-slot:hover {
  border-color: rgba(15, 14, 12, 0.12);
  box-shadow: 
    0 24px 56px -16px rgba(0, 0, 0, 0.09),
    0 40px 84px -20px rgba(0, 0, 0, 0.06),
    0 0 45px -10px color-mix(in srgb, var(--accent) 12%, transparent);
}

.panel-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Typographic Fallback Visual with Soft Ambient Bloom */
.panel-visual-fallback {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at center, 
      color-mix(in srgb, var(--accent) 7%, transparent) 0%, 
      color-mix(in srgb, var(--accent) 2%, transparent) 50%, 
      transparent 80%
    ),
    var(--surface);
  overflow: hidden;
  user-select: none;
}

.panel-visual-pattern {
  display: none; /* Removed all dots from the number boxes */
}

.panel-visual-num {
  font-family: var(--font-heading);
  font-size: clamp(6.5rem, 16vw, 12.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  z-index: 1;
  position: relative;
  user-select: none;

  /* Faint, translucent accent watermark number */
  color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: none;
  -webkit-text-fill-color: initial;
  filter: none;
  -webkit-text-stroke: 0 transparent;
  text-shadow: none;

  transition: transform var(--transition-normal), color var(--transition-normal);
}

.panel-media-slot:hover .panel-visual-num {
  transform: scale(1.02);
  color: color-mix(in srgb, var(--accent) 42%, transparent);
}

.panel-visual-title {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.85;
  font-weight: 600;
}

/* Other Projects Panel Layout */
.toolkit-grid,
.other-projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
  max-height: calc(100svh - 220px);
  padding-right: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scroll-behavior: auto;
}

@media (min-width: 1024px) {
  .toolkit-grid,
  .other-projects-grid {
    overflow-y: hidden; /* Prevent native mousewheel from scrolling internally while transitioning */
  }
}

@media (max-width: 1023px) {
  .toolkit-grid,
  .other-projects-grid {
    overflow-y: auto;
    max-height: 480px;
  }
}

.toolkit-item {
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.toolkit-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-medium);
  box-shadow: var(--card-shadow-hover);
}

.toolkit-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.toolkit-name {
  font-family: var(--font-heading);
  font-size: var(--font-small);
  font-weight: 700;
  color: var(--text);
}

.toolkit-desc {
  font-size: var(--font-small);
  color: var(--body);
  line-height: 1.5;
}

/* ==========================================================================
   Inverted Section: Self driven initiatives
   - Inverted contrast theme (Dark mode flips to architectural warm ivory; Light mode flips to obsidian black)
   - Accent color stays preserved and untouched (--accent)
   - Rule of Thirds layout: Left 1/3 (Header & Counter) + Right 2/3 (Scrolling enlarged cards)
   - Vertical scrollytelling with top & bottom boundary fade masks
   - Boundary containment: cards never overlap outside the section
   ========================================================================== */

/* Dark Mode Default: Inverted becomes architectural warm off-white */
.initiatives-inverted,
.credentials-inverted {
  --inv-bg: #f5f3ee;
  --inv-surface: #ffffff;
  --inv-surface-hover: #fbfaf7;
  --inv-border: rgba(15, 14, 12, 0.09);
  --inv-border-medium: rgba(15, 14, 12, 0.16);
  --inv-text: #0f0e0c;
  --inv-body: #47433c;
  --inv-muted: #827b70;
  --inv-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --inv-card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.09);
  --inv-num-bg: rgba(212, 160, 60, 0.14);
  --inv-num-color: #a87920;
}

/* Light Mode: Inverted becomes deep obsidian dark luxury */
[data-theme="light"] .initiatives-inverted,
[data-theme="light"] .credentials-inverted {
  --inv-bg: #0f0e0c;
  --inv-surface: #161412;
  --inv-surface-hover: #1e1b18;
  --inv-border: rgba(255, 248, 230, 0.09);
  --inv-border-medium: rgba(255, 248, 230, 0.16);
  --inv-text: #f0ebe0;
  --inv-body: #cfc7ba;
  --inv-muted: #8a8070;
  --inv-card-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.08), 0 6px 28px rgba(0, 0, 0, 0.45);
  --inv-card-shadow-hover: inset 0 1px 0 rgba(255, 248, 230, 0.12), 0 14px 40px rgba(0, 0, 0, 0.6);
  --inv-num-bg: rgba(37, 99, 235, 0.18);
  --inv-num-color: #3b82f6;
}

.initiatives-section {
  position: relative;
  background-color: var(--inv-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Scroller & Sticky Stage */
.initiatives-scroller {
  position: relative;
  width: 100%;
}

.initiatives-stage {
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  background-color: var(--inv-bg);
}

/* Rule of Thirds Layout (1fr left / 2fr right) */
.initiatives-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-12);
  align-items: center;
  height: 100%;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Left Third: Sticky Context & Counter (Centered Vertically) */
.initiatives-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: var(--space-4) 0;
  gap: var(--space-8);
}

.initiatives-header-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.initiatives-left .section-label {
  color: var(--accent);
}

.initiatives-left .section-title {
  color: var(--inv-text);
  font-size: clamp(2rem, 3vw + 0.8rem, 3.25rem);
  line-height: 1.15;
}

.initiatives-lead {
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  line-height: 1.6;
  color: var(--inv-body);
  max-width: 340px;
}

.initiatives-meta-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.initiatives-counter-box {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--inv-muted);
  letter-spacing: 0.05em;
  padding: 8px 18px;
  background-color: var(--inv-surface);
  border: 1px solid var(--inv-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--inv-card-shadow);
  width: fit-content;
}

.initiatives-counter-current {
  color: var(--accent);
  font-size: 1.85rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.initiatives-counter-divider {
  color: var(--inv-border-medium);
  font-weight: 400;
}

.initiatives-counter-total {
  font-variant-numeric: tabular-nums;
}

/* Right Two-Thirds: Scrolling Viewport with Boundary Fades */
.initiatives-right {
  position: relative;
  height: 100%;
  max-height: calc(100svh - var(--header-height) - 48px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Boundary Fade Overlays (preserved in DOM for structure, hidden so first & end cards do not fade) */
.initiatives-boundary-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.initiatives-boundary-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--inv-bg) 30%, transparent 100%);
}

.initiatives-boundary-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--inv-bg) 30%, transparent 100%);
}

.initiatives-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  padding: 24px 0 72px;
}

.initiatives-track {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  will-change: transform;
}

/* Enlarged Initiative Cards */
.initiative-card {
  background-color: var(--inv-surface);
  border: 1px solid var(--inv-border);
  box-shadow: var(--inv-card-shadow);
  border-radius: var(--radius-card);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  width: 100%;
}

.initiative-card:hover {
  transform: translateY(-2px);
  border-color: var(--inv-border-medium);
  box-shadow: var(--inv-card-shadow-hover);
}

.initiative-card.is-active-initiative {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--inv-card-shadow-hover);
}

.initiative-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.initiative-num {
  font-family: var(--font-heading);
  font-size: var(--font-small);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.initiative-badge {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--inv-muted);
  background-color: var(--inv-bg);
  border: 1px solid var(--inv-border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.initiative-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.4vw + 0.8rem, 1.85rem);
  font-weight: 700;
  color: var(--inv-text);
  line-height: 1.25;
}

.initiative-desc {
  font-size: clamp(0.95rem, 0.3vw + 0.85rem, 1.1rem);
  line-height: 1.65;
  color: var(--inv-body);
}

.initiatives-inverted .num-highlight {
  background-color: var(--inv-num-bg);
  color: var(--inv-num-color);
}

/* Tablet & Mobile Layout (< 1024px) */
@media (max-width: 1023px) {
  .initiatives-stage {
    position: relative;
    top: 0;
    height: auto;
    min-height: calc(100svh - var(--header-height));
    padding: var(--space-10) 0;
  }

  .initiatives-container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    height: auto;
  }

  .initiatives-left {
    height: auto;
    max-height: none;
    gap: var(--space-4);
    padding: 0;
  }

  .initiatives-right {
    max-height: 520px;
    height: auto;
    width: 100%;
  }

  .initiatives-viewport {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 32px 0;
  }

  .initiatives-viewport::-webkit-scrollbar {
    display: none;
  }

  .initiatives-track {
    gap: var(--space-4);
  }
}

/* ==========================================================================
   Leadership & Service Section
   - Rule of Thirds layout: Left 2/3 (Scrolling crawling achievement cards) +
     Right 1/3 (Pinned section title, narrative & live counter)
   - Standard theme colors preserved (not inverted)
   - Vertical scrollytelling crawl with top & bottom boundary fade masks
   - Boundary containment: cards never overlap outside the section
   ========================================================================== */
.leadership-section {
  position: relative;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Scroller & Sticky Stage */
.leadership-scroller {
  position: relative;
  width: 100%;
}

.leadership-stage {
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  background-color: var(--bg);
}

/* Rule of Thirds Layout (2fr left / 1fr right) */
.leadership-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-12);
  align-items: center;
  height: 100%;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Right One-Third (Rule of Thirds): Sticky Header & Counter (Centered Vertically) */
.leadership-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: var(--space-4) 0;
  gap: var(--space-8);
  order: 2;
}

.leadership-header-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.leadership-right .section-label {
  color: var(--accent);
}

.leadership-right .section-title {
  color: var(--text);
  font-size: clamp(2rem, 3vw + 0.8rem, 3.25rem);
  line-height: 1.15;
}

.leadership-lead {
  font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  line-height: 1.6;
  color: var(--body);
  max-width: 340px;
}

.leadership-meta-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.leadership-counter-box {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 8px 18px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--card-shadow);
  width: fit-content;
}

.leadership-counter-current {
  color: var(--accent);
  font-size: 1.85rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leadership-counter-divider {
  color: var(--border-medium);
  font-weight: 400;
}

.leadership-counter-total {
  font-variant-numeric: tabular-nums;
}

/* Left Two-Thirds (Rule of Thirds): Scrolling Viewport with Boundary Fades */
.leadership-left {
  position: relative;
  height: 100%;
  max-height: calc(100svh - var(--header-height) - 48px);
  display: flex;
  align-items: center;
  overflow: hidden;
  order: 1;
}

/* Boundary Fade Overlays (preserved in DOM for structure, hidden so first & end cards do not fade) */
.leadership-boundary-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.leadership-boundary-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent 100%);
}

.leadership-boundary-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 30%, transparent 100%);
}

.leadership-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  padding: 24px 0 72px;
}

.leadership-track {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  will-change: transform;
}

/* Enlarged Leadership Achievement Cards */
.leadership-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  width: 100%;
}

.leadership-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--card-shadow-hover);
}

.leadership-card.is-active-leadership {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--card-shadow-hover);
}

.leadership-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.leadership-num {
  font-family: var(--font-heading);
  font-size: var(--font-small);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.leadership-badge {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.leadership-role {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.4vw + 0.8rem, 1.85rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.leadership-org {
  font-size: var(--font-small);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.leadership-desc {
  font-size: clamp(0.95rem, 0.3vw + 0.85rem, 1.1rem);
  line-height: 1.65;
  color: var(--body);
}

/* Tablet & Mobile Layout (< 1024px) */
@media (max-width: 1023px) {
  .leadership-stage {
    position: relative;
    top: 0;
    height: auto;
    min-height: calc(100svh - var(--header-height));
    padding: var(--space-10) 0;
  }

  .leadership-container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    height: auto;
  }

  .leadership-right {
    order: 1;
    height: auto;
    max-height: none;
    gap: var(--space-4);
    padding: 0;
  }

  .leadership-left {
    order: 2;
    max-height: 520px;
    height: auto;
    width: 100%;
  }

  .leadership-viewport {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 32px 0;
  }

  .leadership-viewport::-webkit-scrollbar {
    display: none;
  }

  .leadership-track {
    gap: var(--space-4);
  }
}

.num-highlight {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background-color: rgba(212, 160, 60, 0.14);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  display: inline-block;
  line-height: 1.25;
}

[data-theme="light"] .num-highlight {
  background-color: rgba(37, 99, 235, 0.10);
  color: var(--accent);
}

/* ==========================================================================
   Beyond the screen Section
   - Modular Flashcard Scrollytelling
   - Center-oriented layout: 3 on top row, 2 on bottom row (both centered)
   - Sticky pinned stage with sequential 3D flip on scroll
   - Front: prominent title filling space; Back: detailed accomplishments
   - Touch & keyboard accessible (Enter / Space / Click)
   ========================================================================== */
.beyond-section {
  position: relative;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.beyond-scroller {
  position: relative;
  width: 100%;
}

.beyond-stage {
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
}

.beyond-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  box-sizing: border-box;
}

/* Centered Header & Live Status Pill */
.beyond-header-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
}

.beyond-header-group .section-label {
  color: var(--accent);
}

.beyond-header-group .section-title {
  color: var(--text);
  font-size: clamp(2rem, 3vw + 0.8rem, 3rem);
  line-height: 1.15;
}

.beyond-live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 500;
  margin-top: var(--space-1);
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.beyond-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--muted);
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.beyond-status-dot.is-complete {
  background-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Modular Flashcard Container: Center-Oriented */
.beyond-cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-5);
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
}

/* Individual Flashcard with 3D Flip Perspective */
.beyond-flashcard {
  flex: 0 0 calc((100% - 2 * var(--space-5)) / 3 - 0.5px);
  max-width: 350px;
  min-width: 290px;
  height: clamp(210px, 24vh, 230px);
  perspective: 1200px;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
}

.beyond-flashcard:focus-visible .flashcard-front,
.beyond-flashcard:focus-visible .flashcard-back {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.beyond-flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-card);
}

.beyond-flashcard.is-flipped .beyond-flashcard-inner {
  transform: rotateY(180deg);
}

/* Front & Back Faces */
.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-card);
  box-sizing: border-box;
  background-color: var(--card);
}

/* Front Face: Bold title centered and filling the card */
.flashcard-front {
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: var(--space-5);
  transform: rotateY(0deg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.flashcard-front:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--card-shadow-hover);
}

.flashcard-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background-color: rgba(212, 160, 60, 0.12);
  border: 1px solid rgba(212, 160, 60, 0.25);
  align-self: center;
}

[data-theme="light"] .flashcard-badge {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

.flashcard-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.6vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
  padding: 0 var(--space-2);
  letter-spacing: -0.01em;
}

.flashcard-hint {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}

.beyond-flashcard:hover .flashcard-hint {
  color: var(--accent);
}

.flashcard-hint-icon {
  font-size: 0.85rem;
  transition: transform var(--transition-fast);
}

.beyond-flashcard:hover .flashcard-hint-icon {
  transform: rotate(180deg);
}

/* Back Face: Rich content revealing achievements */
.flashcard-back {
  border: 1px solid var(--border-medium);
  box-shadow: var(--card-shadow);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  scrollbar-width: thin;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.beyond-flashcard.is-flipped .flashcard-back {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--card-shadow-hover);
}

.flashcard-back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  flex-shrink: 0;
}

.flashcard-back-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.flashcard-badge-back {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.flashcard-back-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.flashcard-back-item {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--body);
  position: relative;
  padding-left: var(--space-4);
}

.flashcard-back-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--accent);
}

/* Responsive Styles */
@media (max-width: 1023px) {
  .beyond-stage {
    position: relative;
    top: auto;
    height: auto;
    min-height: calc(100svh - var(--header-height));
    padding: var(--space-12) 0;
  }

  .beyond-container {
    gap: var(--space-8);
  }

  .beyond-flashcard {
    flex: 0 0 calc((100% - var(--space-5)) / 2 - 0.5px);
    max-width: 360px;
    height: 210px;
  }
}

@media (max-width: 640px) {
  .beyond-stage {
    padding: var(--space-8) 0;
  }

  .beyond-flashcard {
    flex: 0 0 100%;
    max-width: 380px;
    height: 195px;
  }

  .flashcard-title {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   Credentials Section: Expandable Cards
   ========================================================================== */
.credentials-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 900px;
}

.cred-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cred-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--card-shadow-hover);
}

.cred-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  min-height: 64px;
}

.cred-trigger-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.cred-summary {
  font-size: var(--font-small);
  color: var(--muted);
  line-height: 1.5;
}

.cred-chevron {
  width: 20px;
  height: 20px;
  stroke: var(--muted);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition-normal), stroke var(--transition-fast);
  flex-shrink: 0;
}

.cred-trigger[aria-expanded="true"] .cred-chevron {
  transform: rotate(180deg);
  stroke: var(--accent);
}

.cred-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-normal);
  border-top: 1px solid transparent;
}

.cred-trigger[aria-expanded="true"] + .cred-panel {
  grid-template-rows: 1fr;
  border-top-color: var(--border);
}

.cred-panel-content {
  overflow: hidden;
  padding: 0 var(--space-6);
  transition: padding var(--transition-normal);
}

.cred-trigger[aria-expanded="true"] + .cred-panel .cred-panel-content {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.cred-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cred-subitem {
  font-size: var(--font-small);
  color: var(--body);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.cred-subitem:last-child {
  border-bottom: none;
}

.cred-subitem-title {
  font-weight: 500;
  color: var(--text);
}

.cred-subitem-meta {
  font-size: var(--font-xs);
  color: var(--muted);
  white-space: nowrap;
}

.cred-subitem-topic {
  font-size: var(--font-xs);
  color: var(--muted);
}

/* Credentials Inverted Section Styling with Ambient Gradient Glow */
.credentials-section {
  position: relative;
  overflow: hidden;
  background-color: var(--inv-bg);
  border-top: 1px solid var(--inv-border-medium);
  border-bottom: 1px solid var(--inv-border-medium);
  box-shadow: 0 -20px 60px -15px color-mix(in srgb, var(--accent) 25%, transparent), 
              0 20px 60px -15px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.credentials-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  pointer-events: none;
  z-index: 1;
}

.credentials-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  pointer-events: none;
  z-index: 1;
}

.credentials-container {
  position: relative;
  z-index: 2;
}

.credentials-gradient {
  top: 12%;
  right: -60px;
  width: clamp(480px, 52vw, 800px);
  height: clamp(480px, 52vw, 800px);
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 75%);
  opacity: 0.22;
  filter: blur(90px);
}

[data-theme="light"] .credentials-gradient {
  opacity: 0.14;
  filter: blur(85px);
}

.credentials-inverted .section-label {
  color: var(--accent);
}

.credentials-inverted .section-title {
  color: var(--inv-text);
}

.credentials-inverted .cred-card {
  background-color: var(--inv-surface);
  border: 1px solid var(--inv-border);
  box-shadow: var(--inv-card-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.credentials-inverted .cred-card:hover {
  background-color: var(--inv-surface-hover);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--inv-border-medium));
  box-shadow: var(--inv-card-shadow-hover), 0 0 20px -4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.credentials-inverted .cred-card.is-expanded,
.credentials-inverted .cred-card:has(.cred-trigger[aria-expanded="true"]) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--inv-border-medium));
  box-shadow: var(--inv-card-shadow-hover), 0 0 24px -4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.credentials-inverted .cred-title {
  color: var(--inv-text);
}

.credentials-inverted .cred-summary {
  color: var(--inv-muted);
}

.credentials-inverted .cred-chevron {
  stroke: var(--inv-muted);
}

.credentials-inverted .cred-trigger[aria-expanded="true"] .cred-chevron {
  stroke: var(--accent);
}

.credentials-inverted .cred-trigger[aria-expanded="true"] + .cred-panel {
  border-top-color: var(--inv-border);
}

.credentials-inverted .cred-subitem {
  border-bottom-color: var(--inv-border);
  color: var(--inv-body);
}

.credentials-inverted .cred-subitem-title {
  color: var(--inv-text);
}

.credentials-inverted .cred-subitem-topic {
  color: var(--inv-muted);
}

.credentials-inverted .cred-subitem-meta {
  color: var(--inv-muted);
}

.credentials-inverted .tag {
  background-color: var(--inv-num-bg);
  color: var(--inv-num-color);
  border-color: var(--inv-border-medium);
}

.credentials-inverted .btn-outline {
  border-color: var(--inv-border-medium);
  color: var(--inv-text);
}

.credentials-inverted .btn-outline:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ==========================================================================
   Contact Section ("Get in touch")
   Fills the entire viewport (zero bleed from previous section).
   ========================================================================== */
.contact-section {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
  position: relative;
  overflow: hidden;
  scroll-margin-top: var(--header-height);
  box-sizing: border-box;
}

.contact-container {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.contact-inner {
  max-width: min(760px, 100%);
  width: 100%;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-gradient {
  width: clamp(380px, 45vw, 650px);
  height: clamp(380px, 45vw, 650px);
  right: -100px;
  bottom: -80px;
  background: radial-gradient(circle closest-side, var(--accent) 0%, transparent 75%);
  opacity: 0.12;
  filter: blur(80px);
}

[data-theme="light"] .contact-gradient {
  opacity: 0.07;
  filter: blur(70px);
}

.contact-content {
  width: 100%;
}

.contact-closing {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw + 0.5rem, 2.4rem);
  color: var(--text);
  line-height: 1.35;
  margin-bottom: var(--space-8);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.contact-btn {
  min-height: 48px;
  height: 48px;
  padding: 0 var(--space-6);
  font-size: var(--font-small);
  font-weight: 600;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.contact-btn:active {
  transform: scale(0.98);
}

.contact-btn .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.contact-btn:hover .icon {
  transform: scale(1.08);
}

.contact-arrow {
  margin-left: 2px;
  stroke: currentColor;
  opacity: 0.65;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.contact-btn:hover .contact-arrow {
  transform: translate(2px, -2px);
  opacity: 1;
}


/* ==========================================================================
   CV Export Toast Notification
   ========================================================================== */
.cv-export-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background-color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.cv-export-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cv-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: var(--font-heading);
}

.cv-toast-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.cv-toast-action {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cv-toast-action:hover {
  background: var(--accent);
  color: #fff;
}

/* ==========================================================================
   CV Export Modal & Formatted Single-Page Sheet
   ========================================================================== */
.cv-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  box-sizing: border-box;
  animation: cvFadeIn 0.2s ease-out;
}

@keyframes cvFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cv-modal-window {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cv-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  flex-shrink: 0;
  gap: var(--space-3);
}

.cv-modal-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-modal-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.cv-modal-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.cv-modal-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-modal-download-btn,
.cv-modal-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cv-modal-download-btn {
  background-color: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.cv-modal-download-btn:hover {
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-1px);
}

.cv-modal-print-btn {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border-medium);
}

.cv-modal-print-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cv-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.cv-modal-close-btn:hover {
  color: var(--text);
}

.cv-modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .cv-modal-body {
  background-color: #f1f0eb;
}

.cv-preview-container {
  width: 100%;
  max-width: 780px;
}

/* Styled A4 Document Sheet (Screen & Print) */
.cv-sheet {
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 36px 42px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.cv-sheet-header {
  border-bottom: 2px solid #d4a03c;
  padding-bottom: 12px;
}

.cv-sheet-name {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #111111;
  margin: 0 0 4px 0;
  text-transform: uppercase;
}

.cv-sheet-sub {
  font-size: 0.95rem;
  color: #555555;
  font-weight: 500;
  margin: 0 0 4px 0;
}

.cv-sheet-contact {
  font-size: 0.85rem;
  color: #666666;
  margin: 0;
}

.cv-sheet-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b5801c;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 4px;
  margin: 0 0 4px 0;
}

.cv-sheet-summary {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #2b2b2b;
  margin: 0;
}

.cv-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.cv-item-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: #111111;
}

.cv-item-tags,
.cv-item-meta {
  font-size: 0.78rem;
  color: #666666;
}

.cv-item-desc {
  font-size: 0.83rem;
  line-height: 1.45;
  color: #333333;
  margin: 0;
}

.cv-items-compact-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cv-item-compact {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #333333;
}

.cv-item-compact strong {
  color: #111111;
}

.cv-sheet-footer {
  margin-top: 8px;
  border-top: 1px solid #e5e5e5;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888888;
}

/* ==========================================================================
   Print Stylesheet: Output ONLY the formatted CV sheet on A4
   ========================================================================== */
#print-cv-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  .app-container,
  #bg-canvas,
  #cv-modal-root,
  .cv-export-toast {
    display: none !important;
  }

  #print-cv-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    background: #ffffff !important;
  }

  #print-cv-container .cv-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
}
