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

:root {
  --bg: #0b0b0a;
  --surface: #111110;
  --surface-2: #181817;
  --border: #222220;
  --border-2: #2c2c29;
  --text: #e4e4df;
  --text-muted: #6b6b66;
  --text-subtle: #38382f;
  --accent: #5b9cf6;
  --accent-hover: #7ab3f8;
  --accent-dim: rgba(91, 156, 246, 0.08);
  --accent-glow: rgba(91, 156, 246, 0.12);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.08);
  --radius: 6px;
  --max-width: 720px;
  --nav-height: 52px;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===== Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 10, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.08em;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
}

.nav-brand:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.15rem;
}

.nav-links a {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

/* ===== Main layout ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Hero ===== */
.hero {
  padding: 5rem 0 4.5rem;
  text-align: center;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 380px;
  background: radial-gradient(ellipse at 50% 35%, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
  user-select: none;
}

.avatar-wrapper {
  display: inline-block;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, rgba(91, 156, 246, 0.15) 100%);
  margin-bottom: 1.5rem;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: block;
  border: 3px solid var(--bg);
  object-fit: cover;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-dim);
  border: 1px solid rgba(74, 222, 128, 0.18);
  border-radius: 99px;
  padding: 0.28rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50% { opacity: 0.55; box-shadow: 0 0 2px var(--green); }
}

.hero-bio {
  max-width: 480px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.75;
}

/* ===== Section header ===== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.6;
  letter-spacing: 0.08em;
  user-select: none;
}

/* ===== Sections ===== */
.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.975rem;
}

.section p:last-child {
  margin-bottom: 0;
}

.section-intro {
  margin-bottom: 1.5rem !important;
}

/* ===== Skills ===== */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.skill {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  font-family: var(--font-mono);
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-2);
  letter-spacing: 0.01em;
}

/* ===== Projects ===== */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.project-card {
  display: block;
  background: var(--surface);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.15s;
}

.project-card::after {
  content: '↗';
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
  transition: color 0.15s, transform 0.2s;
}

.project-card:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
}

.project-card:hover::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
  padding-right: 1.25rem;
}

.project-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  font-family: var(--font-mono);
}

.project-downloads {
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--accent);
  font-family: var(--font-mono);
  opacity: 0.8;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.project-lang {
  font-size: 0.7rem;
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--text-subtle);
}

/* ===== Contact form ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.925rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-subtle);
}

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

.submit-btn {
  align-self: flex-start;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #0b0b0a;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.submit-btn:hover {
  background: var(--accent-hover);
}

.submit-btn:active {
  transform: translateY(1px);
}

/* ===== Connect ===== */
.connect-links {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.connect-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
  text-decoration: none;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-subtle);
  font-size: 0.775rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.85rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}
