/*
  2026 Product Leader Portfolio
  Aesthetic: FAANG-tier Technical Executive — stark, precision-driven, strictly sans-serif.
  Fonts: Inter (System UI fallback)
  Philosophy: Stripe/Vercel/Apple utilitarianism. Clean lines, deep contrast, micro-refined borders.
*/

/* ————— Light Mode (Default) ————— */
:root {
  --bg: #ffffff;
  --bg-raised: #f9f9f9;
  --bg-card: #f5f5f5;
  --text: #000000;
  --text-secondary: #5e5e5e;
  --accent: #009270; /* BCG Green */
  --accent-soft: rgba(0, 146, 112, 0.25);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --metric-value-color: #000000;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --quote-bg: rgba(0, 90, 60, 0.03);

  --font-display:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --container: 1200px;
  --gap: 1.5rem;
  --section-pad: clamp(2.5rem, 5vh, 4rem);
  --transition: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ————— Dark Mode ————— */
[data-theme="dark"] {
  --bg: #000000;
  --bg-raised: #0a0a0a;
  --bg-card: #141414;
  --text: #ffffff;
  --text-secondary: #888888;
  --accent: #00d28d;
  --accent-soft: rgba(0, 210, 141, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --nav-bg: rgba(0, 0, 0, 0.85);
  --metric-value-color: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
  --quote-bg: rgba(26, 179, 116, 0.04);
}

/* ————— Reset ————— */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition:
    background var(--transition),
    color var(--transition);

  /* Ensure content doesn't bleed under OS bottom bars */
  padding-bottom: env(safe-area-inset-bottom);
}

/* FAANG Tactile Active States (Haptics) */
a:active,
button:active,
.btn:active,
.domain-card:active {
  transform: scale(0.97) !important;
  opacity: 0.9 !important;
  transition:
    transform 0.05s ease-out,
    opacity 0.05s ease-out;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

em {
  font-family: var(--font-display);
  font-style: italic;
}
strong {
  font-weight: 600;
  color: var(--text);
}

/* ————— Layout ————— */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.section {
  padding-block: var(--section-pad);
}

.section-dark {
  background: var(--bg-raised);
}

hr.divider {
  border: none;
  height: 1px;
  background: var(--border);
}

/* ————— Section Divider (Accent Ornament) ————— */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 0;
  background: var(--bg-raised);
}

.divider-line {
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.divider-icon {
  font-size: 0.875rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* ————— Availability Badge ————— */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.availability-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

/* ————— Pre-Footer CTA Section ————— */
.cta-section {
  padding: clamp(3rem, 8vh, 6rem) 0;
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.cta-section .section-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.cta-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ————— Typography ————— */
.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.2rem;
  color: var(--accent);
}

/* ————— Nav ————— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  /* Safe Area compliance for iPhone Notches in Landscape */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px; /* Compressed for fold visibility */
  gap: 0.75rem; /* Gap for tight mobile grouping */
}

.nav-logo {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: none;
  gap: 2.25rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.3s ease;
}

.nav-links a.nav-resume {
  color: var(--accent);
  font-weight: 600;
}

.nav-links a.nav-resume::after {
  background: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-cta:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ————— Mobile Menu Overlay (FAANG Grade) ————— */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .nav-cta {
    display: none;
  }
}

.mobile-cta {
  color: var(--accent) !important;
  margin-top: 0.5rem;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  color: var(--text);
  cursor: pointer;
  z-index: 2001; /* Above the overlay */
  min-width: 44px; /* WCAG AAA Touch Target */
  min-height: 44px; /* WCAG AAA Touch Target */
  padding: 0;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  padding-top: calc(56px + env(safe-area-inset-top)); /* Clear nav bar */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Fallback blur for transparent backgrounds if desired, but solid bg is safer */
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.mobile-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Staggered Entrance Animation */
.mobile-overlay.is-active .mobile-link,
.mobile-overlay.is-active .mobile-overlay-footer {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(0.05s * var(--i));
}

.mobile-overlay-footer {
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ————— Theme Toggle ————— */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  min-width: 44px; /* WCAG AAA Touch Target */
  min-height: 44px; /* WCAG AAA Touch Target */
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  transform: rotate(15deg);
}

/* Show/hide icons based on theme */
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: inline;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* ————— Hero ————— */
.hero {
  padding-top: calc(56px + 0.5rem); /* Tighter top space */
  padding-bottom: 0.5rem; /* Compact for fold */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 0;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 2fr 1fr; /* 66% text | 33% portrait+metrics */
    align-items: center; /* Initial alignment */
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    align-items: end; /* Align items to bottom edge */
    gap: 2rem;
  }
}

.hero-avatar {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    var(--shadow-md);
  transition: all var(--transition);
}

.hero-avatar:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 0 6px var(--accent-soft),
    var(--shadow-lg);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
  line-height: 1; /* Exact single space */
}

.hero-body {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 100%; /* Spans full column width */
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-mission-line {
  display: block;
  color: var(--accent); /* BCG Green */
  font-weight: 600;
  margin-top: 0.5rem;
}

.hero-title .emphasis {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap; /* Desktop: Force one line */
}

@media (max-width: 480px) {
  .hero-title .emphasis {
    white-space: normal; /* iPhone: Allow wrap to prevent viewport blowout */
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ————— Buttons ————— */
.btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  min-height: 44px; /* WCAG AAA Touch Target */
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.9;
}

.btn-ghost {
  color: var(--text-secondary);
  padding-left: 0;
}

.btn-ghost:hover {
  color: var(--accent);
}

/* ————— Logo Bar (Marquee) ————— */
.logo-bar {
  padding-block: 0.75rem; /* Extra tight vertical space */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  overflow: hidden;
  width: 100%;
}

.logo-bar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Fade out edges */
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.logo-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: clamp(2rem, 5vw, 4rem);
  padding-left: clamp(2rem, 5vw, 4rem); /* Ensure gap loop matches */
  animation: marquee 35s linear infinite !important; /* Overrides OS reduced motion */
}

.logo-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.8; /* Full color, slightly lower opacity until hovered */
  padding: 0.5rem;
}

.logo-item:hover {
  opacity: 1;
  transform: translateY(-3px);
  filter: drop-shadow(var(--shadow-md));
}

.logo-item img {
  height: 44px; /* Slightly larger for full color pop */
  width: 44px;
  object-fit: contain;
  border-radius: 8px;
}

.logo-item span {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ————— Foundation Section ————— */
.section-foundation {
  background: var(--bg);
}

.foundation-content p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 0.35rem;
  max-width: 560px;
  line-height: 1.65;
}

.foundation-quote {
  margin: 0.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--quote-bg);
  border-radius: 0 12px 12px 0;
  position: relative;
  transition: all var(--transition);
}

.foundation-quote:hover {
  background: var(--accent-soft);
  transform: translateX(4px);
}

.foundation-quote p {
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 0;
  max-width: none;
  letter-spacing: -0.015em;
}

.foundation-coda {
  font-size: 0.9375rem !important;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* ————— Metric Stack (Hero) ————— */
.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.metric-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.metric-stack:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric {
  background: var(--bg-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background var(--transition);
  min-width: 0; /* Prevent flex blowout */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.metric:hover {
  background: var(--bg-raised);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--metric-value-color);
  line-height: 1;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ————— About ————— */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 4fr 8fr; /* Unified 4/8 ratio */
    gap: 1rem;
  }
}

.about-right p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
  max-width: 560px;
  line-height: 1.55;
}

/* ————— Domain Grid ————— */
.domain-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .domain-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  #hobbies .domain-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.domain-card {
  background: var(--bg);
  padding: 1.25rem; /* Compact for density */
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.domain-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--accent-soft);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.domain-card:hover::before {
  width: 100%;
}

.domain-card:hover {
  background: var(--bg-raised);
}

.domain-card > * {
  position: relative;
  z-index: 1;
}

.domain-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

.domain-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.domain-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.domain-logos {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.25rem 2rem; /* Vertical 1.25rem, Horizontal 2rem gap */
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.domain-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.domain-logo-item img {
  height: 44px; /* Matches branding ribbon */
  width: 64px; /* Slightly wider for landscape logos */
  object-fit: contain;
  opacity: 0.8;
  filter: grayscale(1) contrast(1.2);
  transition: all 0.3s ease;
}

.domain-logo-item span {
  font-size: 0.75rem; /* Slightly smaller for compactness */
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
}

.domain-logo-item:hover img {
  opacity: 1 !important;
  filter: grayscale(0) contrast(1);
  transform: translateY(-2px);
}

/* Ensure originally white logos invert to dark grey on light themes */
html:not([data-theme="dark"]) .domain-logos img.invert-on-light,
html:not([data-theme="dark"]) .logo-item img.invert-on-light {
  filter: invert(1) grayscale(1) !important;
}
html:not([data-theme="dark"]) .domain-logos img.invert-on-light:hover,
html:not([data-theme="dark"]) .logo-item img.invert-on-light:hover {
  filter: invert(1) grayscale(0) !important;
}

/* ————— Brain Section ————— */
.brain-content {
  max-width: 680px;
}

.brain-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.brain-text strong {
  color: var(--text);
}

.link-arrow {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.link-arrow:hover {
  opacity: 0.75;
  color: var(--accent);
  transform: translateX(3px);
}

/* ————— Credentials Grid ————— */
.credentials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .credentials-grid {
    grid-template-columns: 4fr 8fr;
    gap: 1rem;
  }
}

.cred-list {
  display: flex;
  flex-direction: column;
}

.cred-item {
  padding-block: 0.4rem; /* Surgical compact */
  border-top: 1px solid var(--border);
  transition: all var(--transition);
}

.cred-item:hover {
  padding-left: 0.75rem;
  border-top-color: var(--accent);
}

.cred-item h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cred-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ————— Experience ————— */
.experience-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .experience-grid {
    grid-template-columns: 4fr 8fr;
    gap: 1.5rem;
  }
}

.exp-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding-block: 0.45rem;
  border-top: 1px solid var(--border);
  transition: all var(--transition);
}

.exp-item:hover {
  padding-left: 0.5rem;
  border-top-color: var(--accent);
}

.exp-time {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding-top: 0.15rem;
}

.exp-item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.exp-item p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ————— Animations ————— */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for logo items */
.logo-item.reveal {
  transition-delay: calc(var(--i, 0) * 0.08s);
}

/* Subtle page-load fade */
body {
  animation: pageIn 0.6s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ————— Selection ————— */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ————— Scrollbar (Webkit) ————— */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ═══════════ Lightbox (Certificate Popups) ═══════════ */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 2rem;
  cursor: pointer;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* Certificate view icon */
.cred-item[onclick] {
  position: relative;
}

.cert-icon {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  opacity: 0.6;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.cred-item[onclick]:hover .cert-icon {
  opacity: 1;
  transform: scale(1.15);
}

/* ═══════════ Footer — BCG Green Polish ═══════════ */
.footer {
  background-color: #009270;
  color: #fff; /* White for legibility */
  padding: 0.65rem 0; /* Ultra compact */
  border-top: none;
}

.footer h2,
.footer p,
.footer a,
.footer .footer-attribution {
  color: #fff; /* White for legibility */
}

.footer a:hover {
  opacity: 0.7;
  color: #fff;
}

.footer .ag-logo {
  fill: #fff;
  opacity: 0.9;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand h2 {
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1;
}

.footer-brand p {
  font-size: 0.75rem;
  margin: 0.15rem 0 0;
  opacity: 0.8;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

.footer-attribution {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-socials svg {
  transition: transform 0.2s ease;
}

.footer-socials a:hover svg {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .footer-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ————— Modern Scroll Animations (IntersectionObserver) ————— */
/* Base Reveal Classes */
.reveal,
.reveal-blur,
.reveal-left,
.reveal-right {
  opacity: 0;
  visibility: hidden;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter; /* Hardware accel */
}

/* Specific Transforms */
.reveal {
  transform: translateY(80px);
}

.reveal-blur {
  transform: translateY(60px) scale(0.96);
  filter: blur(12px);
}

.reveal-left {
  transform: translateX(-100px);
}

.reveal-right {
  transform: translateX(100px);
}

/* Active State Triggered by Observer */
.reveal.is-visible,
.reveal-blur.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0) scale(1);
  filter: blur(0);
}

/* Stagger Effects for Children (e.g. Bento Grids, Experience Lists) */
.stagger-parent .stagger-item {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.stagger-parent.is-visible .stagger-item {
  opacity: 1;
  transform: translateY(0);
}

/* Automate stagger timing delays for up to 10 items */
.stagger-parent.is-visible .stagger-item:nth-child(1) {
  transition-delay: 0.1s;
}
.stagger-parent.is-visible .stagger-item:nth-child(2) {
  transition-delay: 0.2s;
}
.stagger-parent.is-visible .stagger-item:nth-child(3) {
  transition-delay: 0.3s;
}
.stagger-parent.is-visible .stagger-item:nth-child(4) {
  transition-delay: 0.4s;
}
.stagger-parent.is-visible .stagger-item:nth-child(5) {
  transition-delay: 0.5s;
}
.stagger-parent.is-visible .stagger-item:nth-child(6) {
  transition-delay: 0.6s;
}
.stagger-parent.is-visible .stagger-item:nth-child(n + 7) {
  transition-delay: 0.7s;
}

/* ————— Abstract Mesh Gradients (BCG Green Themed) ————— */

/* Premium Dark Mesh */
.bg-mesh-dark {
  background-color: var(--bg-raised);
  background-image:
    radial-gradient(at 10% 20%, rgba(0, 146, 112, 0.25) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 146, 112, 0.25) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(26, 179, 116, 0.03) 0px, transparent 60%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Premium Light Mesh (Subtle Aurora) */

.bg-mesh-dark-inverse {
  background-color: var(--bg);
  background-image:
    radial-gradient(at 100% 100%, rgba(0, 146, 112, 0.25) 0px, transparent 40%),
    radial-gradient(at 0% 0%, rgba(0, 146, 112, 0.25) 0px, transparent 60%);
}
.bg-mesh-light-inverse {
  background-color: var(--bg);
  background-image:
    radial-gradient(at 100% 100%, rgba(0, 146, 112, 0.2) 0px, transparent 40%),
    radial-gradient(at 0% 0%, rgba(0, 146, 112, 0.35) 0px, transparent 60%);
}

.bg-mesh-light {
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(0, 146, 112, 0.04) 0px, transparent 60%),
    radial-gradient(at 100% 100%, rgba(0, 146, 112, 0.2) 0px, transparent 60%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Clean Linear Gradient for Footer or CTA zones */
.bg-gradient-subtle {
  background: linear-gradient(
    135deg,
    var(--bg) 0%,
    rgba(0, 146, 112, 0.06) 100%
  );
}
