/* ========================================
   KAZE IGOR Portfolio — Design System
   Based on detailed animation specification
   ======================================== */

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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #141414;
  --surface: #1a1a1a;
  --border: #222222;
  --border-subtle: #1a1a1a;
  --text: #e8e4df;
  --text-muted: #8a8580;
  --text-dim: #555550;
  --accent: #c8a882;
  --accent-dim: #9a7d5e;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --bg: #d8d2c8;
  --bg-elevated: #e2dcd3;
  --bg-card: #e2dcd3;
  --surface: #ccc6bb;
  --border: #b8b1a5;
  --border-subtle: #c4bdae;
  --text: #2a2520;
  --text-muted: #5a554f;
  --text-dim: #8a847e;
  --accent: #7a6040;
  --accent-dim: #a08060;
}

[data-theme="light"] .hero-canvas { opacity: 0.4; }
[data-theme="light"] .hero-grid { opacity: 0.3; }
[data-theme="light"] body::after { opacity: 0.02; filter: invert(1); }

html { scroll-behavior: smooth; }

/* Noise overlay — light mode uses lighter noise */
[data-theme="light"] body::after {
  opacity: 0.025;
  filter: invert(1);
}

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

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-canvas { display: none; }
  .scroll-line { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
  .project-decon { display: none; }
  .lab-sketch { display: none; }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes drawBorderRight { from { width: 0; } to { width: 100%; } }
@keyframes drawBorderDown { from { height: 0; } to { height: 100%; } }
@keyframes revealImage { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.fade-in { animation: fadeIn 0.8s ease-out both; }
.fade-in-up { animation: fadeInUp 0.7s ease-out both; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.35s; }
.d4 { animation-delay: 0.5s; }
.d5 { animation-delay: 0.65s; }
.d6 { animation-delay: 0.8s; }

[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ========================================
   Container
   ======================================== */
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 48px; } }
.container-narrow { max-width: 900px; }

/* ========================================
   Nav
   ======================================== */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slideDown 0.5s ease-out both;
}
.nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
@media (min-width: 768px) { .nav-inner { padding: 0 48px; } }
.nav-brand { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--text-muted); transition: color 0.3s; }
.nav-brand:hover { color: var(--accent); }
.nav-links { display: none; gap: 40px; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-link { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; color: var(--text-muted); transition: color 0.3s; position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--accent); transition: width 0.3s ease; }
.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: var(--text); }
.nav-num { color: var(--text-dim); transition: color 0.3s; }
.nav-link:hover .nav-num { color: var(--accent); }
.nav-contact { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; color: var(--text-muted); border: 1px solid var(--border); padding: 8px 16px; transition: all 0.3s; }
.nav-contact:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ========================================
   Scroll Progress
   ======================================== */
.scroll-progress {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  z-index: 50; display: none; flex-direction: column; align-items: center; gap: 12px;
}
@media (min-width: 1024px) { .scroll-progress { display: flex; } }
.scroll-progress-track { width: 1px; height: 200px; background: var(--border); position: relative; }
.scroll-progress-fill { position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: var(--accent); transition: height 0.15s ease; }
.scroll-progress-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--text-dim); writing-mode: vertical-rl; text-orientation: mixed;
  transform: rotate(180deg); white-space: nowrap;
  transition: opacity 0.3s;
}

/* ========================================
   Hero
   ======================================== */
.hero {
  position: relative; min-height: 100vh; display: flex;
  overflow: hidden; padding-top: 64px;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; transition: opacity 1s ease; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px), linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px; opacity: 0.15;
}
.hero-content {
  position: relative; z-index: 10; max-width: 1400px; width: 100%;
  padding: 60px 24px 100px;
  display: flex; flex-direction: column; justify-content: center;
  margin: 0 auto;
}
@media (min-width: 768px) { .hero-content { padding: 80px 48px 120px; } }
.hero-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.archive-index {
  display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 48px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.35em; color: var(--text-dim);
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.35em; color: var(--text-muted); border: 1px solid var(--border); padding: 4px 12px; }
.hero-title { font-family: var(--font-serif); font-size: clamp(48px, 10vw, 128px); font-weight: 600; line-height: 0.9; letter-spacing: -0.02em; color: var(--text); margin-bottom: 24px; }
.hero-statement { margin-bottom: 32px; }
.hero-subtitle { font-size: clamp(18px, 2.5vw, 28px); font-weight: 300; color: var(--text-muted); max-width: 640px; margin-bottom: 12px; }
.hero-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.25em; color: var(--text-dim); text-transform: uppercase; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 80px; }
.hero-index { margin-top: auto; }
.index-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.index-divider .line { flex: 1; height: 1px; background: var(--border); }
.index-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4em; color: var(--text-dim); }
.index-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (min-width: 768px) { .index-grid { grid-template-columns: repeat(4, 1fr); } }
.index-item { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; transition: all 0.3s; }
.index-item:hover { border-color: var(--accent); }
.index-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); transition: color 0.3s; }
.index-item:hover .index-num { color: var(--accent); }
.index-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--text-muted); }
.index-desc { font-size: 12px; color: var(--text-dim); }
.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4em; color: var(--text-dim);
  z-index: 10;
}
.scroll-line { width: 1px; height: 32px; background: var(--border); animation: scrollLine 2s ease-in-out infinite; }

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  padding: 12px 24px; transition: all 0.25s cubic-bezier(0.16,1,0.3,1); cursor: pointer; border: none;
}
.btn:active { transform: translateY(1px); }
.btn span { transition: transform 0.3s; }
.btn:hover span { transform: translateX(3px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 16px 32px; }

/* ========================================
   Sections
   ======================================== */
.section { padding: 96px 0; }
@media (min-width: 768px) { .section { padding: 128px 0; } }
.section-header { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 48px; }
@media (min-width: 768px) { .section-header { margin-bottom: 64px; } }
.section-num { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); letter-spacing: 0.1em; padding-top: 4px; }
.section-title-group { flex: 1; }
.section-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.section-title { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 44px); font-weight: 500; color: var(--text); letter-spacing: -0.01em; }
.section-line { flex: 1; height: 1px; background: var(--border); display: none; }
@media (min-width: 768px) { .section-line { display: block; } }
.section-subtitle { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.35em; color: var(--text-dim); text-transform: uppercase; }
.section-cta { display: flex; justify-content: center; margin-top: 48px; }

.divider { height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); }
.knowledge-thread { position: relative; }
.knowledge-thread::before {
  content: ''; position: absolute; left: 50%; top: -4px;
  width: 1px; height: 8px; background: var(--accent); opacity: 0.3;
  transform: translateX(-50%);
}

/* ========================================
   Project Cards — Deconstruction
   ======================================== */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; } }
.project-card {
  display: block; border: 1px solid var(--border); background: var(--bg-card);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden;
}
.project-card:hover { transform: translateY(-4px); border-color: #333; }
.project-image {
  position: relative; aspect-ratio: 16/10; background: var(--surface);
  overflow: hidden;
}
.project-image-inner {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.project-card:hover .project-image-inner { transform: translate(4px, -4px); }
.project-diagram { width: 75%; height: 75%; }

/* Deconstruction overlay */
.project-decon {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.4s ease 0.1s;
}
.project-card:hover .project-decon { opacity: 1; }
.decon-label {
  position: absolute; font-family: var(--font-mono); font-size: 8px;
  letter-spacing: 0.25em; color: var(--accent); opacity: 0;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.project-card:hover .decon-label { opacity: 0.7; }
.decon-label-1 { top: 15%; left: 5%; transition-delay: 0.12s; }
.decon-label-2 { top: 15%; right: 5%; transition-delay: 0.18s; }
.decon-label-3 { bottom: 30%; left: 5%; transition-delay: 0.24s; }
.decon-label-4 { bottom: 30%; right: 5%; transition-delay: 0.30s; }
.decon-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.decon-line {
  stroke-dasharray: 200; stroke-dashoffset: 200;
  transition: stroke-dashoffset 0.5s ease 0.15s;
}
.project-card:hover .decon-line { stroke-dashoffset: 0; }
.decon-flow {
  position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.3em;
  color: var(--text-dim); opacity: 0; transition: opacity 0.3s ease 0.35s;
  white-space: nowrap;
}
.project-card:hover .decon-flow { opacity: 0.5; }

.project-status {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.25em;
  color: var(--text-dim); background: rgba(10,10,10,0.8); backdrop-filter: blur(8px);
  padding: 4px 12px; border: 1px solid var(--border); z-index: 2;
}
.status-building { color: var(--accent); border-color: var(--accent-dim); }
.project-number-big {
  position: absolute; bottom: 16px; left: 16px;
  font-family: var(--font-mono); font-size: 56px; font-weight: 700;
  color: var(--border); opacity: 0.5; line-height: 1; z-index: 2;
  transition: all 0.3s;
}
.project-card:hover .project-number-big { color: var(--accent); opacity: 0.3; }
.project-info { padding: 24px; }
.project-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.project-name { font-family: var(--font-serif); font-size: clamp(18px, 2.5vw, 24px); font-weight: 500; color: var(--text); letter-spacing: -0.01em; transition: color 0.3s; }
.project-card:hover .project-name { color: var(--accent); }
.project-year { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.project-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.project-tech span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--text-dim); border: 1px solid var(--border-subtle); padding: 3px 8px;
  transition: all 0.2s; cursor: default; position: relative;
}
.project-tech span:hover { border-color: var(--accent); color: var(--accent); }
.project-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; color: var(--text-muted); transition: color 0.3s; }
.project-link span { transition: transform 0.3s; display: inline-block; }
.project-card:hover .project-link { color: var(--accent); }
.project-card:hover .project-link span { transform: translateX(3px); }
.project-bottom-row { display: flex; align-items: center; justify-content: space-between; }
.project-bottom-row .github-icon { opacity: 0; transition: opacity 0.3s; }
.project-card:hover .project-bottom-row .github-icon { opacity: 1; }

/* ========================================
   Build Grid
   ======================================== */
.build-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 768px) { .build-grid { grid-template-columns: repeat(2, 1fr); } }
.build-item { border-top: 1px solid var(--border); padding-top: 24px; transition: border-color 0.3s; }
.build-item:hover { border-color: var(--accent); }
.build-num { font-family: var(--font-mono); font-size: 32px; color: var(--border); transition: color 0.3s; }
.build-item:hover .build-num { color: var(--accent); }
.build-name { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.2em; color: var(--text); margin-top: 8px; margin-bottom: 8px; }
.build-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ========================================
   Lab Cards — Notebook → System
   ======================================== */
.lab-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .lab-grid { grid-template-columns: repeat(3, 1fr); } }
.lab-card {
  border: 1px solid var(--border-subtle); background: var(--bg-card);
  padding: 24px; transition: all 0.3s; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.lab-card:hover { border-color: var(--border); transform: translateY(-4px); }
.lab-sketch {
  margin: -24px -24px 0; padding: 12px; background: rgba(20,20,20,0.5);
  border-bottom: 1px solid var(--border-subtle);
  transition: opacity 0.5s ease;
}
.lab-sketch svg { width: 100%; height: auto; }
.lab-card:hover .lab-sketch { opacity: 0.5; }
.lab-top { display: flex; justify-content: space-between; align-items: center; }
.lab-id { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--text-dim); }
.lab-cat { font-family: var(--font-mono); font-size: 10px; color: var(--accent); opacity: 0; transition: opacity 0.3s; }
.lab-card:hover .lab-cat { opacity: 1; }
.lab-title { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--text); transition: color 0.3s; }
.lab-card:hover .lab-title { color: var(--accent); }
.lab-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.lab-result { border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.lab-result-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.3em; color: var(--text-dim); display: block; margin-bottom: 4px; }
.lab-result-text { font-size: 13px; color: var(--accent); }
.lab-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.lab-tech span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--text-dim); border: 1px solid var(--border-subtle); padding: 3px 8px; }
.lab-read-report {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em;
  color: var(--text-muted); opacity: 0; transition: all 0.3s;
  margin-top: 8px;
}
.lab-read-report span { display: inline-block; transition: transform 0.3s; }
.lab-card:hover .lab-read-report { opacity: 1; color: var(--accent); }
.lab-card:hover .lab-read-report span { transform: translateX(3px); }

/* GitHub Icon */
.github-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border);
  color: var(--text-dim); transition: all 0.3s;
}
.github-icon:hover { color: var(--accent); border-color: var(--accent); }
.github-icon svg { width: 16px; height: 16px; fill: currentColor; }

/* ========================================
   Current
   ======================================== */
.current-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 768px) { .current-grid { grid-template-columns: repeat(3, 1fr); } }
.current-item { position: relative; padding-top: 24px; }
.current-accent { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent); }
.current-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4em; color: var(--text-dim); display: block; margin-bottom: 12px; }
.current-title { font-size: 18px; color: var(--text); margin-bottom: 4px; }
.current-desc { font-size: 14px; color: var(--text-dim); }

/* ========================================
   About
   ======================================== */
.about-content { max-width: 800px; }
.about-quote { font-family: var(--font-serif); font-size: clamp(24px, 3vw, 36px); font-weight: 400; color: var(--text); line-height: 1.4; border-left: 2px solid var(--accent); padding-left: 32px; margin-bottom: 48px; }
.about-statement { margin-bottom: 64px; }
.about-statement p { color: var(--text-muted); line-height: 1.8; margin-bottom: 12px; }
.about-statement em { color: var(--accent); font-style: normal; }

/* Timeline */
.timeline { position: relative; margin-bottom: 64px; padding-left: 80px; }
.timeline::before { content: ''; position: absolute; left: 79px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.timeline-year { margin-bottom: 40px; }
.timeline-marker { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.timeline-label { position: absolute; left: -80px; font-family: var(--font-serif); font-size: 24px; color: var(--text); width: 60px; text-align: right; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); position: relative; z-index: 1; }
.timeline-items { padding-left: 26px; display: flex; flex-direction: column; gap: 12px; }
.timeline-item { position: relative; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); margin-top: 7px; }
.timeline-item-name { display: block; font-size: 14px; font-weight: 500; color: var(--text); transition: color 0.3s; }
.timeline-item:hover .timeline-item-name { color: var(--accent); }
.timeline-item-desc { font-size: 12px; color: var(--text-dim); }

/* Skills */
.skills-grid { display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 768px) { .skills-grid { flex-direction: row; gap: 48px; } }
.skill-group { flex: 1; border-top: 1px solid var(--border); padding-top: 24px; }
.skill-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.skill-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.3em; }
.skill-cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--text-muted); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tags span { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-subtle); padding: 6px 12px; transition: all 0.3s; cursor: default; }
.skill-tags span:hover { border-color: var(--accent); color: var(--accent); }

/* ========================================
   Contact
   ======================================== */
.contact-header { text-align: center; padding: 32px 0; }
.contact-num { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4em; color: var(--text-dim); }
.contact-title { font-family: var(--font-serif); font-size: clamp(32px, 5vw, 56px); font-weight: 500; color: var(--text); margin-top: 16px; margin-bottom: 20px; }
.contact-desc { font-size: 16px; color: var(--text-muted); max-width: 480px; margin: 0 auto 40px; }

/* ========================================
   Contact Modal
   ======================================== */
.contact-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
.contact-modal-overlay.open { display: flex; }
.contact-modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 40px; max-width: 480px; width: 100%; position: relative;
  animation: fadeInUp 0.3s ease-out;
}
.contact-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-dim); font-size: 24px;
  cursor: pointer; transition: color 0.2s; line-height: 1;
}
.contact-modal-close:hover { color: var(--text); }
.contact-modal-title { font-family: var(--font-serif); font-size: 24px; color: var(--text); margin-bottom: 8px; }
.contact-modal-subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 28px; }
.contact-form-group { margin-bottom: 18px; }
.contact-form-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--text-dim); display: block; margin-bottom: 6px; }
.contact-form-input, .contact-form-textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  padding: 10px 14px; font-size: 14px; color: var(--text); font-family: var(--font-sans);
  transition: border-color 0.2s; outline: none;
}
.contact-form-input:focus, .contact-form-textarea:focus { border-color: var(--accent); }
.contact-form-textarea { resize: vertical; min-height: 100px; }
.contact-form-success { display: none; font-family: var(--font-mono); font-size: 12px; color: #5dc86d; margin-top: 16px; text-align: center; letter-spacing: 0.1em; }

/* ========================================
   Footer
   ======================================== */
.footer { border-top: 1px solid var(--border); padding: 64px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 48px; margin-bottom: 48px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--text-muted); display: block; margin-bottom: 16px; }
.footer-text { font-size: 13px; color: var(--text-dim); max-width: 360px; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-heading { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4em; color: var(--text-dim); margin-bottom: 4px; }
.footer-col a { font-size: 13px; color: var(--text-muted); transition: color 0.3s; position: relative; display: flex; align-items: center; gap: 8px; width: fit-content; }
.footer-col a:not(.social-link)::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 0; height: 1px; background: var(--accent); transition: width 0.3s ease; }
.footer-col a:not(.social-link):hover::after { width: 100%; }
.footer-bottom { border-top: 1px solid var(--border-subtle); padding-top: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-bottom span { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); letter-spacing: 0.1em; }

/* Social Links */
.social-link { display: flex; align-items: center; gap: 8px; }
.social-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.social-github { color: var(--text-muted); }
.social-github:hover { color: #c8a882; }
[data-theme="light"] .social-github:hover { color: #8a6d4e; }
.social-linkedin { color: var(--text-muted); }
.social-linkedin:hover { color: #0077B5; }
.social-email { color: var(--text-muted); }
.social-email:hover { color: var(--accent); }

/* Noise overlay */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.018;
  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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
