/* ──────────────────────────────────────────
   DESIGN TOKENS
────────────────────────────────────────── */
:root {
  /* Light mode */
  --bg:         #ffffff;
  --surface:    #f6f6f6;
  --border:     #e8e8e8;
  --text-1:     #0f0f0f;
  --text-2:     #555555;
  --text-3:     #888888;
  --accent:     #1a56db;
  --accent-dim: #e8effd;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Sizes */
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow:    0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  /* Layout */
  --max-w: 740px;
  --header-h: 58px;
}

[data-theme="dark"] {
  --bg:         #0f0f0f;
  --surface:    #1a1a1a;
  --border:     #2a2a2a;
  --text-1:     #f0f0f0;
  --text-2:     #a0a0a0;
  --text-3:     #666666;
  --accent:     #5b8dee;
  --accent-dim: #1a1f33;
  --shadow:    0 2px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.65;
  font-size: 16px;
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
}

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

img { display: block; max-width: 100%; }

ul { list-style: none; }

/* ──────────────────────────────────────────
   LAYOUT
────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ──────────────────────────────────────────
   HEADER
────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  transition: background .25s, border-color .25s;
}

.site-header .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-1);
  letter-spacing: .04em;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color .15s, background .15s;
}

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

@media (max-width: 480px) {
  .header-nav { display: none; }
  .header-right .nav-icon:not(.theme-btn) { display: none; }

  /* MK becomes the menu trigger */
  .logo {
    position: relative;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
  }
  .logo.menu-open {
    background: var(--surface);
    color: var(--accent);
  }
  /* subtle dot indicator */
  .logo.menu-open::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
  }
}

/* ── Mobile menu ── */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 20px;
  z-index: 99;
  animation: menu-in .18s ease;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-menu.open { display: block; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.mobile-nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.mobile-nav-link:hover {
  background: var(--surface);
  text-decoration: none;
}

.mobile-nav-icons {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: .95rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.nav-icon:hover {
  color: var(--text-1);
  background: var(--surface);
  text-decoration: none;
}

/* ──────────────────────────────────────────
   HERO
────────────────────────────────────────── */
.hero {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 52px 0 44px;
  border-bottom: 1px solid var(--border);
}

.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.hero-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-title {
  font-size: .95rem;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 14px;
}

.hero-bio {
  font-size: .95rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 520px;
}

.hero-bio a {
  color: var(--text-1);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: var(--text-1);
  color: var(--bg);
  font-size: .875rem;
  font-weight: 600;
  transition: opacity .15s;
  text-decoration: none;
}
.btn-solid:hover { opacity: .82; text-decoration: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-1);
  font-size: .875rem;
  font-weight: 500;
  transition: border-color .15s, background .15s;
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--text-2); background: var(--surface); text-decoration: none; }

/* ──────────────────────────────────────────
   SECTIONS
────────────────────────────────────────── */
.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-child { border-bottom: none; }

.section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  margin-bottom: 20px;
}

/* ──────────────────────────────────────────
   PILLS
────────────────────────────────────────── */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-size: .8rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.pill:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: transparent;
}

/* ──────────────────────────────────────────
   EXPERIENCE LIST
────────────────────────────────────────── */
.exp-list { display: flex; flex-direction: column; gap: 0; }

.exp-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0 20px;
  padding: 18px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  align-items: start;
}

.exp-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.exp-item:hover {
  background: var(--surface);
}

.exp-year {
  font-size: .8rem;
  color: var(--text-3);
  font-weight: 500;
  padding-top: 3px;
  line-height: 1.4;
}

.exp-body {}

.exp-role {
  font-size: .975rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 1px;
}

.exp-co {
  font-size: .875rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

.exp-summary {
  font-size: .875rem;
  color: var(--text-3);
  line-height: 1.6;
}

.exp-arrow {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* ──────────────────────────────────────────
   SIDE PROJECTS
────────────────────────────────────────── */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .15s, box-shadow .15s;
}

.project-card:hover {
  border-color: var(--text-3);
  box-shadow: var(--shadow);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.project-name {
  font-size: .975rem;
  font-weight: 600;
  color: var(--text-1);
}

.project-badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 100px;
}

.project-badge--live {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .project-badge--live {
  background: #14532d;
  color: #4ade80;
}

.project-badge--wip {
  background: #fef9c3;
  color: #a16207;
}

[data-theme="dark"] .project-badge--wip {
  background: #422006;
  color: #fbbf24;
}

.project-desc {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: color .15s;
}

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

/* ──────────────────────────────────────────
   FOOTER
────────────────────────────────────────── */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: .85rem;
  color: var(--text-3);
}
.site-footer a {
  color: var(--text-2);
}

/* ──────────────────────────────────────────
   MODAL
────────────────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 32px 16px;
}

.modal-bg.open { display: flex; align-items: flex-start; justify-content: center; }

.modal {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  animation: modal-in .22s cubic-bezier(.4,0,.2,1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  z-index: 10;
}
.modal-close:hover { background: var(--border); color: var(--text-1); }

.modal-header {
  padding: 32px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
  padding-right: 32px;
}

.modal-header p {
  font-size: .875rem;
  color: var(--text-2);
}

.modal-scroll {
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.m-summary {
  font-size: .975rem;
  color: var(--text-2);
  line-height: 1.7;
}

.m-block h3 {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  margin-bottom: 12px;
}

#m-resp {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#m-resp li {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

#m-resp li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-3);
  font-size: .8rem;
}

/* Project cards inside modal */
#m-projects {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.proj-card h4 {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-1);
}

.star-row {
  display: grid;
  gap: 8px;
}

.star-item {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--text-2);
}

.star-item strong {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-right: 6px;
  min-width: 60px;
}

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 620px) {
  .hero {
    flex-direction: column;
    gap: 20px;
    padding: 36px 0 32px;
  }

  .hero-photo-wrap {
    width: 80px;
    align-self: flex-start;
  }

  .hero-photo { width: 80px; height: 80px; }

  .hero-name { font-size: 1.5rem; }

  .exp-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exp-year {
    font-size: .78rem;
  }

  .modal-header { padding: 24px 20px 16px; }
  .modal-scroll  { padding: 20px 20px 28px; }
}

/* ──────────────────────────────────────────
   SCROLLBAR (subtle)
────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
