/* ============================================
   Carlo Grancini — Portfolio
   Minimalist & Professional Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Colors — Light */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --border-color: rgba(15, 23, 42, 0.06);
  --accent: #059669; /* Custom Emerald Green */
  --accent-soft: rgba(5, 150, 105, 0.06);
  --accent-gradient: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --accent-hover: #047857;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --transition-fast: 160ms var(--ease-out);
  --transition-base: 220ms var(--ease-out);
  --transition-smooth: 350ms cubic-bezier(0.32, 0.72, 0, 1);
  --nav-bg: rgba(248, 250, 252, 0.82);
}

/* --- Dark Mode --- */
body.dark-mode {
  --bg-primary: #040406; /* Technical Deep Obsidian Black */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #101016;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border-color: rgba(255, 255, 255, 0.05);
  --accent: #00f5a0; /* Razor-Sharp Emerald Mint */
  --accent-soft: rgba(0, 245, 160, 0.08);
  --accent-gradient: linear-gradient(135deg, #00f5a0 0%, #00d2ff 100%);
  --accent-hover: #5bfcb5;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 56px rgba(0,0,0,0.6);
  --nav-bg: rgba(4, 4, 6, 0.82);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 15.5px;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-image: radial-gradient(var(--border-color) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  opacity: 0.45;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 50% 30%, transparent 25%, var(--bg-primary) 80%);
  pointer-events: none;
  transition: background var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
}

::selection {
  background: var(--accent);
  color: #040406;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  width: calc(100% - 32px);
  max-width: 820px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--nav-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  transition: transform var(--transition-smooth), border-color var(--transition-base), box-shadow var(--transition-base);
}

.nav.visible {
  transform: translateX(-50%) translateY(0);
}

.nav-inner {
  max-width: 100%;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  .nav-logo:hover {
    color: var(--accent);
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  letter-spacing: 0.2px;
  position: relative;
  padding: 4px 0;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--text-primary);
  }
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 180ms var(--ease-out), left 180ms var(--ease-out);
  pointer-events: none;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover::after {
    width: 100%;
    left: 0;
  }
}

.nav-links a.nav-cv-link::after {
  display: none;
}

.nav-links a.nav-cv-link {
  color: var(--accent);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a.nav-cv-link:hover {
    background: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
  }
}

.nav-links a.nav-cv-link:active {
  transform: translateY(0) scale(0.97);
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
  padding: 0;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.05);
  }
}

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

.theme-toggle svg {
  transition: transform var(--transition-smooth);
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover svg {
    transform: rotate(15deg);
  }
}

.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
body.dark-mode .theme-toggle .sun-icon { display: none; }
body.dark-mode .theme-toggle .moon-icon { display: block; }

/* --- Main Content --- */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 40px;
  width: fit-content;
  animation: fadeInUp 450ms var(--ease-out) both;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
  animation: fadeInUp 450ms var(--ease-out) 60ms both;
}

.hero-line {
  display: block;
}

.hero-accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
  animation: fadeInUp 450ms var(--ease-out) 120ms both;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-bottom: 40px;
  animation: fadeInUp 450ms var(--ease-out) 180ms both;
}

.hero-location svg {
  flex-shrink: 0;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  animation: fadeInUp 450ms var(--ease-out) 240ms both;
}

.hero-link {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  background: var(--bg-secondary);
}

.hero-link::after {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .hero-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.hero-link:active {
  transform: translateY(0) scale(0.95);
}

.hero-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  border: 1px solid var(--text-primary);
}

@media (hover: hover) and (pointer: fine) {
  .hero-cv-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.hero-cv-btn:active {
  transform: translateY(0) scale(0.97);
}

.hero-cv-btn svg {
  flex-shrink: 0;
}

/* --- Sections --- */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border-color);
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.75px;
  margin-bottom: 32px;
  line-height: 1.2;
}

/* --- About --- */
.about-content p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-content p:last-child {
  margin-bottom: 0;
}

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

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.skill-category {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .skill-category:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
  }
}

.skill-category h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-category h3 svg {
  color: var(--accent);
  flex-shrink: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
  border: 1px solid var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
  .skill-tag:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-1px);
  }
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border-color));
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

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

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
  transform: rotate(45deg);
  transition: background-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out), transform 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .timeline-item:hover .timeline-marker {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    transform: rotate(45deg) scale(1.2);
  }
}

.timeline-content {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .timeline-item:hover .timeline-content {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
  }
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.timeline-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-org {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-content > p:last-child {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 0;
  line-height: 1.7;
}

/* --- Projects (Detailed Case Studies) --- */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.project-case-study {
  padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .project-case-study:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
  }
}

/* Background gradient accent line on top of each card */
.project-case-study::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0.8;
}

/* Glowing dot overlay in dark mode */
body.dark-mode .project-case-study::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.project-case-study * {
  position: relative;
  z-index: 1;
}

.project-case-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
}

.project-case-study h3 {
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-top: 4px;
}

.project-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Specs Block (Horizontal Grid) */
.project-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-base);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Two-column layout inside case studies */
.project-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .project-details-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .project-case-study {
    padding: 24px;
  }
}

.details-column h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.details-column h4 svg {
  color: var(--accent);
}

.details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  padding-left: 20px;
}

.details-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Highlighted Technical Trouble Box */
.troubleshoot-box {
  padding: 24px;
  background: rgba(99, 102, 241, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-top: 12px;
}

body.dark-mode .troubleshoot-box {
  background: rgba(99, 102, 241, 0.02);
  border-color: #06b6d4;
}

.troubleshoot-box h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.troubleshoot-box h5 svg {
  color: var(--accent);
}

body.dark-mode .troubleshoot-box h5 svg {
  color: #06b6d4;
}

.troubleshoot-box p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Status Indicator Pulse */
.pulse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.certs-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  margin-top: 32px;
  letter-spacing: -0.01em;
  opacity: 0.9;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

a.cert-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cert-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
  }
}

.cert-card:active {
  transform: translateY(0) scale(0.98);
}

.cert-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cert-card:hover .cert-badge {
    background: var(--accent);
    color: #fff;
  }
}

.cert-link-icon {
  margin-left: auto;
  color: var(--text-secondary);
  opacity: 0.3;
  transition: transform 160ms var(--ease-out), color 160ms var(--ease-out), opacity 160ms var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .cert-card:hover .cert-link-icon {
    color: var(--accent);
    opacity: 1;
    transform: translate(2px, -2px);
  }
}

.cert-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cert-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

/* --- Contact --- */
.section-contact {
  text-align: center;
}

.section-contact .section-label,
.section-contact h2 {
  text-align: center;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.contact-btn::after {
  display: none;
}

.contact-btn.primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
}

@media (hover: hover) and (pointer: fine) {
  .contact-btn.primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.contact-btn.primary:active {
  transform: translateY(0) scale(0.97);
}

.contact-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

@media (hover: hover) and (pointer: fine) {
  .contact-btn.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }
}

.contact-btn.secondary:active {
  transform: translateY(0) scale(0.97);
}

.contact-socials {
  display: flex;
  gap: 12px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 48px 24px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.footer p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

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

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Scroll-triggered reveal */
.section {
  opacity: 0;
  transform: translateY(16px) scale(0.995);
  transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out);
}

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

/* --- Link Reset (global) --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    opacity: 1;
  }
}

/* Remove underline animation from all links */
a::after {
  display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  main {
    padding: 0 20px;
  }

  .hero {
    min-height: auto;
    padding: 140px 0 60px;
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 52px);
    letter-spacing: -1.5px;
  }

  .nav-links {
    display: none;
  }

  .section {
    padding: 60px 0;
  }

  .section h2 {
    font-size: 26px;
  }

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

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .cert-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .contact-socials {
    flex-direction: column;
    width: 100%;
  }

  .contact-btn {
    width: 100%;
    justify-content: center;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 120px 0 40px;
  }

  .hero-badge {
    font-size: 12px;
    margin-bottom: 28px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .skill-category,
  .project-card,
  .timeline-content,
  .cert-card {
    padding: 20px;
  }
}