/* ===========================================
   Liam Petersen Portfolio | AI Dark + Minimal
   =========================================== */

:root {
  --bg-primary: #0c0c14;
  --bg-card: #12121c;
  --bg-card-hover: #181825;
  --bg-tag: #1a1a2a;
  --text-primary: #f0f0f5;
  --text-secondary: #9898b0;
  --text-muted: #5a5a75;
  --accent: #2563eb;
  --accent-glow: #3b82f6;
  --accent-dim: rgba(37, 99, 235, 0.12);
  --accent-glow-strong: rgba(37, 99, 235, 0.25);
  --border: #1e1e30;
  --border-hover: #2a2a42;
  --shipped: #22c55e;
  --template: #3b82f6;
  --production: #22c55e;
  --local: #a855f7;
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Neural Network Canvas */
#neural-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--accent);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-dim);
  transition: box-shadow 0.3s;
}

.nav-logo:hover {
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav-cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--accent);
  padding: 8px 20px;
  border-radius: 8px;
  transition: background 0.2s, box-shadow 0.3s;
}

.nav-cta:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== HERO ===== */
.hero {
  padding: 160px 0 80px;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 700px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 600px;
  min-height: 3.4em;
}

/* Typing cursor */
.hero-tagline::after {
  content: '|';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

.hero-tagline.done::after {
  display: none;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.3s, background 0.2s, box-shadow 0.3s;
}

.hero-link:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-dim);
}

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

/* ===== STATS ===== */
.stats {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

/* ===== PROJECTS ===== */
.projects {
  padding: 100px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* Project Card */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

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

.project-card.expanded {
  box-shadow: 0 0 40px var(--accent-dim);
  border-color: rgba(37, 99, 235, 0.25);
}

.project-header {
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
}

.project-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.project-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-shipped {
  background: rgba(34, 197, 94, 0.12);
  color: var(--shipped);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.badge-template {
  background: rgba(59, 130, 246, 0.12);
  color: var(--template);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}

.badge-production {
  background: rgba(34, 197, 94, 0.12);
  color: var(--production);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.badge-local {
  background: rgba(168, 85, 247, 0.12);
  color: var(--local);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.1);
}

.badge-year {
  background: var(--bg-tag);
  color: var(--text-muted);
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.project-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.project-client {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.project-toggle {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.3s, color 0.3s;
  margin-top: 8px;
}

.project-card.expanded .project-toggle {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Project Preview (always visible) */
.project-preview {
  padding: 0 32px 24px;
}

.project-metrics {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

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

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-glow);
}

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

/* Project Detail (expandable) */
.project-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.project-card.expanded .project-detail {
  max-height: 2000px;
}

.project-description {
  padding: 0 32px 24px;
  display: grid;
  gap: 20px;
}

.feature-block h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.feature-block p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Tech Tags */
.project-tech {
  padding: 0 32px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 5px 12px;
  background: var(--bg-tag);
  color: var(--text-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.tech-tag:hover {
  border-color: var(--accent);
  color: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-dim);
}

/* Project Links */
.project-links {
  padding: 0 32px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.project-link-primary {
  background: var(--accent);
  color: var(--text-primary);
}

.project-link-primary:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.project-link-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  margin-bottom: 20px;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 16px rgba(34, 197, 94, 0.6); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== CV DOWNLOAD BUTTON ===== */
.hero-link-cv {
  border-color: var(--accent) !important;
  color: var(--text-primary) !important;
  background: var(--accent-dim);
}

.hero-link-cv:hover {
  background: var(--accent) !important;
  box-shadow: 0 0 24px var(--accent-glow-strong) !important;
}

/* ===== RESULTS ===== */
.results {
  padding: 80px 0;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.result-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 32px var(--accent-dim);
}

.result-before-after {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.result-before {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(90, 90, 117, 0.5);
}

.result-arrow {
  color: var(--accent-glow);
  flex-shrink: 0;
}

.result-after {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-value-hero {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.result-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.result-multiplier {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-glow);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.result-label {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.result-context {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== TECH STACK ===== */
.stack {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stack-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s;
}

.stack-group:hover {
  border-color: var(--border-hover);
}

.stack-group-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

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

.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 5px 12px;
  background: var(--bg-tag);
  color: var(--text-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.stack-tag:hover {
  border-color: var(--accent);
  color: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-dim);
}

/* ===== CAREER TIMELINE ===== */
.timeline {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.timeline-track {
  position: relative;
  padding-left: 40px;
  max-width: 700px;
}

.timeline-line {
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-step {
  position: relative;
  padding-bottom: 48px;
}

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

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.timeline-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.timeline-dot-active {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-dim);
}

.timeline-dot-active::after {
  background: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-glow-strong);
}

.timeline-step:hover .timeline-dot {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-dim);
}

.timeline-step:hover .timeline-dot::after {
  background: var(--accent-glow);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 6px 0 8px;
  letter-spacing: -0.01em;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== ABOUT ===== */
.about {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 700px;
}

.about-content {
  max-width: 700px;
}

.about-photo {
  width: 100%;
  max-width: 500px;
}

.about-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 0 40px var(--accent-dim);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.about-img:hover {
  box-shadow: 0 0 60px var(--accent-glow-strong);
  border-color: var(--accent);
}

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

.about-text:last-of-type {
  margin-bottom: 40px;
}

.about-certs-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

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

.cert {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.cert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-dim);
}

/* ===== FOOTER ===== */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.footer-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.footer-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.3s, background 0.2s, box-shadow 0.3s;
}

.footer-link:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-dim);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

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

  .hero-name {
    font-size: 2.25rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .hero-links {
    flex-direction: column;
  }

  .stats-grid {
    flex-direction: column;
    gap: 24px;
  }

  .stat-divider {
    width: 48px;
    height: 1px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .results {
    padding: 60px 0;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .result-card {
    padding: 24px;
  }

  .stack {
    padding: 60px 0;
  }

  .stack-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .timeline {
    padding: 60px 0;
  }

  .projects {
    padding: 60px 0;
  }

  .project-header {
    padding: 24px;
  }

  .project-preview {
    padding: 0 24px 20px;
  }

  .project-metrics {
    gap: 16px;
  }

  .project-description {
    padding: 0 24px 20px;
  }

  .project-tech {
    padding: 0 24px 20px;
  }

  .project-links {
    padding: 0 24px 24px;
    flex-direction: column;
    align-items: flex-start;
  }

  .project-title {
    font-size: 1.25rem;
  }

  .about-photo {
    max-width: 100%;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .project-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
