/* ============================================================
   IT PORTFOLIO — Master Stylesheet
   ============================================================ */

/* ============================================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
  /* --- Color Palette: Deep Navy Dark Mode --- */
  --color-bg-primary: #0a0e1a;
  --color-bg-secondary: #111827;
  --color-bg-card: #1a2035;
  --color-bg-card-hover: #1f2a45;

  --color-text-primary: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-heading: #f8fafc;

  /* Matches the blue from your logo */
  --color-accent: #008ecc;
  --color-accent-hover: #00a8f3;
  --color-accent-glow: rgba(0, 142, 204, 0.2);
  --color-accent-subtle: rgba(0, 142, 204, 0.1);

  --color-border: rgba(148, 163, 184, 0.12);
  --color-border-hover: rgba(0, 142, 204, 0.4);

  /* --- Typography --- */
  --font-primary: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-hero: clamp(2.5rem, 6vw, 4.5rem);

  --line-height-tight: 1.2;
  --line-height-normal: 1.6;

  /* --- Spacing Scale (8px grid) --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* --- Layout --- */
  --max-width: 1200px;
  --nav-height: 72px;
  --border-radius: 8px;

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* --- Shadows --- */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--color-accent-glow);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;

  /* Subtle Dot Matrix Pattern */
  background-image: radial-gradient(
    rgba(0, 142, 204, 0.15) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
  background-attachment: fixed;
}

/* Dynamic Ambient Glow Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;

  /* Tied to JS scroll variable */
  background: radial-gradient(
    ellipse 80% 60% at 50% var(--scroll-y, 0%),
    var(--color-accent-glow) 0%,
    transparent 70%
  );
  will-change: background;
}

@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;
  }
}

h1,
h2,
h3,
h4 {
  color: var(--color-text-heading);
  line-height: var(--line-height-tight);
  font-weight: 700;
}

h1 {
  font-size: var(--text-hero);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-xl);
}

p {
  color: var(--color-text-secondary);
  max-width: 72ch;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
  font-weight: 700;
  border-radius: var(--border-radius);
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 900;
  display: flex;
  align-items: center;
}

/* =====================================================
   FIX 1: Switched from flex + position:absolute to a
   CSS Grid 3-column layout (1fr | auto | 1fr).
   Logo lives in col 1, nav-menu in col 2 (auto-centered
   by the symmetric flanking columns), toggle in col 3.
   This is pixel-perfect centering with zero math hacks.
   ===================================================== */
.nav-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: var(--space-xl); /* separates logo | menu | toggle cells */
  align-items: center;
}

/* Grid column 1 — logo anchors left */
.nav-logo {
  display: flex; /* image + text side by side */
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  letter-spacing: -0.02em;
  white-space: nowrap;
  justify-self: start; /* flush left in its grid cell */
}

/* Nav logo image — sized to match the nav height proportion */
.nav-logo__img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-logo:hover {
  color: var(--color-accent);
}

/* Grid column 2 — menu sits in the auto-width center column.
   The symmetric 1fr columns on each side guarantee true center. */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-md); /* tightened from lg to fit 10 nav items */
}

/* No position:absolute needed — grid centering replaces it */

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding: var(--space-xs) 0;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--color-accent);
}

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

/* Grid column 3 — toggle hidden on desktop, flush right when shown.
   FIX 2: justify-self:end puts it in the far-right grid cell.
   margin-left:auto is a belt-and-suspenders guarantee for mobile flex. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--space-sm);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  justify-self: end; /* grid: sits flush-right in col 3 */
  margin-left: auto; /* flex fallback: pushed to far right */
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 1px;
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}

/* ============================================================
   SECTION SHARED STYLES
   ============================================================ */
section {
  padding: var(--space-4xl) 0;
}

section h2 {
  text-align: left;
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  text-align: left;
  margin-bottom: var(--space-2xl);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-height);
}

.hero-subtitle {
  font-size: var(--text-2xl);
  color: var(--color-accent);
  font-weight: 500;
  margin-top: var(--space-md);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.hero-tagline {
  font-size: var(--text-lg);
  margin-top: var(--space-md);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-2xl);
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-secondary:hover {
  background-color: var(--color-accent-subtle);
  transform: translateY(-2px);
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3xl);
  align-items: center;
}

.about-image img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--border-radius);
  border: 2px solid var(--color-border);
}

.about-text p {
  margin-bottom: var(--space-md);
}

.about-text .btn {
  margin-top: var(--space-lg);
}

/* ============================================================
   SKILLS GRID
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
}

.skill-card {
  background-color: var(--color-bg-card);
  padding: var(--space-xl);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  contain: content;
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.skill-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.skill-card h3 {
  color: var(--color-accent);
  margin-bottom: var(--space-md);
  font-size: var(--text-lg);
}

.skill-card li {
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.skill-card li:last-child {
  border-bottom: none;
}

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto 0 0;
  padding-left: var(--space-2xl);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--color-accent),
    var(--color-accent-glow),
    transparent
  );
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-3xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: calc(-1 * var(--space-2xl) - 5px);
  top: 6px;
  width: 12px;
  height: 12px;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.timeline-content h3 {
  margin-bottom: var(--space-xs);
}

.timeline-company {
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-content time {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.timeline-content p:last-child {
  margin-top: var(--space-sm);
}

/* ============================================================
   CERTIFICATIONS GRID
   ============================================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

/* Horizontal layout: badge image on left, info text on right */
.cert-card {
  background-color: var(--color-bg-card);
  padding: var(--space-lg); /* slightly tighter than xl to fit horizontal */
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  text-align: left; /* text left-aligned for side-by-side layout */
  contain: content;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-lg);
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.cert-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* Badge image — fixed square, no stretch */
.cert-card img {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03); /* subtle bg behind transparent PNGs */
  padding: 6px;
}

/* Text wrapper — takes remaining horizontal space */
.cert-card__info {
  flex: 1;
  min-width: 0; /* prevents text overflow in flex context */
}

.cert-card h3 {
  font-size: var(--text-base);
  margin-bottom: 2px;
  line-height: 1.3;
}

.cert-card p {
  text-align: left;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.cert-card time {
  display: block;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  margin: var(--space-xs) 0;
}

.cert-card a {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

/* On very small screens: stack image above text */
@media (max-width: 440px) {
  .cert-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .cert-card img {
    width: 72px;
    height: 72px;
  }
}

/* ============================================================
   COMING SOON CARDS
   Shared placeholder style used across Media Hub, Projects,
   and Testimonials while real content is being prepared.
   Drop-in replacement for real cards — no JS changes needed.
   ============================================================ */
.coming-soon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  background: var(--color-bg-card);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--border-radius);
  gap: var(--space-sm);
  min-height: 220px;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--transition-base),
    background var(--transition-base);
}

.coming-soon-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(0, 142, 204, 0.04) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.coming-soon-card:hover {
  border-color: rgba(0, 142, 204, 0.25);
  background: var(--color-bg-card-hover);
}

/* Large emoji icon */
.coming-soon-card__icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: var(--space-xs);
  opacity: 0.7;
}

/* "COMING SOON" pill label */
.coming-soon-card__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border: 1px solid rgba(0, 142, 204, 0.18);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Main descriptive title */
.coming-soon-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: var(--space-xs) 0 0;
  line-height: 1.4;
}

/* Secondary descriptor */
.coming-soon-card__sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 26ch;
  margin: 0 auto;
}

/* Animated pulsing dots */
.coming-soon-card__dots {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: var(--space-sm);
}

.coming-soon-card__dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.35;
  animation: coming-soon-pulse 1.4s ease-in-out infinite;
}

.coming-soon-card__dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.coming-soon-card__dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes coming-soon-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .coming-soon-card__dots span {
    animation: none;
    opacity: 0.4;
  }
}

/* ============================================================
   SECURITY CLEARANCE
   Amber/gold accent palette to distinguish from cert section.
   ============================================================ */
#clearance {
  --clearance-accent: #c8a840;
  --clearance-accent-subtle: rgba(200, 168, 64, 0.08);
  --clearance-accent-border: rgba(200, 168, 64, 0.25);
}

.clearance-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
  background: var(--color-bg-card);
  border: 1px solid var(--clearance-accent-border);
  border-left: 4px solid var(--clearance-accent);
  border-radius: var(--border-radius);
  padding: var(--space-xl) var(--space-2xl);
  transition: box-shadow var(--transition-base);
}

.clearance-card:hover {
  box-shadow: 0 4px 32px rgba(200, 168, 64, 0.12);
}

.clearance-card__shield {
  font-size: 3rem;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(200, 168, 64, 0.45));
  padding-top: 4px;
}

.clearance-card__body {
  flex: 1;
  min-width: 0;
}

.clearance-card__level {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.clearance-level-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 3px 12px;
  border-radius: 4px;
  background: var(--clearance-accent-subtle);
  color: var(--clearance-accent);
  border: 1px solid var(--clearance-accent-border);
  text-transform: uppercase;
}

.clearance-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #4ade80;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clearance-status-badge .status-dot {
  background: #4ade80;
  box-shadow: none;
  animation: clearance-ping 2.4s ease-in-out infinite;
}

@keyframes clearance-ping {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
}

.clearance-card h3 {
  font-size: var(--text-xl);
  color: var(--color-text-heading);
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.clearance-card__issuer {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.clearance-card__meta {
  display: flex;
  gap: var(--space-2xl);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.clearance-card__meta > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clearance-card__meta dt {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.clearance-card__meta dd {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.clearance-card__note {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--clearance-accent-border);
  padding-top: var(--space-md);
  margin: 0;
}

@media (max-width: 640px) {
  .clearance-card {
    flex-direction: column;
    padding: var(--space-xl);
  }
  .clearance-card__shield {
    font-size: 2.5rem;
    padding-top: 0;
  }
}

/* ============================================================
   MEDIA HUB
   ============================================================ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.media-card {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  contain: content;
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.media-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-bg-primary);
  overflow: hidden;
  cursor: pointer;
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.video-wrapper:hover .video-thumbnail {
  transform: scale(1.05);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  color: var(--color-accent);
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.video-play-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-bg-primary);
  transform: translate(-50%, -50%) scale(1.1);
}

.media-card h3 {
  padding: var(--space-md) var(--space-md) var(--space-xs);
}

.media-card p {
  padding: 0 var(--space-md) var(--space-md);
  font-size: var(--text-sm);
}

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 420px));
  justify-content: center;
  align-items: start; /* This prevents vertical stretching */
  gap: var(--space-xl);
}

.project-card {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  contain: content;
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.project-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.project-card > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.project-info {
  padding: var(--space-lg);
}

.project-info h3 {
  margin-bottom: var(--space-sm);
}

.project-info p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.project-tags li {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-accent-subtle);
  color: var(--color-accent);
  border-radius: 4px;
}

.project-links {
  display: flex;
  gap: var(--space-md);
}

.project-links a {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
#contact {
  background-color: var(--color-bg-secondary);
}

/* =====================================================
   FIX 3: .contact-grid was referenced in the HTML and
   in the 768px media query, but never defined at the
   base level — so the layout was effectively broken
   on desktop. Defined here as a single centered column
   so form and heading stack cleanly at all widths.
   ===================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  max-width: 720px; /* constrains the whole block for readability */
  margin: 0 auto; /* centers the grid within the section */
}

/* =====================================================
   FIX 3: Override the global section h2 { text-align: left }
   and .section-subtitle { text-align: left } rules that
   were causing the off-center appearance in this section.
   ===================================================== */
.contact-text {
  text-align: center;
}

.contact-text h2 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.contact-text .section-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0; /* spacing handled by .contact-grid gap */
}

#contact-form {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── hCaptcha captcha-wrapper ───────────────────────────────
   Standalone container — deliberately NOT using .form-group
   so that the .form-group input / .form-group textarea rules
   (width:100%, min-height:120px, background, border, etc.) never
   reach hCaptcha's internally injected elements.
   ──────────────────────────────────────────────────────────── */
.captcha-wrapper {
  text-align: center;
  margin-bottom: var(--space-md);
  /* Guarantee the row has height even before hCaptcha loads */
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Submit row — full-width button matching the input fields */
.form-group--submit {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.form-group--submit .btn {
  width: 100%; /* matches the input width for visual alignment */
  justify-content: center; /* flex-based buttons stay centered internally  */
}

/* Greyed-out disabled state — shown until hCaptcha is completed */
.form-group--submit .btn:disabled,
.form-group--submit .btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ============================================================
   FOOTER LOGO
   Centered logo mark above social links — book-ends the page
   alongside the nav logo. Same PNG source, sized at 56px.
   ============================================================ */
.footer-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.footer-logo img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  opacity: 0.75;
  transition: opacity var(--transition-base);
}

.footer-logo img:hover {
  opacity: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.social-links a {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

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

footer p {
  font-size: var(--text-sm);
  text-align: center;
  margin: 0 auto;
}

/* ============================================================
   FORM VALIDATION STATES
   ============================================================ */
.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.field-error {
  display: block;
  font-size: var(--text-sm);
  color: #ef4444;
  margin-top: var(--space-xs);
}

.form-status {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
}

.form-status--success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-status--error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* ============================================================
   MOBILE MENU STATES
   ============================================================ */
.nav-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}

.nav-toggle.is-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-image img {
    margin: 0 auto;
  }

  .about-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .nav-toggle {
    display: flex;
  }

  /* On mobile: only 2 visible flex items (logo + toggle).
       The nav-menu is position:fixed so it leaves flex flow.
       Switch container back to flex so space-between + margin-left:auto
       guarantees the toggle is pinned to the far right edge. */
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    left: auto;
    transform: translateX(100%);
    width: 280px;
    height: calc(100vh - var(--nav-height));
    background-color: var(--color-bg-secondary);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xl);
    gap: var(--space-sm);
    visibility: hidden;
    transition:
      transform var(--transition-base),
      visibility var(--transition-base);
  }

  .nav-link {
    font-size: var(--text-base);
    padding: var(--space-sm) 0;
    width: 100%;
  }

  .timeline {
    padding-left: var(--space-xl);
  }

  .timeline-marker {
    left: calc(-1 * var(--space-xl) - 5px);
  }

  /* contact-grid already single-column at base; gap tightened for mobile */
  .contact-grid {
    gap: var(--space-lg);
  }
}

@media (max-width: 480px) {
  :root {
    --space-4xl: 4rem;
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .skills-grid,
  .media-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  header,
  .nav-toggle,
  .skip-link,
  .video-play-btn,
  .hero-cta,
  #contact,
  footer nav {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555 !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  section {
    page-break-inside: avoid;
    padding: 1rem 0;
  }

  img {
    max-width: 100% !important;
  }
}
/* ============================================================
   NAV BACKDROP — BOKEH / BLUR OVERLAY
   ============================================================ */
.nav-backdrop {
  display: none; /* JS sets block on open  */
  position: fixed;
  inset: 0;
  top: var(--nav-height); /* starts below the header */
  z-index: 850; /* above content, below menu */
  background: rgba(5, 8, 18, 0.55);
  backdrop-filter: blur(14px) saturate(140%) brightness(0.7);
  -webkit-backdrop-filter: blur(14px) saturate(140%) brightness(0.7);
  opacity: 0;
  transition: opacity var(--transition-base);
  cursor: pointer; /* clicking it closes the menu */
}

.nav-backdrop.is-visible {
  opacity: 1;
}

/* Animated bokeh light orbs rendered as pseudo-elements */
.nav-backdrop::before,
.nav-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.nav-backdrop::before {
  width: 260px;
  height: 260px;
  background: radial-gradient(
    circle,
    rgba(0, 142, 204, 0.18) 0%,
    transparent 70%
  );
  top: 20%;
  left: 25%;
  filter: blur(24px);
  animation: bokeh-drift-a 8s ease-in-out infinite alternate;
}

.nav-backdrop::after {
  width: 180px;
  height: 180px;
  background: radial-gradient(
    circle,
    rgba(0, 168, 243, 0.14) 0%,
    transparent 70%
  );
  bottom: 25%;
  right: 20%;
  filter: blur(18px);
  animation: bokeh-drift-b 10s ease-in-out infinite alternate;
}

@keyframes bokeh-drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(30px, -25px) scale(1.15);
  }
}

@keyframes bokeh-drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-backdrop::before,
  .nav-backdrop::after {
    animation: none;
  }
}

/* Raise the mobile nav-menu above the backdrop */
@media (max-width: 768px) {
  .nav-menu {
    z-index: 870;
  }
}

/* ============================================================
   CAROUSEL — shared across Certs, Media, Projects
   ============================================================
   Layout (when active):

       [ ← ]  [ track-wrapper (overflow:hidden) ]  [ → ]
                       [ • • •  dots  • • • ]

   If card count is 3 or fewer the JS never builds the carousel,
   so these rules have zero effect and the original grids render
   exactly as before.
   ============================================================ */
.carousel-outer {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.carousel-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.carousel-track-wrapper {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.carousel-track {
  display: flex;
  transition: transform 0.46s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Each "page" inside the track takes the full visible width */
.carousel-track > * {
  flex: 0 0 100%;
  min-width: 0;
}

/* Carousel arrow buttons */
.carousel-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
}

.carousel-btn:hover:not(:disabled) {
  background: var(--color-bg-card-hover);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.carousel-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Dot indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.carousel-dot.is-active {
  background: var(--color-accent);
  transform: scale(1.4);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* On very small screens hide the arrow buttons; swipe + dots suffice */
@media (max-width: 480px) {
  .carousel-btn {
    display: none;
  }
}

/* ============================================================
   TIMELINE — "Show More" expand behaviour
   ============================================================ */

/* Items beyond position 3 are hidden while collapsed */
.timeline[data-collapsed] .timeline-item:nth-child(n + 4) {
  display: none;
}

/* Reveal animation applied by JS when items are shown */
@keyframes timeline-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-item.is-revealing {
  animation: timeline-reveal 0.35s ease forwards;
}

/* The expand / collapse toggle button */
.timeline-expand-btn {
  display: block;
  margin: var(--space-xl) auto 0;
  padding: var(--space-sm) var(--space-xl);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px; /* pill shape */
  color: var(--color-accent);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.timeline-expand-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  box-shadow: var(--shadow-glow);
}

.timeline-expand-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item.is-revealing {
    animation: none;
  }
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.65s ease,
    visibility 0.65s ease;
}

#preloader.preloader--fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.preloader-monogram {
  /* font-size is irrelevant — content is an <img>. Sizing is on the img rule below. */
  line-height: 1;
  opacity: 0;
  transform: scale(0.75);
  animation: preloader-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

/* Responsive logo: scales from 96px on a small phone up to 200px on a desktop.
   vmin ties the size to the shorter viewport dimension, so it always
   looks proportional whether the screen is portrait, landscape, or ultra-wide. */
.preloader-monogram img {
  display: block;
  width: clamp(96px, 22vmin, 200px);
  height: clamp(96px, 22vmin, 200px);
  object-fit: contain;
}

.preloader-bar-track {
  /* Bar matches the logo width exactly — single source of truth via clamp() */
  width: clamp(96px, 22vmin, 200px);
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: preloader-fadein 0.3s ease 0.4s forwards;
}

.preloader-bar-fill {
  height: 100%;
  width: 0;
  background: var(--color-accent);
  border-radius: 1px;
  animation: preloader-fill 1s ease 0.5s forwards;
}

@keyframes preloader-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes preloader-fadein {
  to {
    opacity: 1;
  }
}
@keyframes preloader-fill {
  to {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-monogram {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .preloader-bar-track,
  .preloader-bar-fill {
    animation: none;
    opacity: 1;
    width: 100%;
  }
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0; /* JS updates this on scroll */
  height: 3px;
  background: var(--color-accent);
  z-index: 910; /* above header (900) */
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--color-accent-glow);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================================
   STATUS BADGE
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 18px;
  /* Default: green (available) — overridden by [data-status] below */
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #10b981;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xl);
  /* Entrance animation — staggers in before the heading */
  opacity: 0;
  animation: badge-enter 0.5s ease 0.2s forwards;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981; /* default green */
  flex-shrink: 0;
  animation: status-ping 2.2s ease-in-out infinite;
}

/* ── Dynamic status colors — driven by data-status attribute ── */
/* To change availability: update the text in index.html AND    */
/* set data-status="available | unavailable | limited | away"   */
/* CSS handles all color changes automatically from there.      */

/* UNAVAILABLE / BUSY → red */
.status-badge[data-status="unavailable"],
.status-badge[data-status="busy"] {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.status-badge[data-status="unavailable"] .status-dot,
.status-badge[data-status="busy"] .status-dot {
  background: #ef4444;
  animation: status-ping-red 2.2s ease-in-out infinite;
}
@keyframes status-ping-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
  }
}

/* LIMITED → amber */
.status-badge[data-status="limited"] {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}
.status-badge[data-status="limited"] .status-dot {
  background: #f59e0b;
  animation: status-ping-amber 2.2s ease-in-out infinite;
}
@keyframes status-ping-amber {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
  }
}

/* AVAILABLE → green (already the default, explicit rule for clarity) */
.status-badge[data-status="available"] {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.28);
  color: #10b981;
}
.status-badge[data-status="available"] .status-dot {
  background: #10b981;
}

@keyframes badge-enter {
  to {
    opacity: 1;
  }
}

@keyframes status-ping {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-badge {
    animation: none;
    opacity: 1;
  }
  .status-dot {
    animation: none;
  }
}

/* ============================================================
   TYPEWRITER CURSOR
   ============================================================ */
.typewriter-cursor {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 300;
  margin-left: 2px;
  animation: cursor-blink 0.85s step-end infinite;
}

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

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

/* ============================================================
   STATS SECTION
   ============================================================ */
#stats {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}

.stat-item {
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

/* Vertical separator between items */
.stat-item + .stat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--color-border);
}

.stat-number {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--color-accent);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-sm);
}

.stat-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Remove the separator after position 2 on mobile */
  .stat-item:nth-child(3)::before {
    display: none;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   TESTIMONIALS SECTION
   ============================================================ */
#testimonials {
  padding: var(--space-4xl) 0;
}

.testimonials-container {
  margin-top: var(--space-2xl);
}

.testimonials-track-wrapper {
  overflow: hidden;
  border-radius: var(--border-radius);
}

.testimonials-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Each card takes the full visible width (1-at-a-time carousel) */
.testimonial-card {
  flex: 0 0 100%;
  min-width: 0;
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.testimonial-card:hover {
  border-color: var(--color-border-hover);
}

/* Large decorative opening quote mark */
.testimonial-quote-mark {
  position: absolute;
  top: -0.15em;
  left: var(--space-xl);
  font-size: 9rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.07;
  font-family: Georgia, "Times New Roman", serif;
  pointer-events: none;
  user-select: none;
}

.testimonial-card blockquote {
  margin: 0;
  position: relative; /* lifts above the decorative quote mark */
  z-index: 1;
}

.testimonial-card blockquote > p {
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  font-style: italic;
  line-height: 1.75;
  max-width: 100%;
  margin-bottom: var(--space-xl);
  padding-top: var(--space-md); /* space below the big quote mark */
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial-author div {
  text-align: left;
}

.testimonial-author img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-accent-subtle);
  flex-shrink: 0;
}

.testimonial-author cite {
  display: block;
  font-weight: 700;
  font-style: normal;
  color: var(--color-text-heading);
  font-size: var(--text-base);
}

.testimonial-author span {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Prev / next + dots row */
.testimonials-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity var(--transition-base),
    transform var(--transition-base),
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ============================================================
   IMAGE BLUR-UP PLACEHOLDERS
   ============================================================ */
img.blur-load {
  filter: blur(10px);
  transition: filter 0.55s ease;
}

img.blur-load.loaded {
  filter: blur(0);
}

/* 404 / broken placeholder images become invisible but preserve layout */
img.blur-load.img-error {
  visibility: hidden;
  filter: blur(0);
}

/* ============================================================
   DOWNLOADS / RESOURCES PAGE
   ============================================================ */

/* Active nav link — highlights "Resources" on downloads.html */
.nav-link--active {
  color: var(--color-accent) !important;
}

.nav-link--active::after {
  width: 100% !important;
}

/* ── Page hero ─────────────────────────────────────────────── */
.downloads-hero {
  padding: calc(var(--nav-height) + var(--space-3xl)) 0 var(--space-2xl);
  text-align: center;
}

.downloads-hero h1 {
  font-size: var(--text-hero);
  margin-bottom: var(--space-md);
}

.downloads-hero__sub {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 56ch;
  margin: 0 auto;
}

/* ── Filter bar ────────────────────────────────────────────── */
.downloads-filter-section {
  padding: 0 0 var(--space-xl);
  position: sticky;
  top: var(--nav-height); /* sticks just below the fixed header */
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 800;
}

.downloads-filter-section .container {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-sm);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.filter-btn {
  padding: 6px 18px;
  border-radius: 999px; /* pill shape */
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.filter-btn.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg-primary);
  box-shadow: var(--shadow-glow);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Result count label */
.filter-count {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

/* ── Resources grid ────────────────────────────────────────── */
.downloads-grid-section {
  padding: var(--space-3xl) 0 var(--space-4xl);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

/* ── Resource card ─────────────────────────────────────────── */
.resource-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.resource-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

/* display:flex on .resource-card normally overrides the browser's built-in
   [hidden] behaviour. This one rule restores expected hide/show from JS. */
.resource-card[hidden] {
  display: none !important;
}

/* Entrance animation applied by JS when a filter reveals cards */
.resource-card.filter-visible {
  animation: card-reveal 0.28s ease forwards;
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .resource-card.filter-visible {
    animation: none;
  }
}

/* Card header: accent-tinted strip with icon + category tag */
.resource-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-accent-subtle);
  border-bottom: 1px solid var(--color-border);
}

/* Large single-letter / emoji icon */
.resource-card__icon {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--color-accent);
  line-height: 1;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Category pill */
.resource-card__tag {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-accent-subtle);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Card body: title + description */
.resource-card__body {
  padding: var(--space-lg);
  flex: 1;
}

.resource-card__body h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text-heading);
}

.resource-card__body p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  max-width: 100%;
}

/* Card footer: file size + download button */
.resource-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.12);
}

.resource-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Compact download button — smaller than the global .btn */
.resource-card__btn {
  padding: 7px 18px !important;
  font-size: var(--text-sm) !important;
}

/* ── Empty state ───────────────────────────────────────────── */
.filter-empty {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.filter-empty p {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  margin: 0 auto;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .resources-grid {
    grid-template-columns: 1fr;
  }

  .downloads-filter-section {
    position: static; /* un-sticky on mobile, saves screen space */
  }

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    font-size: var(--text-xs);
    padding: 5px 14px;
  }
}

/* Forces grids to stay in a single row on desktop, with or without the carousel */
@media (min-width: 769px) {
  .projects-grid,
  .media-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ============================================================
   UNIFIED GRID SIZING (Keeps all sections proportional)
   ============================================================ */

/* 1. Force all grids to use the exact same baseline width */
.skills-grid,
.cert-grid,
.media-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  justify-content: center;
  align-items: stretch; /* Forces cards in the same row to match heights */
}

/* 2. Lock all carousels to a perfect 3-column layout on desktop */
@media (min-width: 769px) {
  .cert-grid,
  .media-grid,
  .projects-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* 3. Add minimum heights so shorter cards match the visual weight of Projects */
.media-card {
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.cert-card {
  min-height: 140px;
}

/* ============================================================
   SCROLLSPY DOTS — fixed right-edge section navigator
   Portfolio page only. JS adds "is-active" as sections scroll
   into the active viewport zone. Tooltip appears on hover.
   Hidden on mobile — replaced by the "On this page" drawer group.
   ============================================================ */

/* Container: vertically centered on right edge */
.scrollspy-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800; /* below header (900), above page content */
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  padding: 10px 6px;
}

/* Individual dot — muted by default, accent when active */
.scrollspy-dot {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(148, 163, 184, 0.25);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* Hover: grow and accent-colour the dot */
.scrollspy-dot:hover {
  background-color: var(--color-accent);
  transform: scale(1.4);
}

/* Active: accent + glow ring */
.scrollspy-dot.is-active {
  background-color: var(--color-accent);
  transform: scale(1.5);
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.scrollspy-dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 50%;
}

/* Tooltip label — floats left of the dot on hover.
   Uses data-label attribute set directly in the HTML. */
.scrollspy-dot::before {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 12px); /* gap between dot and label */
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  pointer-events: none; /* don't block clicks on the dot */
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.scrollspy-dot:hover::before {
  opacity: 1;
}

/* Hide dots entirely on mobile — "On this page" drawer takes over */
@media (max-width: 768px) {
  .scrollspy-dots {
    display: none;
  }
}

/* Reduced-motion: keep dots functional, skip scale transitions */
@media (prefers-reduced-motion: reduce) {
  .scrollspy-dot,
  .scrollspy-dot.is-active,
  .scrollspy-dot:hover {
    transform: none;
  }
}

/* ============================================================
   MOBILE NAV — "On this page" section group
   Portfolio page only. Hidden on desktop (horizontal nav has
   no room for section links). Revealed in mobile slide-out drawer.
   ============================================================ */

/* Default: all section-nav elements hidden on desktop */
.nav-section-item,
.nav-divider,
.nav-group-label {
  display: none;
}

/* Mobile drawer: reveal section group below the divider */
@media (max-width: 768px) {
  /* Thin rule separating page nav from section nav */
  .nav-divider {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--color-border);
    margin: var(--space-sm) 0;
  }

  /* "On this page" label */
  .nav-group-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    padding: var(--space-xs) 0 var(--space-sm);
  }

  /* Wrapper <li> for each section link */
  .nav-section-item {
    display: block;
    width: 100%;
  }

  /* Section links — indented and slightly dimmer than primary nav items */
  .nav-link--section {
    padding-left: var(--space-md);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
  }

  .nav-link--section:hover {
    color: var(--color-accent);
  }

  .nav-link--section::after {
    /* Reuse the underline hover from .nav-link but left-offset for the indent */
    left: var(--space-md);
  }
}

/* ============================================================
   RESOURCES PAGE — YOUTUBE SECTION
   Two-column layout: text + CTA on left, channel badge on right.
   Stacks to single column on mobile.
   ============================================================ */
.resources-youtube {
  padding: var(--space-4xl) 0;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Two-column grid: text takes more space than the badge card */
.resources-youtube__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.resources-youtube__text h2 {
  margin-bottom: var(--space-md);
}

.resources-youtube__text p {
  margin-bottom: var(--space-xl);
  max-width: 52ch;
}

.resources-youtube__cta {
  display: inline-flex;
}

/* Channel badge card — purely decorative, no embed */
.resources-youtube__card {
  display: flex;
  justify-content: center;
  align-items: center;
}

.yt-channel-badge {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl) var(--space-2xl);
  width: 100%;
  max-width: 380px;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.yt-channel-badge:hover {
  border-color: rgba(255, 0, 0, 0.4); /* YouTube red on hover */
  box-shadow: 0 4px 24px rgba(255, 0, 0, 0.08);
}

/* YouTube SVG icon container */
.yt-channel-badge__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-channel-badge__svg {
  width: 100%;
  height: 100%;
}

.yt-channel-badge__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.yt-channel-badge__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-heading);
  white-space: nowrap;
}

.yt-channel-badge__sub {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

/* Mobile: stack columns, center the badge */
@media (max-width: 768px) {
  .resources-youtube__inner {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .yt-channel-badge {
    max-width: 100%;
  }
}

/* ============================================================
   RESOURCES PAGE — COMING SOON (PIPELINE) SECTION
   3-card grid: Blog, Newsletter, Course.
   Uses distinct class names (.resources-pipeline-*) to avoid
   any collision with .coming-soon-card in the portfolio page.
   ============================================================ */
.resources-pipeline {
  padding: var(--space-4xl) 0;
}

/* 3-column auto-fit grid, matches the resources-grid rhythm */
.resources-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.resources-pipeline-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.resources-pipeline-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* Large emoji/glyph icon at top of card */
.resources-pipeline-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.resources-pipeline-card h3 {
  font-size: var(--text-xl);
  color: var(--color-text-heading);
  margin: 0;
}

.resources-pipeline-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  flex: 1; /* pushes badge to the bottom */
  margin: 0;
}

/* "Coming Soon" badge at the bottom of each card */
.resources-pipeline-card__badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border: 1px solid rgba(0, 142, 204, 0.25);
  border-radius: 999px;
}

/* Mobile: single column */
@media (max-width: 600px) {
  .resources-pipeline-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SOCIALS BAND — Platform Reveal hover animation
   Appears above the footer on all 3 pages.
   Pure CSS — no JavaScript required.
   ============================================================ */

/* Section wrapper — subtle top border to separate from content */
.socials-band {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--color-border);
}

/* 5-card flex row — wraps to 3+2 on mobile naturally */
.socials-band__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
}

/* ── Individual card ─────────────────────────────────────── */
.socials-band__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  flex: 0 0 150px; /* fixed width — wraps naturally at narrow viewports */
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  text-decoration: none;
  /* Animate: lift + border-color + shadow */
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* Card lift on hover */
.socials-band__card:hover {
  transform: translateY(-6px);
}

.socials-band__card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ── Icon ────────────────────────────────────────────────── */
.socials-band__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Animate: scale + slight counter-clockwise rotate on card hover */
  transition: transform var(--transition-base);
}

.socials-band__icon svg {
  width: 100%;
  height: 100%;
  fill: var(
    --color-text-secondary
  ); /* muted default — overridden per platform */
  transition: fill var(--transition-base);
}

/* Scale + rotate when parent card is hovered */
.socials-band__card:hover .socials-band__icon {
  transform: scale(1.2) rotate(-8deg);
}

/* ── Platform name (always visible) ─────────────────────── */
.socials-band__platform {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  transition: color var(--transition-base);
}

/* ── Handle (fades up from below on hover) ───────────────── */
.socials-band__handle {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
  /* Initially hidden below its position */
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base);
}

.socials-band__card:hover .socials-band__handle {
  opacity: 1;
  transform: translateY(0);
}

/* ── Platform brand colours bleed in on hover ────────────── */

/* LinkedIn — #0A66C2 */
.socials-band__card[data-platform="linkedin"]:hover {
  border-color: #0a66c2;
  box-shadow: 0 8px 32px rgba(10, 102, 194, 0.18);
}
.socials-band__card[data-platform="linkedin"]:hover .socials-band__icon svg {
  fill: #0a66c2;
}
.socials-band__card[data-platform="linkedin"]:hover .socials-band__platform {
  color: #0a66c2;
}

/* GitHub — #6e5494 */
.socials-band__card[data-platform="github"]:hover {
  border-color: #6e5494;
  box-shadow: 0 8px 32px rgba(110, 84, 148, 0.18);
}
.socials-band__card[data-platform="github"]:hover .socials-band__icon svg {
  fill: #6e5494;
}
.socials-band__card[data-platform="github"]:hover .socials-band__platform {
  color: #6e5494;
}

/* YouTube — #FF0000 */
.socials-band__card[data-platform="youtube"]:hover {
  border-color: #ff0000;
  box-shadow: 0 8px 32px rgba(255, 0, 0, 0.12);
}
.socials-band__card[data-platform="youtube"]:hover .socials-band__icon svg {
  fill: #ff0000;
}
.socials-band__card[data-platform="youtube"]:hover .socials-band__platform {
  color: #ff0000;
}

/* X / Twitter — #e7e7e7 on dark bg */
.socials-band__card[data-platform="x"]:hover {
  border-color: #e7e7e7;
  box-shadow: 0 8px 32px rgba(231, 231, 231, 0.1);
}
.socials-band__card[data-platform="x"]:hover .socials-band__icon svg {
  fill: #e7e7e7;
}
.socials-band__card[data-platform="x"]:hover .socials-band__platform {
  color: #e7e7e7;
}

/* Discord — #5865F2 */
.socials-band__card[data-platform="discord"]:hover {
  border-color: #5865f2;
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.18);
}
.socials-band__card[data-platform="discord"]:hover .socials-band__icon svg {
  fill: #5865f2;
}
.socials-band__card[data-platform="discord"]:hover .socials-band__platform {
  color: #5865f2;
}

/* ── Reduced-motion: disable transforms, keep color transitions ── */
@media (prefers-reduced-motion: reduce) {
  .socials-band__card:hover,
  .socials-band__card:hover .socials-band__icon {
    transform: none;
  }
  /* Show handle immediately — no motion available to fade it up */
  .socials-band__handle {
    opacity: 1;
    transform: none;
  }
}

/* ── Mobile: cards fit 3+2 naturally via flex-wrap ───────── */
@media (max-width: 540px) {
  .socials-band__card {
    flex: 0 0 calc(33.333% - var(--space-lg));
    padding: var(--space-lg) var(--space-md);
  }
}

/* ============================================================
   FOOTER — Site Status standalone link
   Replaces the social-links nav removed in Step 8.
   ============================================================ */
.footer-status a {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  transition: color var(--transition-fast);
}

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

/* ============================================================
   HERO SLOGAN WORD STAGGER ANIMATION
   ============================================================
   Used on both portfolio.html and index.html.
   Each .hero-slogan-word span carries a --i custom property
   (0–6) assigned via :nth-child() rules below — no inline
   style attributes required. The animation-delay staggers
   each word so they fade+rise in sequence.
   Defined here once — both pages inherit it automatically.
   ============================================================ */

/* Each word starts invisible and shifted down */
.hero-slogan-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  animation: slogan-word-in 0.45s ease forwards;
  /* 0.08s per word + 0.5s base offset (clears preloader fade) */
  animation-delay: calc(var(--i, 0) * 0.08s + 0.5s);
}

/* Fade up into position */
@keyframes slogan-word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accent "&" glyph — accent colour */
.slogan-accent {
  color: var(--color-accent);
}

/* Reduced-motion: show all words immediately, no animation */
@media (prefers-reduced-motion: reduce) {
  .hero-slogan-word {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Assign --i stagger index via :nth-child so no inline style="" is needed */
.hero-tagline .hero-slogan-word:nth-child(1) {
  --i: 0;
}
.hero-tagline .hero-slogan-word:nth-child(2) {
  --i: 1;
}
.hero-tagline .hero-slogan-word:nth-child(3) {
  --i: 2;
}
.hero-tagline .hero-slogan-word:nth-child(4) {
  --i: 3;
}
.hero-tagline .hero-slogan-word:nth-child(5) {
  --i: 4;
}
.hero-tagline .hero-slogan-word:nth-child(6) {
  --i: 5;
}
.hero-tagline .hero-slogan-word:nth-child(7) {
  --i: 6;
}

/* ============================================================
   HOMEPAGE — GLOBAL OVERRIDES
   ============================================================
   The global section h2 rule aligns headings left (portfolio
   default). The homepage is centred throughout, so we override
   at the .page-home scope. Mission section reverts to left
   because it has a two-column text layout.
   ============================================================ */
.page-home section h2 {
  text-align: center;
}

.page-home .section-subtitle {
  text-align: center !important;
}

/* Mission section: two-column layout — headings back to left */
.page-home #mission h2,
.page-home #mission .section-subtitle {
  text-align: left;
}

/* ============================================================
   HOMEPAGE — HERO SECTION
   ============================================================
   The base #hero rule (min-height, flex, center) lives at
   line ~367 and applies to both pages. These additions are
   homepage-specific, scoped to .page-home.
   ============================================================ */

/* Animated accent glow behind the hero content — subtle pulse */
.page-home #hero {
  position: relative;
  overflow: hidden;
}

.page-home #hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at 50% 42%,
    rgba(0, 142, 204, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
  animation: hero-glow-pulse 7s ease-in-out infinite;
  will-change: opacity;
}

@keyframes hero-glow-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Content wrapper — centers everything vertically in the section */
.home-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative; /* above the ::before glow layer */
  z-index: 1;
}

/* Brand logo mark above the h1 */
.home-hero__logo {
  margin-bottom: var(--space-lg);
}

.home-hero__logo img {
  width: clamp(72px, 10vw, 112px);
  height: auto;
  display: block;
}

/* Brand name — larger than the portfolio name heading */
.home-hero__name {
  font-size: var(--text-hero);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

/* Slogan — slightly bigger than the portfolio tagline */
.home-hero__slogan {
  font-size: clamp(var(--text-base), 2.5vw, var(--text-xl));
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: var(--space-lg);
}

/* Reduced-motion: skip hero glow pulse */
@media (prefers-reduced-motion: reduce) {
  .page-home #hero::before {
    animation: none;
    opacity: 0.6;
  }
}

/* ============================================================
   HOMEPAGE — SERVICES (WHAT WE DO) SECTION
   ============================================================
   3-column card grid on desktop, 1-column on mobile.
   Alternate background so it reads as a distinct band.
   ============================================================ */
#services {
  background: var(--color-bg-secondary);
}

/* 3-column auto-fit grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

/* Service card */
.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.service-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* Icon container — accent colour fill */
.service-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-subtle);
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 24px;
  height: 24px;
  fill: var(--color-accent);
}

.service-card h3 {
  font-size: var(--text-xl);
  color: var(--color-text-heading);
  margin: 0;
}

.service-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
  flex: 1;
}

/* YouTube card link inside paragraph */
.service-card p a {
  color: var(--color-accent);
}

.service-card p a:hover {
  color: var(--color-accent-hover);
}

@media (max-width: 600px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   HOMEPAGE — MISSION SECTION
   ============================================================
   Two-column layout: photo left, text + CTA right.
   Stacks single-column on mobile.
   ============================================================ */

/* 2-column grid: equal halves on desktop */
.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-3xl);
  align-items: center;
}

/* Photo — rounded, constrained */
.mission-photo img {
  width: 100%;
  max-width: 360px;
  border-radius: calc(var(--border-radius) * 2);
  display: block;
}

/* Text block */
.mission-text h2 {
  margin-bottom: var(--space-md);
}

.mission-text p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  max-width: 54ch;
}

.mission-text p:last-of-type {
  margin-bottom: var(--space-xl);
}

/* Mobile: stack photo above text */
@media (max-width: 768px) {
  .mission-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .mission-photo img {
    max-width: 240px;
    margin: 0 auto;
  }
}

/* ============================================================
   HOMEPAGE — RESOURCES PREVIEW SECTION
   ============================================================
   3-card grid linking to YouTube, /resources, and coming soon.
   Cards are full <a> elements — entire card is clickable.
   ============================================================ */

/* Preview grid — 3 columns, same rhythm as other grids */
.resources-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

/* Card as an anchor element */
.resources-preview-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.resources-preview-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.resources-preview-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* "Coming soon" card — slightly dimmer border */
.resources-preview-card--soon {
  border-style: dashed;
}

/* Icon square */
.resources-preview-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-subtle);
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.resources-preview-card__icon svg {
  width: 24px;
  height: 24px;
  fill: var(--color-accent);
}

.resources-preview-card h3 {
  font-size: var(--text-xl);
  color: var(--color-text-heading);
  margin: 0;
}

.resources-preview-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
  flex: 1; /* pushes link text to the bottom */
}

/* "Watch now →" style inline link text at card bottom */
.resources-preview-card__link {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-top: auto;
  transition: color var(--transition-fast);
}

.resources-preview-card:hover .resources-preview-card__link {
  color: var(--color-accent-hover);
}

@media (max-width: 600px) {
  .resources-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   HOMEPAGE — SOCIAL PROOF SECTION
   ============================================================
   Single featured testimonial card, centred on page.
   Reuses the .testimonial-card markup patterns from portfolio.
   .testimonial-featured is a standalone (no carousel wrapper).
   ============================================================ */
#social-proof {
  background: var(--color-bg-secondary);
}

/* Constrain testimonial to a comfortable reading width */
.testimonial-featured {
  max-width: 780px;
  margin: var(--space-2xl) auto 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-2xl);
  position: relative;
}

/* Large decorative quote mark — same as portfolio testimonial */
.testimonial-featured .testimonial-quote-mark {
  font-size: 5rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.25;
  font-family: Georgia, serif;
  position: absolute;
  top: var(--space-md);
  left: var(--space-xl);
  pointer-events: none;
  user-select: none;
}

.testimonial-featured blockquote {
  margin: 0;
  padding-top: var(--space-lg);
}

.testimonial-featured blockquote p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-xl);
}

/* Author row — avatar + name + role */
.testimonial-featured .testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.testimonial-featured .testimonial-author img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.testimonial-featured .testimonial-author cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--color-text-heading);
  font-size: var(--text-sm);
}

.testimonial-featured .testimonial-author span {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* CTA below the testimonial card */
.social-proof__cta-line {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-top: var(--space-xl);
}

/* ============================================================
   HOMEPAGE — CONTACT CTA STRIP
   ============================================================
   Full-width section with accent-tinted background.
   One-liner copy + single button → /portfolio#contact.
   No form — just a conversion nudge.
   ============================================================ */
.contact-cta-strip {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

/* Slight accent glow behind the strip */
.contact-cta-strip .container {
  position: relative;
}

.contact-cta-strip .container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 50% 80% at 50% 50%,
    var(--color-accent-subtle) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.contact-cta-strip h2 {
  text-align: center;
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-md);
}

.contact-cta-strip p {
  color: var(--color-text-secondary);
  max-width: 52ch;
  margin: 0 auto var(--space-xl);
  position: relative;
  z-index: 1;
}

.contact-cta-strip .btn {
  position: relative;
  z-index: 1;
}

/* ============================================================
   HOMEPAGE — SECTION SUBTITLE AND H2 CENTERING (TARGETED FIX)
   ============================================================
   Belt-and-suspenders over the .page-home scope rules.
   Direct ID selectors are unambiguous and beat the global
   section h2 { text-align: left } rule at any cascade position.
   ============================================================ */
#services h2,
#resources-preview h2,
#social-proof h2 {
  text-align: center !important;
}

/* Section subtitles that need to be visually centered.
   max-width:100% overrides the global p { max-width: 72ch } rule
   which would otherwise left-anchor the paragraph block. */
#services .section-subtitle,
#resources-preview .section-subtitle,
#social-proof .section-subtitle {
  text-align: center !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* CTA link below the featured testimonial card */
.social-proof__cta-line {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important; /* override p { max-width: 72ch } */
  max-width: 100% !important;
  margin-top: var(--space-xl);
}

/* Footer status link — centred on all screen sizes.
   Overrides any inherited flex/block alignment from .container. */
.footer-status {
  /* Centered on all screen sizes.
     width:100% + max-width:100% override the global p { max-width: 72ch }
     that was left-anchoring the paragraph block. */
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  width: 100% !important;
  max-width: 100% !important;
  margin: var(--space-sm) auto !important;
}

/* ================================================================
   STYLES TO APPEND TO styles.css
   Add these blocks at the end of the file.
   ================================================================ */

/* ----------------------------------------------------------------
   FOOTER LEGAL ROW
   Second row of footer links below Site Status.
   Centered, muted, small text. Dots as separators.
---------------------------------------------------------------- */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: 0.5rem;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: var(--color-text-muted, #6b7280);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.footer-legal a {
  color: var(--color-text-muted, #6b7280);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--color-accent);
}

.footer-legal span[aria-hidden="true"] {
  color: var(--color-text-muted, #6b7280);
  opacity: 0.5;
}

/* ----------------------------------------------------------------
   REDDIT SOCIALS BAND CARD
   Brand color: #FF4500. Matches existing platform card pattern.
---------------------------------------------------------------- */
.socials-band__card[data-platform="reddit"]:hover,
.socials-band__card[data-platform="reddit"]:focus-visible {
  border-color: #ff4500;
}

.socials-band__card[data-platform="reddit"]:hover .socials-band__icon svg,
.socials-band__card[data-platform="reddit"]:focus-visible
  .socials-band__icon
  svg {
  fill: #ff4500;
}

.socials-band__card[data-platform="reddit"]:hover .socials-band__platform,
.socials-band__card[data-platform="reddit"]:focus-visible
  .socials-band__platform {
  color: #ff4500;
}

/* ----------------------------------------------------------------
   LEGAL PAGES — page-legal body class
   Shared layout for privacy.html, terms.html, aup.html
---------------------------------------------------------------- */

/* Legal content section wrapper */
.legal-content {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 6rem);
}

/* Constrained readable prose width */
.legal-container {
  max-width: 72ch;
  margin: 0 auto;
}

/* Override global p max-width for legal prose */
.legal-container p {
  max-width: 100%;
  margin: 0 auto 1.25rem;
  line-height: 1.75;
  color: var(--color-text-secondary, #d1d5db);
}

/* Legal headings */
.legal-container h2 {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: var(--color-text-primary, #f9fafb);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Legal lists */
.legal-container ul {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
  list-style: disc;
}

.legal-container ul li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: var(--color-text-secondary, #d1d5db);
}

/* Inline strong within legal prose */
.legal-container strong {
  color: var(--color-text-primary, #f9fafb);
  font-weight: 600;
}

/* Inline links within legal prose */
.legal-container a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 142, 204, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.legal-container a:hover,
.legal-container a:focus-visible {
  text-decoration-color: var(--color-accent);
}

/* ----------------------------------------------------------------
   CONTACT PAGE — page-contact body class
   Standalone contact form layout.
---------------------------------------------------------------- */

/* Page header — shared by contact and legal pages */
.page-header {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}

.page-header__title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-text-primary, #f9fafb);
  margin-bottom: 0.75rem;
}

.page-header__subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--color-text-secondary, #d1d5db);
  max-width: 56ch;
  margin: 0 auto;
}

/* Contact section wrapper */
.contact-section {
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(3rem, 6vw, 6rem);
}

/* Contact info channel list */
.contact-channels {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.contact-channels__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-channels__item:last-child {
  border-bottom: none;
}

.contact-channels__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.contact-channels__link {
  color: var(--color-text-secondary, #d1d5db);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.95rem;
}

.contact-channels__link:hover,
.contact-channels__link:focus-visible {
  color: var(--color-text-primary, #f9fafb);
}

/* Contact info heading */
.contact-info__heading {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--color-text-primary, #f9fafb);
  margin-bottom: 0.75rem;
}

.contact-info__body {
  color: var(--color-text-secondary, #d1d5db);
  line-height: 1.7;
  max-width: 100%;
}
/* ============================================================
   MOBILE NAV ALIGNMENT FIX (BULLETPROOF)
   Pins the hamburger directly to the top-right screen edge
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle {
    position: fixed !important;
    /* Vertically centers it in your 72px tall header */
    top: 16px !important;
    /* Pins it to the right, matching your container padding */
    right: var(--space-lg) !important;
    margin: 0 !important;
    z-index: 999 !important;
  }
}

/* Instantly hides the preloader on subsequent page loads */
html.skip-preloader #preloader {
  display: none !important;
}

/* ----------------------------------------------------------------
   YOUTUBE COMMENTS CAROUSEL — show/hide variant (index.html)
   JS controls display directly via inline style; track switches
   from flex to block so cards stack instead of sliding.
---------------------------------------------------------------- */
[data-yt-carousel] .testimonials-track {
  display: block;
}

/* ----------------------------------------------------------------
   HONEYPOT — hides the anti-spam field on Contact.html.
   Defined in CSS so no inline style="" attribute is needed.
---------------------------------------------------------------- */
input[name="website"] {
  display: none;
}

/* ----------------------------------------------------------------
   404 PAGE — page-404 body class.
   Moved from an inline <style> block so style-src 'unsafe-inline'
   is not required in the Content-Security-Policy.
---------------------------------------------------------------- */
.error-section {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-height);
}

.error-content {
  max-width: 560px;
  margin: 0 auto;
}

.error-code {
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
  letter-spacing: -0.04em;
  opacity: 0;
  animation: error-in 0.6s ease 0.1s forwards;
}

.error-divider {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin: var(--space-lg) auto;
  opacity: 0;
  animation: error-in 0.5s ease 0.3s forwards;
}

.error-content h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: error-in 0.5s ease 0.4s forwards;
}

.error-content p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin: 0 auto var(--space-2xl);
  max-width: 46ch;
  opacity: 0;
  animation: error-in 0.5s ease 0.5s forwards;
}

.error-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: error-in 0.5s ease 0.6s forwards;
}

@keyframes error-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-code,
  .error-divider,
  .error-content h1,
  .error-content p,
  .error-cta {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .error-cta {
    flex-direction: column;
    align-items: center;
  }
}
