/* ============================================
   1. VARIABLES — edit these to set your identity
   ============================================ */
:root {
  /* colors — light mode */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --accent: #2563eb;      /* pick something that isn't generic template orange */
  --border: #e2e2e2;

  /* type */
  --font-display: "Georgia", serif;      /* headings — swap for a real display font */
  --font-body: system-ui, sans-serif;    /* body text */

  /* spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  /* layout */
  --max-width: 800px;
  --radius: 8px;
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-alt: #1c1c1e;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent: #60a5fa;
  --border: #2e2e2e;
}

/* ============================================
   2. RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }

/* ============================================
   3. NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.nav-logo { font-family: var(--font-display); font-size: 1.25rem; }
.nav-links {
  display: flex;
  gap: var(--space-3);
}
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--accent); }

.theme-toggle, .nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}

/* hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: var(--space-2);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
}

/* ============================================
   4. HERO
   ============================================ */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-2);
  text-align: center;
}
.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-3);
}
.hero h1 { font-size: 2.5rem; margin: 0 0 var(--space-1); }
.hero-title { color: var(--text-muted); margin: 0; }
.hero-location { color: var(--text-muted); font-size: 0.9rem; margin: var(--space-1) 0 var(--space-3); }
.hero-links {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.hero-links a { color: var(--accent); }

.btn {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   5. SECTIONS (shared)
   ============================================ */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-2);
  border-top: 1px solid var(--border);
}
.section-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

/* ============================================
   6. SKILLS
   ============================================ */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.skill-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}
.skill-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.skill-level {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.2rem;
}

/* ============================================
   7. TIMELINE (experience / education)
   ============================================ */
.timeline-item { margin-bottom: var(--space-3); }
.timeline-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.timeline-date { color: var(--text-muted); font-size: 0.9rem; }
.timeline-org { color: var(--accent); margin: 0 0 var(--space-1); }
.timeline-details { padding-left: 1.2rem; list-style: disc; }

/* ============================================
   8. PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: var(--space-1) 0;
}
.project-tags span {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

/* ============================================
   9. FOOTER
   ============================================ */
.site-footer {
  text-align: center;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   10. BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-3);
  right: var(--space-3);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   11. ACCESSIBILITY
   ============================================ */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}