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

/* ── Tokens — dark (default) ── */
:root {
  --bg:       #111111;
  --bg2:      #1c1c1c;
  --bg3:      #262626;
  --border:   #2e2e2e;
  --text:     #ededed;
  --muted:    #888888;
  --muted2:   #505050;
  --accent:   #818cf8;
  --ease:     0.18s ease;
  --radius:   6px;
}

/* ── Tokens — light ── */
[data-theme="light"] {
  --bg:       #fefefe;
  --bg2:      #f5f5f5;
  --bg3:      #ececec;
  --border:   #e0e0e0;
  --text:     #111111;
  --muted:    #666666;
  --muted2:   #aaaaaa;
  --accent:   #4f46e5;
}

/* ── Smooth theme transition ── */
html { transition: background-color 0.2s ease; }
body, nav, footer { transition: background-color 0.2s ease, border-color 0.2s ease; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

p { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ── */
.container { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1rem;
}
.nav-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:hover { text-decoration: none; color: var(--text); }
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color var(--ease);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0.25rem;
}

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}
.toggle-icon {
  font-size: 9px;
  color: var(--muted2);
  line-height: 1;
  z-index: 1;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.22s ease;
}
[data-theme="light"] .toggle-thumb { transform: translateX(18px); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--bg2); border-color: var(--muted2); text-decoration: none; }
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover { opacity: 0.85; background: var(--text); color: var(--bg); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

/* ── Hero ── */
.hero { padding: 5rem 0 4rem; }
.hero-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.hero-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.hero-bio {
  max-width: 520px;
  font-size: 0.97rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: var(--muted);
}
.hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Section header ── */
.section-header { margin-bottom: 2rem; }
.section-header h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.section-header p { font-size: 0.85rem; }
.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.section-row h2 { font-size: 1.1rem; font-weight: 600; }

/* ── Project cards ── */
.projects-list { display: flex; flex-direction: column; gap: 0; }
.project-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}
.project-item:first-child { border-top: 1px solid var(--border); }
.project-item-body { min-width: 0; }
.project-item h3 {
  font-size: 0.97rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.project-item p {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  line-height: 1.65;
}
.project-item-links {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

/* ── Tech tags ── */
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tech-tag {
  font-size: 0.72rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ── Status dot ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
}
.status-dot.green { background: #4ade80; }
.status-dot.amber { background: #fbbf24; }

/* ── Skills ── */
.skills-list { display: flex; flex-direction: column; gap: 0.9rem; }
.skill-item {}
.skill-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.skill-name { color: var(--text); }
.skill-pct { color: var(--muted2); font-size: 0.78rem; }
.skill-bar {
  height: 2px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: width 1s ease;
}

/* ── Category label ── */
.cat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-bottom: 1rem;
}

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 1px solid var(--border); }
.timeline-period {
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.15rem;
  line-height: 1.4;
}
.timeline-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.15rem; }
.timeline-org { font-size: 0.83rem; color: var(--muted); margin-bottom: 0.5rem; }
.timeline-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }

/* ── Interests ── */
.interests-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.interest-chip {
  font-size: 0.83rem;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

/* ── About grid ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 3rem;
  align-items: start;
}
.about-bio p { font-size: 0.95rem; line-height: 1.85; margin-bottom: 1rem; }
.about-bio p:last-child { margin-bottom: 0; }
.about-meta { display: flex; flex-direction: column; gap: 0; }
.meta-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.meta-row:first-child { border-top: 1px solid var(--border); }
.meta-key { color: var(--muted2); margin-bottom: 0.1rem; font-size: 0.75rem; }
.meta-val { color: var(--text); }
.meta-val a { color: var(--accent); text-decoration: none; }
.meta-val a:hover { text-decoration: underline; }

/* ── Contact form ── */
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 520px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label { font-size: 0.78rem; color: var(--muted); }
.form-control {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color var(--ease);
}
.form-control::placeholder { color: var(--muted2); }
.form-control:focus { outline: none; border-color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Alert ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.alert-success { border-color: #4ade8066; color: #4ade80; background: #4ade8010; }
.alert-error   { border-color: #f8717166; color: #f87171; background: #f8717110; }

/* ── Page header ── */
.page-header { padding: 3.5rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 3rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.3rem; }
.page-header p { font-size: 0.88rem; }

/* ── Filter tabs ── */
.filter-tabs { display: flex; gap: 0.4rem; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-tab {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ease);
}
.filter-tab:hover { color: var(--text); border-color: var(--muted2); text-decoration: none; }
.filter-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Empty state ── */
.empty-state { padding: 3rem 0; color: var(--muted); font-size: 0.88rem; }

/* ── Divider ── */
.rule { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

/* ── CTA strip ── */
.cta-strip {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-strip h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.cta-strip p { font-size: 0.85rem; }

/* ── Contact info ── */
.contact-info { margin-bottom: 2rem; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}
.contact-link:first-of-type { border-top: 1px solid var(--border); }
.contact-link:hover { color: var(--text); text-decoration: none; }
.contact-link i { width: 16px; text-align: center; color: var(--muted2); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy { font-size: 0.78rem; color: var(--muted2); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { font-size: 0.78rem; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-icon { font-size: 0.78rem; color: var(--muted2); }
.lang-selector select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.lang-selector select:hover { border-color: var(--muted); color: var(--text); }
.lang-selector select:focus { outline: none; border-color: var(--accent); }
.lang-selector select option { background: var(--bg2); color: var(--text); }

/* ── Scroll to top ── */
#scrollTop {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ease), color var(--ease);
  z-index: 99;
  font-size: 0.75rem;
}
#scrollTop.visible { opacity: 1; }
#scrollTop:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .timeline-period { padding-top: 0; }
  .project-item { grid-template-columns: 1fr; }
  .project-item-links { padding-top: 0; }
  .form-row { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; align-items: flex-start; }
  .nav-links { display: none; flex-direction: column; align-items: flex-start; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.75rem 1.5rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
