/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
ul { list-style: none; }
a  { color: inherit; text-decoration: none; }

/* ── Tokens ────────────────────────────────── */
:root {
  --bg:      #ffffff;
  --bg2:     #f6f8fa;
  --text:    #1a1a1a;
  --text2:   #555;
  --border:  #e5e7eb;
  --accent:  #1d4ed8;
  --dot-on:  #22c55e;
  --dot-off: #6b7280;
  --max-w:   960px;
  --font:    'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --text:    #e6edf3;
  --text2:   #8b949e;
  --border:  #30363d;
  --accent:  #58a6ff;
  --dot-off: #8b949e;
}

/* ── Base ──────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

/* ── Navbar ────────────────────────────────── */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 50px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.2s, border-color 0.2s;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

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

.nav-link {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover  { color: var(--text); background: var(--border); }
.nav-link.active { color: var(--text); font-weight: 500; background: var(--border); }

.theme-toggle {
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
}

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

/* ── Pages ─────────────────────────────────── */
.page        { display: none; padding-top: 66px; padding-bottom: 80px; }
.page.active { display: block; }

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

/* ── Hero ──────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
  padding: 44px 0 52px;
}

/* ── Photo Collage ─────────────────────────── */
.photo-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 205px 205px;
  gap: 5px;
  border-radius: 10px;
  overflow: hidden;
}

.photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.p1 { grid-column: 1; grid-row: 1; }
.p2 { grid-column: 2; grid-row: 1; }
.p3 { grid-column: 1; grid-row: 2; }
.p4 { grid-column: 2; grid-row: 2; }

/* ── Hero Text ─────────────────────────────── */
.name {
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text2);
  margin-bottom: 5px;
}

.tagline a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tagline a:hover { opacity: 0.75; }

.availability {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 20px;
}

.availability::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-on);
  animation: blink 2.2s ease-in-out infinite;
}

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

.bio p {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 12px;
}

a.link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

a.link:hover { text-decoration-color: var(--text2); }

.socials {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text2);
  transition: color 0.15s, border-color 0.15s;
}

.social-link:hover { color: var(--text); border-color: var(--text2); }

/* ── Section Label ─────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 12px;
}

/* ── Experience ────────────────────────────── */
.exp-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.exp-list { display: flex; flex-direction: column; }

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

.exp-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 4px;
  cursor: pointer;
  user-select: none;
}

.exp-row:hover .exp-company { color: var(--accent); }

.exp-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.exp-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-off);
}

.exp-dot.on { background: var(--dot-on); }

.exp-company {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.15s;
}

.exp-sep {
  font-size: 0.88rem;
  color: var(--text2);
  flex-shrink: 0;
}

.exp-role {
  font-size: 0.88rem;
  color: var(--text2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-date {
  font-size: 0.79rem;
  color: var(--text2);
  white-space: nowrap;
  margin-left: auto;
  padding-left: 6px;
  flex-shrink: 0;
}

.exp-chevron {
  color: var(--text2);
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.exp-item.open .exp-chevron { transform: rotate(180deg); }

/* Smooth accordion */
.exp-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease;
  padding-left: 52px;
  padding-right: 4px;
}

.exp-item.open .exp-details {
  max-height: 300px;
  padding-bottom: 18px;
}

.exp-details li {
  font-size: 0.86rem;
  color: var(--text2);
  line-height: 1.65;
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
}

.exp-details li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--dot-on);
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.exp-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text2);
  background: var(--bg2);
}

.tech-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

[data-theme="dark"] .tech-icon { filter: brightness(0) invert(1); }

/* ── Leadership ────────────────────────────── */
.leadership-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 0;
}

.exp-visit-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.exp-visit-link:hover { opacity: 0.7; }

/* ── Projects ──────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}

.proj-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg2);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.proj-thumb {
  height: 130px;
  overflow: hidden;
  background: var(--border);
}

.proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.proj-card:hover .proj-thumb img { transform: scale(1.04); }

.proj-info { padding: 13px 14px; }

.proj-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.proj-sub {
  font-size: 0.76rem;
  color: var(--text2);
  margin-bottom: 6px;
}

.proj-desc {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.5;
}

/* ── Project Modal ──────────────────────────── */
.proj-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.proj-modal.open { display: flex; }

.proj-modal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.proj-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  z-index: 1;
  transition: color 0.15s;
}

.proj-modal-close:hover { color: var(--text); }

.proj-modal-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  display: block;
}

.proj-modal-body { padding: 18px 20px 22px; }

.proj-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.proj-modal-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.proj-modal-sub {
  font-size: 0.78rem;
  color: var(--text2);
}

.proj-modal-gh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.proj-modal-gh:hover { color: var(--text); border-color: var(--text2); }

.proj-modal-desc {
  font-size: 0.86rem;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.proj-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.proj-modal-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text2);
  background: var(--bg2);
}

/* ── Lightbox ──────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lb-close:hover { opacity: 1; }

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 20px;
  transition: opacity 0.15s;
  user-select: none;
}

.lb-arrow:hover { opacity: 1; }
.lb-prev { left: 0; }
.lb-next { right: 0; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .photo-collage {
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1;
  }

  .exp-role, .exp-sep { display: none; }

  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }
  .name { font-size: 1.55rem; }
}
