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

:root {
  --bg: #0e0e0e;
  --bg2: #141414;
  --surface: #1a1a1a;
  --surface2: #222222;
  --text: #f0eeea;
  --muted: #888888;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --tag-bg: #242424;
  --tag-text: #aaaaaa;
  --accent: #f0eeea;
}

[data-theme="light"] {
  --bg: #f9f8f5;
  --bg2: #f4f2ee;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.09);
  --border-hover: rgba(0, 0, 0, 0.18);
  --tag-bg: #ede9e3;
  --tag-text: #4a4a4a;
  --accent: #1a1a1a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}

.logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

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

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

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s;
}

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

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.toggle-icon {
  font-size: 14px;
}

/* ── HERO ── */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2.5rem 4rem;
}

.hero-chip {
  display: inline-block;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 1.75rem;
  letter-spacing: 0.05em;
  border: 0.5px solid var(--border);
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 2.25rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-dark {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 11px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

.btn-dark:hover {
  opacity: 0.8;
}

.btn-light {
  background: transparent;
  color: var(--text);
  border: 0.5px solid var(--border-hover);
  padding: 11px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, border-color 0.2s;
}

.btn-light:hover {
  background: var(--surface);
  border-color: var(--border-hover);
}

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 0.5px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
}

/* ── SECTIONS ── */
section {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  gap: 0.5px;
  background: var(--border);
}

.project-card {
  background: var(--surface);
  padding: 2rem 1.75rem;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  background: var(--surface2);
}

.project-num {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.project-card h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  line-height: 1.2;
  color: var(--text);
}

.project-card .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.4rem;
  font-weight: 300;
  flex-grow: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
}

.tag.featured {
  background: var(--text);
  color: var(--bg);
}

.tag.beta {
  background: transparent;
  color: #c4963a;
  border: 0.5px solid #c4963a44;
}

.tag.psychology {
  background: transparent;
  color: #8b7ec8;
  border: 0.5px solid #8b7ec844;
}

.tag.fullstack {
    background: transparent;
    color: #7f8bdc;
    border: 0.5px solid #7f8bdc44;
}

.project-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s;
}

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

/* ── ABOUT ── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.about-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
}

.about-card .card-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.about-card p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
}

.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.25rem;
}

/* ── CONTACT ── */
.contact-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-inner h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.contact-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 0.5px solid var(--border);
  padding: 8px 18px;
  border-radius: 6px;
  transition: all 0.2s;
}

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

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 12px;
  color: var(--muted);
  border-top: 0.5px solid var(--border);
  margin-top: 2rem;
}

/* ── RESPONSIVE ── */
@keyframes expandBox {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.writing-link {
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  display: block;
}

.writing-link:hover {
  transform: scale(1.05);
  background: var(--surface) !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .hero,
  section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero {
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .contact-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
