/* ============================================
   naff.site — Shared Styles
   Hybrid dark + color accent design system
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111114;
  --bg-tertiary: #1a1a20;
  --border: #2a2a35;
  --border-hover: #3a3a4a;

  --text-primary: #e8e8ed;
  --text-secondary: #9898a8;
  --text-muted: #5a5a6e;

  --accent-cyan: #06b6d4;
  --accent-cyan-dim: rgba(6, 182, 212, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);
  --accent-green: #10b981;
  --accent-violet: #8b5cf6;

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

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --max-width: 1120px;
}

/* Light mode overrides */
body.light {
  --bg-primary: #f8f6f1;
  --bg-secondary: #f0ede6;
  --bg-tertiary: #e8e4db;
  --border: #d8d2c4;
  --border-hover: #c0b8a4;

  --text-primary: #1a1a20;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8e;

  --accent-cyan: #0891b2;
  --accent-cyan-dim: rgba(8, 145, 178, 0.1);
  --accent-amber: #d97706;
  --accent-amber-dim: rgba(217, 119, 6, 0.1);
  --accent-green: #059669;
  --accent-violet: #7c3aed;
}

*, *::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-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent-cyan);
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.4s;
}

body.light .nav {
  background: rgba(248, 246, 241, 0.85);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

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

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

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

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

.nav-cta {
  font-size: 0.8rem !important;
  padding: 8px 18px;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan) !important;
  transition: background 0.2s, color 0.2s !important;
}

.nav-cta:hover {
  background: var(--accent-cyan-dim);
}

/* Dark mode toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 12px;
  transition: border-color 0.2s, transform 0.2s;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--accent-cyan);
  transform: rotate(15deg);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
  overflow: hidden;
}

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

.hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(6,182,212,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(245,158,11,0.04) 0%, transparent 70%);
  border-radius: 50%;
}

/* 3D canvas */
#hero-3d-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Particle canvas */
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 100%;
}

/* Ensure hero text doesn't clip */
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.hero h1 .line {
  display: block;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

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

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero h1 .line {
  display: block;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Typing animation */
.typing-container {
  display: inline-block;
  position: relative;
}

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

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

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: #0891b2;
  transform: translateY(-1px);
}

body.light .btn-primary:hover {
  background: #0e7490;
}

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

.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--bg-tertiary);
}

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

.btn-resume:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* ---------- GitHub Stats ---------- */
.github-stats {
  display: flex;
  gap: 24px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.github-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

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

.github-stat-icon {
  font-size: 1.25rem;
}

.github-stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.github-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Tech Stack Grid ---------- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 48px;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  cursor: default;
}

.tech-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.tech-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

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

/* Tech tooltip */
.tech-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}

.tech-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.tech-item:hover .tech-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.card {
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
}

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

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

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

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- Expandable Project Cards ---------- */
.project-card {
  cursor: default;
}

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

.project-card .project-icon {
  font-size: 2rem;
}

.project-card .project-links {
  display: flex;
  gap: 8px;
}

.project-card .project-links a {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.project-card .project-links a:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.project-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 100px;
  color: var(--text-muted);
}

.project-case-study {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
}

.project-case-study.open {
  max-height: 500px;
  margin-top: 20px;
}

.project-case-study-inner {
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.project-case-study h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-case-study p {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.project-case-study .result-highlight {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-green);
  color: var(--bg-primary);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

.case-study-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.case-study-toggle:hover {
  background: rgba(6, 182, 212, 0.2);
}

.case-study-toggle svg {
  transition: transform 0.3s;
}

.case-study-toggle.open svg {
  transform: rotate(180deg);
}

/* ---------- Timeline / About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 48px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---------- Testimonials ---------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.testimonial-card {
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s, transform 0.25s;
  position: relative;
}

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

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 4rem;
  color: var(--accent-cyan);
  opacity: 0.15;
  line-height: 1;
  font-family: Georgia, serif;
}

.testimonial-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.testimonial-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Blog / Journal ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.blog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}

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

.blog-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent-cyan-dim), var(--accent-amber-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.blog-card-body {
  padding: 24px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.blog-card-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.blog-card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.blog-card-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 12px;
  font-weight: 500;
  transition: gap 0.2s;
}

.blog-card-read:hover {
  gap: 8px;
}

/* ---------- Now Section ---------- */
.now-card {
  padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 48px;
  position: relative;
  overflow: hidden;
}

.now-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-amber), var(--accent-violet));
}

.now-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.now-item:last-child {
  border-bottom: none;
}

.now-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.now-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.now-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.now-timestamp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: right;
}

/* ---------- Visitor Counter ---------- */
.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visitor-counter .count {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
}

.contact-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.contact-link:hover {
  border-color: var(--border-hover);
}

.contact-link .icon {
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.contact-link .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-link .value {
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-cyan);
}

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

/* ---------- Footer ---------- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  flex-wrap: wrap;
  gap: 16px;
}

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

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ---------- Command Palette ---------- */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.cmd-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cmd-palette {
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.2s;
}

.cmd-palette-overlay.open .cmd-palette {
  transform: translateY(0) scale(1);
}

.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.cmd-palette-input-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cmd-palette-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.cmd-palette-input::placeholder {
  color: var(--text-muted);
}

.cmd-palette-results {
  max-height: 300px;
  overflow-y: auto;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.cmd-palette-item:hover,
.cmd-palette-item.selected {
  background: var(--bg-tertiary);
}

.cmd-palette-item-icon {
  font-size: 1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.cmd-palette-item-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.cmd-palette-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.cmd-palette-hint {
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
}

.cmd-palette-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .section {
    padding: 64px 0;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .card-grid,
  .testimonials-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-links li:not(:last-child) {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .github-stats {
    flex-direction: column;
  }

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

/* ---------- Blog Modal ---------- */
.blog-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.blog-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.blog-modal {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
}

.blog-modal-overlay.open .blog-modal {
  transform: translateY(0) scale(1);
}

.blog-modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.blog-modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}

.blog-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.blog-modal-close:hover {
  background: var(--border);
}

.blog-modal-body {
  padding: 20px 28px 28px;
}

.blog-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.blog-modal-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.blog-modal-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-modal-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.blog-modal-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Resume Page ---------- */
.resume-section {
  padding-top: 120px;
  padding-bottom: 60px;
}

.resume-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.resume-header {
  text-align: center;
  margin-bottom: 40px;
}

.resume-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.resume-header .subtitle {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.resume-header .contact-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.resume-divider {
  border: none;
  border-top: 2px solid var(--accent-cyan);
  margin: 24px 0;
}

.resume-block {
  margin-bottom: 32px;
}

.resume-block h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.resume-block p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.resume-item {
  margin-bottom: 20px;
}

.resume-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.resume-item .date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.resume-item ul {
  list-style: none;
  padding: 0;
}

.resume-item ul li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.resume-item ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

.resume-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.resume-skill-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.resume-skill-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.resume-download-bar {
  text-align: center;
  margin-bottom: 32px;
}

@media print {
  .nav, .theme-toggle, .footer, .resume-download-bar, .noise::after {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .resume-container {
    max-width: 100%;
  }
}

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

/* ---------- Noise texture overlay ---------- */
.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}
