:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content-width: 620px;
  --radius: 6px;
  --transition: all 0.3s ease;
}

/* Dark theme (default) - soft grayscale dark */
:root {
  color-scheme: dark;
  --bg: #1a1a1a;
  --bg-alt: #242424;
  --text: #f2f2f2;
  --text-muted: #a3a3a3;
  --border: #333333;
}

/* Light theme - soft grayscale light */
:root.light {
  color-scheme: light;
  --bg: #fcfcfc;
  --bg-alt: #f0f0f0;
  --text: #1a1a1a;
  --text-muted: #555555;
  --border: #e0e0e0;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / Nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
  position: relative;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand span {
  font-weight: 400;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Theme toggle: sun shown in dark mode, moon shown in light mode */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.icon-moon {
  display: none;
}

:root.light .icon-sun {
  display: none;
}

:root.light .icon-moon {
  display: block;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
}

.eyebrow {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 24px;
}

.profile-pic {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  cursor: pointer;
}

.profile-pic.pixelating {
  image-rendering: pixelated;
}

.hero-name {
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -1.5px;
}

.hero-role {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 14px;
}

.hero-loc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 24px;
}

/* Sections */
.section {
  padding: 72px 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 14px;
  letter-spacing: -0.5px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

.section-title span {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.85em;
  margin-right: 10px;
}

/* About */
.section p {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.tech-list,
.badge-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tech-list img,
.badge-list img {
  display: block;
  height: 28px;
  width: auto;
}

.project .badge-list {
  margin-top: 12px;
}

/* Experience */
.exp-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.exp-item:last-of-type {
  border-bottom: none;
}

.exp-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.exp-logo-link {
  flex-shrink: 0;
  transition: var(--transition);
}

.exp-logo-link:hover {
  opacity: 0.8;
}

.exp-logo {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 4px;
}

.exp-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.exp-org {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.85rem;
  margin-top: 4px;
}

.exp-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 10px;
}

/* Projects */
.project {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.project:last-of-type {
  border-bottom: none;
}

.project h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.project p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 8px;
  margin-bottom: 0;
}

.project-link {
  display: inline-block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: var(--transition);
}

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

/* Certificates */
.cert {
  text-align: center;
}

.cert-badge {
  display: inline-block;
  transition: var(--transition);
}

.cert-badge:hover {
  transform: translateY(-4px);
}

.cert img {
  display: block;
  width: 120px;
  height: 120px;
}

.cert-info {
  margin-top: 16px;
}

.cert h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.cert-issuer {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Contact */
.contact-wrap {
  text-align: center;
}

.contact-wrap .btn {
  margin-top: 24px;
}

.contact-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.contact-desc {
  color: var(--text-muted);
  margin-top: 14px;
}

.contact-links {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 26px;
}

.contact-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
}

.btn:hover {
  background: var(--bg-alt);
}

/* Footer */
.site-footer {
  padding: 26px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 56px;
  }

  .container {
    padding: 0 16px;
  }

  body {
    overflow-x: clip;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-top {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-pic {
    width: 120px;
    height: 120px;
  }

  .hero-name {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .hero-role {
    font-size: 1.05rem;
  }

  .section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .tech-list,
  .badge-list {
    gap: 8px;
  }

  .tech-list img,
  .badge-list img {
    height: 26px;
  }

  .exp-head {
    align-items: flex-start;
  }

  .project p,
  .exp-desc {
    font-size: 0.92rem;
  }

  .cert img {
    width: 100px;
    height: 100px;
  }
}