/* ==========================================================================
   RAGHAVENDRAN PORTFOLIO – styles.css
   Mobile-first, Dark/Light theme, BEM-influenced naming
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Dark theme (default) */
  --bg-primary:       #0a0a0f;
  --bg-secondary:     #111118;
  --bg-tertiary:      #1a1a28;
  --bg-card:          #16161f;
  --bg-card-hover:    #1e1e2e;

  --text-primary:     #f0f0ff;
  --text-secondary:   #a0a0c0;
  --text-muted:       #6b6b8f;
  --text-inverse:     #0a0a0f;

  --accent-primary:   #4f8ef7;
  --accent-secondary: #7c5cbf;
  --accent-tertiary:  #00d4aa;
  --accent-strava:    #fc4c02;

  --border-subtle:    rgba(255,255,255,0.06);
  --border-default:   rgba(255,255,255,0.12);
  --border-focus:     var(--accent-primary);

  --gradient-hero:    linear-gradient(135deg, #0a0a0f 0%, #111118 50%, #0d1226 100%);
  --gradient-accent:  linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --gradient-strava:  linear-gradient(135deg, #fc4c02, #e63900);

  --shadow-sm:        0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:        0 24px 64px rgba(0,0,0,0.5);
  --shadow-glow:      0 0 40px rgba(79,142,247,0.15);

  --radius-sm:        6px;
  --radius-md:        12px;
  --radius-lg:        20px;
  --radius-xl:        32px;
  --radius-full:      9999px;

  --font-sans:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:        'JetBrains Mono', 'Fira Code', monospace;

  --transition-fast:  150ms ease;
  --transition-base:  250ms ease;
  --transition-slow:  400ms ease;

  --nav-height:       70px;
  --container-max:    1200px;
  --container-pad:    clamp(1rem, 4vw, 2rem);
}

[data-theme="light"] {
  --bg-primary:       #fafafa;
  --bg-secondary:     #f0f0f8;
  --bg-tertiary:      #e8e8f0;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f8f8ff;

  --text-primary:     #0a0a1a;
  --text-secondary:   #3d3d5c;
  --text-muted:       #7070a0;
  --text-inverse:     #fafafa;

  --accent-primary:   #2563eb;
  --accent-secondary: #7c3aed;
  --accent-tertiary:  #059669;

  --border-subtle:    rgba(0,0,0,0.05);
  --border-default:   rgba(0,0,0,0.12);

  --gradient-hero:    linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);

  --shadow-sm:        0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg:        0 24px 64px rgba(0,0,0,0.15);
  --shadow-glow:      0 0 40px rgba(37,99,235,0.1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

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

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

a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul { list-style: none; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79,142,247,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79,142,247,0.5);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}
.btn-outline:hover {
  background: var(--accent-primary);
  color: #fff;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   5. NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background-color var(--transition-slow), backdrop-filter var(--transition-slow), box-shadow var(--transition-slow);
}

.site-header.scrolled {
  background-color: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--border-subtle);
}

[data-theme="light"] .site-header.scrolled {
  background-color: rgba(250,250,250,0.85);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-bracket {
  color: var(--accent-primary);
}

.nav-links {
  display: none;
  flex: 1;
  justify-content: center;
  gap: 0.25rem;
}

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

.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background-color: var(--border-subtle);
  opacity: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.theme-icon--dark  { display: block; }
.theme-icon--light { display: none;  }
[data-theme="light"] .theme-icon--dark  { display: none;  }
[data-theme="light"] .theme-icon--light { display: block; }

.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  padding: 0 10px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

/* ── Visitor Counter (Nav) ─────────────────────────────────────────────── */
.nav-vc {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.65rem 0.3rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: default;
  user-select: none;
  white-space: nowrap;
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              background var(--transition-base);
}

.nav-vc:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.12), var(--shadow-sm);
}

[data-theme="light"] .nav-vc:hover {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1), var(--shadow-sm);
}

.nav-vc__eye {
  color: var(--accent-primary);
  opacity: 0.85;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.nav-vc:hover .nav-vc__eye { opacity: 1; }

/* Roller container: clips digit tracks */
.nav-vc__roller {
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--nvc-h, 18px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* Individual digit slot */
.nvc-digit {
  display: inline-block;
  height: var(--nvc-h, 18px);
  overflow: hidden;
  position: relative;
}

/* The scrolling track (10 digits 0–9 stacked) */
.nvc-track {
  display: flex;
  flex-direction: column;
  /* transition applied via JS after first paint to avoid flash */
}

.nvc-track span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nvc-h, 18px);
  line-height: 1;
}

/* Comma / separator character */
.nvc-sep {
  display: inline-flex;
  align-items: center;
  height: var(--nvc-h, 18px);
  color: var(--text-muted);
  padding: 0 1px;
  font-weight: 400;
}

/* "visitors" label — hidden on very small screens */
.nav-vc__label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

@media (max-width: 479px) {
  .nav-vc__label    { display: none; }
  .nav-vc           { padding: 0.3rem 0.45rem; }
}

/* ── End Visitor Counter ───────────────────────────────────────────────── */

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mobile-nav-link {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.mobile-nav-link:hover { color: var(--accent-primary); opacity: 1; }

/* --------------------------------------------------------------------------
   6. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  background: var(--gradient-hero);
  padding-top: var(--nav-height);
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 420px;
    gap: 3rem;
    padding: 0 var(--container-pad);
    max-width: var(--container-max);
    margin: 0 auto;
  }
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.hero-content {
  padding: var(--container-pad);
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .hero-content { padding: 0; }
}

.hero-eyebrow {
  display: flex;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-tertiary);
  border: 1px solid rgba(0,212,170,0.3);
  background: rgba(0,212,170,0.08);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

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

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-wrapper {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text-secondary);
  min-height: 2em;
  display: flex;
  align-items: center;
  gap: 0.25em;
  flex-wrap: wrap;
}

.hero-title-prefix { color: var(--text-secondary); }

.hero-title-typed {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  border-right: 2px solid var(--accent-primary);
  padding-right: 2px;
  animation: blink-cursor 0.8s step-end infinite;
  white-space: nowrap;
}

@keyframes blink-cursor {
  0%, 100% { border-color: var(--accent-primary); }
  50%       { border-color: transparent; }
}

.hero-summary {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-default);
  margin: 0 0.5rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.hero-tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
}

.tech-chip:hover {
  background: rgba(79,142,247,0.2);
  border-color: var(--accent-primary);
}

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  order: -1; /* above hero text on mobile */
}

@media (min-width: 900px) {
  .hero-image-wrapper {
    display: block;
    order: unset;
  }
}

/* Smaller circle on mobile */
@media (max-width: 899px) {
  .hero-image-wrapper { padding: 0.5rem 0 0; }
  .hero-image-frame   { width: 68px; height: 68px; }
  .hero-image-glow    { inset: -6px; }
}

.hero-image-frame {
  position: relative;
  width: 340px;
  height: 340px;
}

.hero-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border-default);
  position: relative;
  z-index: 1;
  transition: border-color var(--transition-slow);
}

.hero-image-frame:hover .hero-avatar {
  border-color: var(--accent-primary);
}

.hero-image-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,142,247,0.2) 0%, transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

.hero-scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  animation: scroll-bounce 2s ease-in-out infinite;
  z-index: 1;
}

.scroll-cue-text { letter-spacing: 0.1em; text-transform: uppercase; }
.scroll-cue-arrow { font-size: 1.2rem; }

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* --------------------------------------------------------------------------
   7. ABOUT SECTION
   -------------------------------------------------------------------------- */
.about { background: var(--bg-secondary); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 860px) {
  .about-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

.about-lead {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.about-body {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-body strong { color: var(--text-primary); font-weight: 600; }

/* Inline highlight spans used in about section + about-lead rendered from JSON */
.hi-ai   { color: var(--accent-primary);   font-weight: 700; }
.hi-data { color: var(--accent-secondary); font-weight: 700; }
.hi-cloud{ color: var(--accent-tertiary);  font-weight: 700; }
.hi-big  { font-size: 1.08em; }

.about-quick-facts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.quick-fact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.quick-fact-icon { font-size: 1.1rem; flex-shrink: 0; }

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: 1.5rem;
}

.about-certs-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

.certs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 600px) {
  .certs-list { grid-template-columns: 1fr 1fr; align-items: start; }
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cert-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.cert-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cert-item:hover::before { opacity: 1; }

.cert-icon {
  font-size: 2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.cert-info { flex: 1; min-width: 0; }

.cert-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.cert-issuer {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.4rem;
}

.cert-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cert-skeleton {
  height: 80px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

/* --------------------------------------------------------------------------
   8. EXPERIENCE / TIMELINE
   -------------------------------------------------------------------------- */
.experience { background: var(--bg-primary); }

.timeline {
  position: relative;
  padding-left: 0;
}

@media (min-width: 640px) {
  .timeline { padding-left: 2.5rem; }

  .timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
    border-radius: 2px;
  }
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

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

@media (min-width: 640px) {
  .timeline-dot {
    position: absolute;
    left: -2.5rem;
    top: 1.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(79,142,247,0.3);
  }
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-base);
}

.timeline-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  align-items: center;
}

.timeline-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.timeline-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.timeline-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.timeline-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-highlight-item::before {
  content: '▸';
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 0.05em;
}

.timeline-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timeline-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.current-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-tertiary);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.25);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.current-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-tertiary);
}

/* ── Compact LinkedIn-style timeline ── */
.timeline-item--compact {
  margin-bottom: 0;
  padding: 0;
}

.timeline-item--compact .timeline-node {
  display: none;
}

@media (min-width: 640px) {
  .timeline-item--compact .timeline-node {
    display: block;
    position: absolute;
    left: -2.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
  }

  .timeline-node-active {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
  }
}

.timeline-row {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.timeline-item--compact:last-child .timeline-row {
  border-bottom: none;
}

.timeline-row-left {
  flex-shrink: 0;
  min-width: 7rem;
}

.timeline-year-range {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-row-right {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.timeline-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-org {
  font-size: 0.88rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.skeleton-line {
  height: 16px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--long  { width: 80%; }
.skeleton-line        { width: 60%; }

/* --------------------------------------------------------------------------
   9. SKILLS SECTION
   -------------------------------------------------------------------------- */
.skills { background: var(--bg-secondary); }

/* Two-column layout: bars on left, tag panel on right */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .skills-layout { grid-template-columns: 1fr 320px; }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-base);
}

.skill-category:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.skill-cat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.skill-cat-icon {
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.skill-cat-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.skill-item {
  margin-bottom: 1.1rem;
}

.skill-item:last-child { margin-bottom: 0; }

.skill-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.skill-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.skill-bar-track {
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skills tag panel (side column) */
.skills-tags-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

.skills-tags-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.skill-tag-group {
  margin-bottom: 1.25rem;
}

.skill-tag-group:last-child { margin-bottom: 0; }

.skill-tag-group-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.skill-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.skill-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  line-height: 1.5;
}

.tag--ai    { background: rgba(79, 142, 247, 0.12); color: var(--accent-primary);   border-color: rgba(79, 142, 247, 0.25); }
.tag--data  { background: rgba(124, 92, 191, 0.12); color: var(--accent-secondary); border-color: rgba(124, 92, 191, 0.25); }
.tag--cloud { background: rgba(0, 212, 170, 0.12);  color: var(--accent-tertiary);  border-color: rgba(0, 212, 170, 0.25); }
.tag--lang  { background: rgba(79, 142, 247, 0.08); color: var(--text-secondary);   border-color: var(--border-default); }
.tag--viz   { background: rgba(124, 92, 191, 0.08); color: var(--text-secondary);   border-color: var(--border-default); }
.tag--devops{ background: rgba(0, 212, 170, 0.08);  color: var(--text-secondary);   border-color: var(--border-default); }

[data-theme="light"] .tag--ai    { background: rgba(37, 99, 235, 0.08);  color: var(--accent-primary);   border-color: rgba(37, 99, 235, 0.2); }
[data-theme="light"] .tag--data  { background: rgba(124, 58, 237, 0.08); color: var(--accent-secondary); border-color: rgba(124, 58, 237, 0.2); }
[data-theme="light"] .tag--cloud { background: rgba(5, 150, 105, 0.08);  color: var(--accent-tertiary);  border-color: rgba(5, 150, 105, 0.2); }

/* --------------------------------------------------------------------------
   10. PROJECTS SECTION
   -------------------------------------------------------------------------- */
.projects { background: var(--bg-primary); }

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  /* 2-col keeps even number of cards flush; last card if odd spans full row */
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid .project-card:last-child:nth-child(2n+1) {
    grid-column: 1 / -1;
  }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.project-card:hover::before { opacity: 1; }

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-icon {
  font-size: 1.75rem;
}

.project-links {
  display: flex;
  gap: 0.5rem;
}

.project-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.project-link:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  opacity: 1;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.18);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.more-projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .more-projects-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   11. ENDURANCE / STRAVA SECTION
   -------------------------------------------------------------------------- */
.endurance { background: var(--bg-secondary); }

.strava-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.strava-status--connected {
  border-color: rgba(0,212,170,0.3);
  background: rgba(0,212,170,0.05);
  color: var(--accent-tertiary);
}

.strava-status--pending {
  border-color: rgba(252,76,2,0.3);
  background: rgba(252,76,2,0.05);
  color: var(--accent-strava);
}

.strava-status-icon { font-size: 1rem; }

.endurance-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: start;
}

@media (min-width: 860px) {
  .endurance-layout { grid-template-columns: 1fr 1fr; align-items: center; }

/* Right column fills height of photo */
.endurance-right { display: flex; flex-direction: column; gap: 1rem; }
}

.athlete-photo-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/10;
}

.athlete-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.athlete-photo-wrapper:hover .athlete-photo {
  transform: scale(1.03);
}

.athlete-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.strava-powered {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}

.endurance-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.run-stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.run-stat-card:hover {
  border-color: var(--accent-strava);
  box-shadow: 0 4px 20px rgba(252,76,2,0.12);
}

.run-stat-icon { font-size: 1.5rem; }

.run-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-strava);
  line-height: 1;
}

.run-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* PRs */
.pr-section { margin-bottom: 3rem; }

.pr-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.pr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .pr-grid { grid-template-columns: repeat(4, 1fr); }
}

.pr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  gap: 0.4rem;
  transition: all var(--transition-base);
}

.pr-card:hover {
  border-color: var(--accent-strava);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(252,76,2,0.12);
}

.pr-distance {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pr-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-strava);
  letter-spacing: -0.01em;
  line-height: 1;
}

.pr-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Recent Activities */
.recent-activities-title,
.training-week-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.activity-item:hover {
  border-color: var(--border-default);
  transform: translateX(4px);
}

.activity-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.activity-stat {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-strava);
  white-space: nowrap;
}

.activities-placeholder {
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

/* Weekly Heatmap */
.week-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

.heatmap-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.heatmap-day-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.heatmap-day-block {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.heatmap-day-block--active {
  background: var(--accent-strava);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(252,76,2,0.3);
}

.heatmap-day-km {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. CONTACT SECTION
   -------------------------------------------------------------------------- */
.contact { background: var(--bg-primary); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: repeat(4, 1fr); }
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  gap: 0.6rem;
  transition: all var(--transition-base);
}

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

.contact-card--email:hover   { border-color: rgba(79,142,247,0.4); }
.contact-card--linkedin:hover { border-color: rgba(10,102,194,0.4); }
.contact-card--instagram:hover { border-color: rgba(225,48,108,0.4); }
.contact-card--github:hover   { border-color: rgba(255,255,255,0.2); }

.contact-card-icon { font-size: 2.25rem; }
.contact-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.contact-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-link {
  font-size: 0.85rem;
  color: var(--accent-primary);
  word-break: break-all;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   13. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1fr auto auto; align-items: center; }
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-nav a:hover { color: var(--text-primary); opacity: 1; }

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.social-icon-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-base);
}

.social-icon-link:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.footer-strava-credit { margin-left: 0.25rem; }
.footer-strava-credit a { color: var(--accent-strava); }

/* --------------------------------------------------------------------------
   14. BACK TO TOP
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: 50;
  border: none;
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   15. SCROLL ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --------------------------------------------------------------------------
   16. PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .hero-particles, .back-to-top, .hero-scroll-cue { display: none; }
  .section { padding: 2rem 0; }
  body { background: white; color: black; }
}

/* --------------------------------------------------------------------------
   17. REDUCED MOTION
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   19. ENDURANCE STATIC STATE (no Strava yet)
   -------------------------------------------------------------------------- */
.endurance-philosophy {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  line-height: 1.65;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.endurance-milestones {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.milestone-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.milestone-card:hover {
  border-color: var(--accent-primary);
  transform: translateX(4px);
}

.milestone-icon { font-size: 1.25rem; flex-shrink: 0; }

.milestone-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.strava-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: #fc4c02;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  width: fit-content;
}

.strava-link-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* --------------------------------------------------------------------------
   20. VISITOR COUNTER (footer)
   -------------------------------------------------------------------------- */
.footer-visitor-line {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.visitor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

/* --------------------------------------------------------------------------
   Reduced-motion safety net
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   18. GITHUB STATS SECTION
   -------------------------------------------------------------------------- */
.github-stats { background: var(--bg-primary); }

/* Status banner */
.gh-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 2.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gh-status-icon { font-size: 1rem; }

/* ── Stat cards row ── */
.gh-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 480px) {
  .gh-stat-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .gh-stat-cards { grid-template-columns: repeat(5, 1fr); }
}

.gh-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  gap: 0.4rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.gh-stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.gh-stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.gh-stat-card:hover::after { opacity: 0.04; }

.gh-stat-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.gh-stat-number {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gh-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.3;
}

/* ── Viz row (donut + bars) ── */
.gh-viz-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: start;
}

@media (min-width: 760px) {
  .gh-viz-row { grid-template-columns: 340px 1fr; align-items: center; }
}

.gh-viz-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

/* Donut chart */
.gh-donut-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition-base);
}

.gh-donut-wrapper:hover { border-color: var(--border-default); }

.gh-donut-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

#gh-donut-canvas {
  display: block;
  max-width: 260px;
}

.gh-donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-align: center;
}

.gh-donut-center-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.gh-donut-center-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* Legend */
.gh-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gh-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.gh-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-legend-name { color: var(--text-secondary); font-weight: 500; }
.gh-legend-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.gh-legend-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 36px;
}

/* Language bar chart */
.gh-lang-bars-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition-base);
}

.gh-lang-bars-wrapper:hover { border-color: var(--border-default); }

.gh-lang-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gh-lang-bar-item {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  align-items: center;
  gap: 0.875rem;
}

@media (max-width: 400px) {
  .gh-lang-bar-item { grid-template-columns: 90px 1fr 36px; }
}

.gh-lang-bar-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gh-lang-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-lang-bar-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gh-lang-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gh-lang-bar-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.gh-lang-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  line-height: 1.5;
}

/* ── Commit activity sparkline ── */
.gh-activity-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition-base);
}

.gh-activity-wrapper:hover { border-color: var(--border-default); }

.gh-activity-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
}

.gh-activity-canvas {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}

.gh-activity-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0 4px;
}

.gh-activity-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ── Skills section ──────────────────────────────────────────────────────── */
.gh-skills-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition-base);
}
.gh-skills-wrapper:hover { border-color: var(--border-default); }

.gh-skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.skill-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.skill-group-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 7rem;
  padding-top: 0.2rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.skill-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.skill-tag--genai {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.25);
}
.skill-tag--lang {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}
.skill-tag--cloud {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}
.skill-tag--db {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}
