@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:         #080c10;
  --bg-alt:     #0d1117;
  --surface:    #111820;
  --surface2:   #161e28;
  --border:     #1e2d3d;
  --border-glow:#00d4ff33;
  --text:       #cdd9e5;
  --text-muted: #637689;
  --text-dim:   #3d5168;
  --primary:    #00d4ff;
  --primary-dim:#00d4ff22;
  --accent:     #ff6b35;
  --green:      #39d353;
  --yellow:     #f0c844;
  --font-head:  'Syne', sans-serif;
  --font-mono:  'Space Mono', monospace;
  --radius:     8px;
  --radius-lg:  16px;
  --shadow:     0 8px 32px rgba(0,0,0,0.5);
  --glow:       0 0 20px rgba(0,212,255,0.2);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }

/* ── Noise overlay ── */
body::before {
  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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── Grid lines bg ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.section { padding: 100px 0; }
.bg-alt { background: var(--bg-alt); }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 1000;
  background: rgba(8,12,16,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-wrapper {
  height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-bracket { color: var(--text-dim); }
.logo-name { color: var(--primary); }
.logo-dot { color: var(--accent); }
.logo-role { color: var(--text-muted); font-size: 0.85rem; }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0;
}
.nav-links li a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links li a::before {
  content: attr(data-num);
  color: var(--primary);
  margin-right: 6px;
  font-size: 0.7rem;
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--primary); }

#theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  transition: all 0.2s;
  margin-left: 16px;
}
#theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ── Status badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(57,211,83,0.08);
  border: 1px solid rgba(57,211,83,0.25);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 100px;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}
.status-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57,211,83,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(57,211,83,0); }
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  padding-top: 68px;
  gap: 60px;
}
.hero-content { flex: 1; max-width: 580px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-eyebrow span { color: var(--primary); }

.hero-content h1 {
  font-family: var(--font-head);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 8px;
}
.hero-content h1 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1px var(--primary);
}

.hero-title-sub {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}
.hero-title-sub::before { content: '// '; color: var(--text-dim); }

.hero-desc {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 460px;
  margin-bottom: 36px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

.cta-group { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,212,255,0.3);
}
.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 30px rgba(0,212,255,0.5);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s;
}
.social-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

/* ── Hero Image ── */
.hero-visual { position: relative; flex-shrink: 0; }
.hero-avatar-wrap {
  position: relative;
  width: 300px; height: 300px;
}
.hero-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--primary), transparent 50%, var(--accent));
  border-radius: 24px;
  z-index: 0;
}
.hero-avatar-wrap img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 22px;
  z-index: 1;
  display: block;
}
.hero-badge {
  position: absolute;
  bottom: -16px; right: -16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  z-index: 2;
}
.hero-badge strong { display: block; color: var(--primary); font-size: 1rem; margin-bottom: 2px; }

.hero-tag {
  position: absolute;
  top: -16px; left: -16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  z-index: 2;
}

/* ── Section title ── */
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-divider {
  width: 40px; height: 2px;
  background: var(--primary);
  margin-bottom: 40px;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p {
  font-family: var(--font-mono);
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 16px;
}
.about-text p strong { color: var(--primary); font-weight: 700; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--primary); }
.stat-num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.skill-card:hover { border-color: var(--border-glow); transform: translateY(-4px); box-shadow: var(--glow); }
.skill-card:hover::before { opacity: 1; }

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  color: var(--primary);
}
.skill-card h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.skill-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--primary);
  background: var(--primary-dim);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0,212,255,0.2);
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--glow);
}
.project-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.project-icon {
  width: 48px; height: 48px;
  background: var(--primary-dim);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.3rem;
}
.project-links { display: flex; gap: 8px; }
.project-links a {
  width: 32px; height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.project-links a:hover { border-color: var(--primary); color: var(--primary); }

.project-body { padding: 20px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.project-body h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}
.project-body p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 16px;
}
.tech-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(255,107,53,0.1);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,107,53,0.2);
}

/* ── CTA Section ── */
.cta-section {
  text-align: center;
  padding: 80px 0;
}
.cta-section p {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Contact ── */
.contact-wrapper {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  margin-top: 2rem;
}
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-dim); }
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.contact-form textarea { min-height: 140px; }

.contact-info { display: flex; flex-direction: column; gap: 16px; }
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}
.info-card:hover { border-color: var(--primary); }
.info-icon {
  width: 40px; height: 40px;
  background: var(--primary-dim);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}
.info-card span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Modal ── */
.modal {
  display: none;
  position: fixed; z-index: 2000;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  padding: 24px;
}
.modal-content {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 auto;
  padding: 36px;
  width: 100%; max-width: 760px;
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  top: 50%; transform: translateY(-50%);
}
.close-modal {
  position: absolute; top: 16px; right: 20px;
  font-size: 1.5rem; cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  line-height: 1;
  background: none; border: none;
}
.close-modal:hover { color: var(--primary); }
.modal-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}
.modal-desc {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-container iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}
footer p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
footer a { color: var(--primary); text-decoration: none; }
footer span { color: var(--accent); }

/* ── Code Block (About) ── */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}
.code-block-header {
  background: #161b22;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.code-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.code-dot.red    { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green  { background: #28c840; }
.code-block-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}
.code-content {
  padding: 20px 24px;
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 0;
}
.c-keyword { color: #ff7b72; }
.c-class   { color: #79c0ff; }
.c-str     { color: #a5d6ff; }

/* ── Project Highlights ── */
.project-highlights {
  list-style: none;
  margin: 10px 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-highlights li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}
.project-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ── Animations ── */
.fade-in { opacity: 0; transform: translateY(24px); animation: fadeUp 0.7s ease forwards; }
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Terminal blinking cursor ── */
.cursor {
  display: inline-block;
  width: 10px; height: 1.1em;
  background: var(--primary);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero { flex-direction: column-reverse; justify-content: center; text-align: center; padding-top: 100px; min-height: auto; padding-bottom: 60px; }
  .hero-content { max-width: 100%; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .cta-group { justify-content: center; }
  .social-links { justify-content: center; }
  .hero-avatar-wrap { width: 220px; height: 220px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-wrapper { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .hero-content h1 { font-size: 2.4rem; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .modal-content { padding: 24px 20px; top: 0; transform: none; margin-top: 60px; max-height: calc(100vh - 84px); }
  .nav-links li a span.nav-text { display: none; }
}