/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:         #ffffff;
  --text:       #33332d;
  --muted:      #787878;
  --border:     #e1e1e1;
  --card-bg:    #f9f9f8;
  --hover-bg:   #33332d;
  --hover-text: #ffffff;
  --green:      #16a34a;
  --accent:     #706be4;
}

[data-theme="dark"] {
  --bg:         #33332d;
  --text:       #ffffff;
  --muted:      #9e9d96;
  --border:     #4a4a43;
  --card-bg:    #3d3d36;
  --hover-bg:   #ffffff;
  --hover-text: #33332d;
  --accent:     #a89ef0;
}

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

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

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ── Container ─────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Nav ───────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  transition: background 0.2s, border-color 0.2s;
}

.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.15s;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  position: relative;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
  color: var(--accent);
}

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

.nav-resume {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-resume:hover {
  background: var(--hover-bg);
  color: var(--hover-text);
  border-color: var(--hover-bg);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0.5;
  padding: 0.2rem;
  transition: opacity 0.15s;
  line-height: 1;
}

.theme-toggle:hover {
  opacity: 1;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.25rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.2s;
}

/* ── Sections ──────────────────────────────────────────── */
.section {
  padding: 6rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
  border-top: none !important;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--green);
  margin-bottom: 2rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}

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

h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.cursor {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  animation: blink 1s step-end infinite;
}

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

.role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.bio {
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.8;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  padding: 0.65rem 1.3rem;
  text-decoration: none;
  border: 1px solid var(--text);
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}

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

.btn-primary:hover {
  background: transparent;
  color: var(--text);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--text);
  color: var(--bg);
}

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

.project-card {
  border: 1px solid var(--border);
  padding: 2rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.project-card:hover {
  background: var(--hover-bg);
  color: var(--hover-text);
  border-color: var(--hover-bg);
}

.project-card:hover .tag {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
}

[data-theme="dark"] .project-card:hover .tag {
  border-color: rgba(51,51,45,0.3);
  color: rgba(51,51,45,0.6);
}

.project-card:hover .project-link {
  color: var(--hover-text);
}

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

.project-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.project-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
  letter-spacing: 0.06em;
}

.project-status.live {
  color: var(--green);
  border-color: var(--green);
}

.project-status.wip {
  color: var(--muted);
  border-color: var(--muted);
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.03em;
  transition: border-color 0.2s, color 0.2s;
}

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

.project-links {
  display: flex;
  gap: 1.5rem;
}

.project-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-decoration: none;
  transition: opacity 0.15s, color 0.2s;
}

.project-link:hover {
  opacity: 1;
  color: var(--accent);
}

.project-card:hover .project-link:hover {
  color: var(--hover-text);
  opacity: 0.7;
}

.project-wip {
  opacity: 0.6;
}

/* ── Skills ────────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-direction: column;
}

.skill-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.skill-row:first-child {
  border-top: 1px solid var(--border);
}

.skill-category {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.2rem;
  letter-spacing: 0.03em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ── Contact ───────────────────────────────────────────── */
.contact-intro {
  max-width: 480px;
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.8;
  margin-bottom: 3rem;
}

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

.contact-link {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: padding-left 0.15s;
}

.contact-links .contact-link:first-child {
  border-top: 1px solid var(--border);
}

.contact-link:hover {
  padding-left: 0.6rem;
}

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

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

.contact-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 80px;
  letter-spacing: 0.03em;
}

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

/* ── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-resume {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.footer-resume:hover {
  opacity: 1;
}

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

  nav {
    padding: 1rem 1.5rem;
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 1.5rem 1rem;
  }

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

  .nav-link,
  .nav-resume {
    padding: 0.85rem 0;
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
  }

  .theme-toggle {
    padding: 0.85rem 0;
  }

  .section {
    padding: 4rem 0;
  }

  .container {
    padding: 0 1.5rem;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .contact-link {
    flex-direction: column;
    gap: 0.2rem;
  }

  footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
