/* ============================================
   Colin Duhig Portfolio — Global Styles v2
   Full theme coverage, mobile-optimized
   ============================================ */

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #111827;
  --bg-input: #0f172a;
  --bg-hover: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --accent-glow-strong: rgba(59, 130, 246, 0.4);
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-glow-strong: rgba(37, 99, 235, 0.25);
  --border: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(148, 163, 184, 0.35);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

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

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

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

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p {
  color: var(--text-secondary);
}

.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 4rem 0;
  position: relative;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .nav {
  background: rgba(248, 250, 252, 0.88);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 1px;
}

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

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

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

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.theme-toggle svg {
  transition: transform 0.3s ease;
}

.theme-toggle:active svg {
  transform: rotate(30deg);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow-strong);
  color: white;
}

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

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

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  min-height: 36px;
}

/* ── Hero ── */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  padding: 0 1.25rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
  animation: fadeInDown 0.7s ease;
}

.hero-badge .pulse {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  margin-bottom: 0.75rem;
  animation: fadeInUp 0.7s ease 0.15s both;
}

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

.typewriter {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  min-height: 1.8rem;
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.typewriter .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease 0.45s both;
}

.hero-desc strong {
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.6s both;
}

.hero-scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-image {
  position: relative;
}

.about-image-frame {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.about-image-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--accent), transparent, var(--accent));
  border-radius: inherit;
  z-index: -1;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.about-image-frame:hover::before {
  opacity: 0.7;
}

.about-image-placeholder {
  font-size: 5rem;
  opacity: 0.25;
  user-select: none;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.about-stat {
  text-align: center;
  padding: 0.875rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease;
}

.about-stat:hover {
  border-color: var(--accent);
}

.about-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.about-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

.about-text h2 {
  margin-bottom: 0.875rem;
}

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

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

.about-terminal {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: 1px solid var(--border);
  overflow-x: auto;
  transition: border-color 0.3s ease;
}

.about-terminal:hover {
  border-color: var(--border-strong);
}

.about-terminal-header {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.about-terminal-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.about-terminal-header span:nth-child(1) { background: #ff5f56; }
.about-terminal-header span:nth-child(2) { background: #ffbd2e; }
.about-terminal-header span:nth-child(3) { background: #27c93f; }

.about-terminal pre {
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

.about-terminal .comment { color: var(--text-muted); }
.about-terminal .keyword { color: #ff7b72; }
.about-terminal .string { color: #a5d6ff; }
.about-terminal .func { color: #d2a8ff; }

[data-theme="light"] .about-terminal .keyword { color: #d73a49; }
[data-theme="light"] .about-terminal .string { color: #032f62; }
[data-theme="light"] .about-terminal .func { color: #6f42c1; }

/* ── Skills ── */
.skills-container {
  position: relative;
  min-height: 380px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 2rem;
}

.skill-orb {
  position: absolute;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.skill-orb:hover {
  transform: scale(1.12) !important;
  z-index: 10;
}

.skill-orb.languages { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }
.skill-orb.tools { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.25); }
.skill-orb.interests { background: rgba(168, 85, 247, 0.12); color: #c084fc; border-color: rgba(168, 85, 247, 0.25); }
.skill-orb.learning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.25); }

[data-theme="light"] .skill-orb.languages { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.2); }
[data-theme="light"] .skill-orb.tools { background: rgba(22, 163, 74, 0.1); color: #15803d; border-color: rgba(22, 163, 74, 0.2); }
[data-theme="light"] .skill-orb.interests { background: rgba(126, 34, 206, 0.1); color: #7e22ce; border-color: rgba(126, 34, 206, 0.2); }
[data-theme="light"] .skill-orb.learning { background: rgba(180, 83, 9, 0.1); color: #b45309; border-color: rgba(180, 83, 9, 0.2); }

.skill-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 20;
  box-shadow: var(--shadow-lg);
  max-width: 220px;
  line-height: 1.5;
}

.skill-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── GitHub Stats ── */
.gh-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.gh-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all var(--transition);
}

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

.gh-stat-icon {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  opacity: 0.85;
}

.gh-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.gh-stat-value.loading {
  animation: pulse-opacity 1.5s infinite;
}

.gh-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.gh-stat-fallback {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* Contribution Graph */
.gh-contrib {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.gh-contrib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gh-contrib-header h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.gh-contrib-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.gh-contrib-legend span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.gh-contrib-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.gh-contrib-graph {
  display: flex;
  gap: 3px;
  min-width: max-content;
}

.gh-contrib-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gh-contrib-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transition: transform 0.15s ease, outline 0.15s ease;
  position: relative;
  cursor: pointer;
}

.gh-contrib-cell:hover {
  transform: scale(1.4);
  z-index: 2;
  outline: 2px solid var(--text-muted);
  outline-offset: 1px;
}

.gh-contrib-cell::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  z-index: 10;
}

.gh-contrib-cell:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* GitHub-style colors */
.gh-level-0 { background: var(--bg-tertiary); }
.gh-level-1 { background: #0e4429; }
.gh-level-2 { background: #006d32; }
.gh-level-3 { background: #26a641; }
.gh-level-4 { background: #39d353; }

[data-theme="light"] .gh-level-0 { background: #ebedf0; }
[data-theme="light"] .gh-level-1 { background: #9be9a8; }
[data-theme="light"] .gh-level-2 { background: #40c463; }
[data-theme="light"] .gh-level-3 { background: #30a14e; }
[data-theme="light"] .gh-level-4 { background: #216e39; }

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-card);
}

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

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

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

.project-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card), var(--accent-glow));
}

.project-card.featured::after {
  content: 'FEATURED';
  position: absolute;
  top: 0.75rem;
  right: -2.25rem;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 2.25rem;
  transform: rotate(45deg);
  letter-spacing: 0.05em;
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.project-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.project-stars {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

.project-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 0.875rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.875rem;
}

.project-tag {
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

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

.project-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.project-actions a {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0;
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.contact-info h3 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.contact-info > p {
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.contact-method:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  color: inherit;
}

.contact-method-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.contact-method:hover .contact-method-icon {
  background: var(--accent-glow-strong);
}

.contact-method-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
  color: var(--text-primary);
}

.contact-method-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

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

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

/* Honeypot field - hidden from humans */
.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.captcha-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.1rem;
  position: relative;
}

.captcha-question {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: inline-block;
}

.captcha-question:hover {
  text-decoration: underline;
}

.captcha-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  -webkit-appearance: none;
}

.captcha-error {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  display: none;
}

.captcha-error.visible {
  display: block;
}

.rate-limit-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.rate-limit-warning.visible {
  display: block;
}

.form-status {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
  line-height: 1.5;
}

.form-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

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

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  background: var(--bg-secondary);
}

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

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

.footer-left a {
  color: var(--text-secondary);
}

.footer-right {
  display: flex;
  gap: 1.25rem;
}

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

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

/* ── 404 Page ── */
.error-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  font-family: var(--font-mono);
  color: #22c55e;
  padding: 1.25rem;
}

.error-terminal {
  max-width: 680px;
  width: 100%;
}

.error-terminal-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  opacity: 0.6;
}

.error-terminal-header span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.error-terminal-header span:nth-child(1) { background: #ff5f56; }
.error-terminal-header span:nth-child(2) { background: #ffbd2e; }
.error-terminal-header span:nth-child(3) { background: #27c93f; }

.error-terminal-body {
  font-size: 0.85rem;
  line-height: 1.75;
}

.error-terminal-body > div {
  margin-bottom: 0.15rem;
}

.error-terminal-body .prompt {
  color: #3b82f6;
}

.error-terminal-body .error-text {
  color: #ef4444;
}

.error-terminal-body .warn-text {
  color: #f59e0b;
}

.error-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #22c55e;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

.error-btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.6rem 1.1rem;
  background: transparent;
  border: 1px solid #22c55e;
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-height: 44px;
}

.error-btn:hover {
  background: #22c55e;
  color: #050505;
}

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

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

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Konami Overlay ── */
.konami-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 1.25rem;
}

.konami-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.konami-content {
  text-align: center;
  max-width: 460px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.konami-content h2 {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 0.875rem;
  animation: glitch 0.3s infinite;
}

.konami-content p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.konami-close {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.konami-close:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-1.5px, 1.5px); }
  40% { transform: translate(-1.5px, -1.5px); }
  60% { transform: translate(1.5px, 1.5px); }
  80% { transform: translate(1.5px, -1.5px); }
  100% { transform: translate(0); }
}

/* ── Projects Page Filter ── */
.projects-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}

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

.projects-search {
  width: 100%;
  max-width: 380px;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  -webkit-appearance: none;
}

.projects-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.project-card.hidden {
  display: none;
}

.projects-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.projects-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 0.5rem 0;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    padding: 0.875rem 1.25rem;
    width: 100%;
    display: block;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-links a.active {
    background: var(--accent-glow);
    color: var(--accent);
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

  .about-image-frame {
    max-width: 200px;
  }

  .about-stats {
    max-width: 320px;
    margin: 1.25rem auto 0;
  }

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

  .gh-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .skills-container {
    min-height: 320px;
    padding: 1.25rem;
  }

  .skill-orb {
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
  }

  section {
    padding: 3rem 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .contact-form {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .container {
    padding: 0 1rem;
  }

  .gh-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
  }

  .gh-stat-card {
    padding: 1rem 0.5rem;
  }

  .gh-stat-value {
    font-size: 1.4rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .project-card {
    padding: 1rem;
  }

  .hero {
    padding-top: 60px;
    min-height: 100svh;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
  }

  .konami-content {
    padding: 1.5rem 1.25rem;
  }

  .konami-content h2 {
    font-size: 1.4rem;
  }
}

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

  .about-stats {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  #particle-canvas {
    display: none;
  }
}

/* ── Touch Device Optimizations ── */
@media (hover: none) {
  .project-card:hover {
    transform: none;
  }

  .gh-stat-card:hover {
    transform: none;
  }

  .contact-method:hover {
    transform: none;
  }

  .skill-orb:hover {
    transform: scale(1.05) !important;
  }
}
