/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- Theme tokens ---------- */
:root {
  --color-bg: #f7f6f3;
  --color-surface: #ffffff;
  --color-text: #1c2333;
  --color-text-muted: #5a6275;
  --color-primary: #17335e;
  --color-primary-light: #274a80;
  --color-accent: #c9962c;
  --color-border: #e4e1da;
  --color-tag-bg: #eef1f6;
  --shadow: 0 4px 20px rgba(23, 51, 94, 0.08);
  --radius: 10px;
}

:root[data-theme="dark"] {
  --color-bg: #12151c;
  --color-surface: #1a1e28;
  --color-text: #eceef2;
  --color-text-muted: #a0a6b5;
  --color-primary: #7ea3e0;
  --color-primary-light: #9db8e8;
  --color-accent: #e0b354;
  --color-border: #2a2f3b;
  --color-tag-bg: #232837;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #12151c;
    --color-surface: #1a1e28;
    --color-text: #eceef2;
    --color-text-muted: #a0a6b5;
    --color-primary: #7ea3e0;
    --color-primary-light: #9db8e8;
    --color-accent: #e0b354;
    --color-border: #2a2f3b;
    --color-tag-bg: #232837;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--color-primary); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  height: 38px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lang-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 80px 24px 64px;
  flex-wrap: wrap;
}

.hero-photo {
  flex: 0 0 auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow);
  background: var(--color-tag-bg);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text { flex: 1 1 420px; }

.hero-eyebrow {
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.hero-text h1 {
  font-size: 2.6rem;
  margin: 0 0 4px;
  color: var(--color-primary);
  line-height: 1.1;
}

.hero-role {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin: 0 0 20px;
  font-weight: 500;
}

.hero-summary {
  max-width: 640px;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(23,51,94,0.3); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.hero-socials {
  display: flex;
  gap: 20px;
}
.hero-socials a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}
.hero-socials a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 24px;
  border-top: 1px solid var(--color-border);
}

.section-title {
  font-size: 1.6rem;
  color: var(--color-primary);
  margin: 0 0 32px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  margin-top: 10px;
  border-radius: 2px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
}
.about-text p { color: var(--color-text-muted); margin: 0 0 16px; }
.about-skills h3 {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0 0 14px;
}
.about-skills h3:not(:first-child) { margin-top: 28px; }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tags li {
  background: var(--color-tag-bg);
  color: var(--color-primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.lang-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}
.lang-list li:last-child { border-bottom: none; }
.lang-level { color: var(--color-text-muted); }

/* Timeline (experience / education) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.timeline-item {
  display: flex;
  gap: 20px;
  position: relative;
  padding-left: 8px;
}
.timeline-marker {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-top: 8px;
}
.timeline-content h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--color-text);
}
.timeline-org {
  color: var(--color-text-muted);
  font-weight: 400;
}
.timeline-meta {
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.timeline-content ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-content li {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  padding-left: 16px;
  position: relative;
}
.timeline-content li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-border);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.project-card h3 {
  margin: 0 0 4px;
  color: var(--color-primary);
}
.project-meta {
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.project-card p:not(.project-meta) {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0 0 16px;
}
.project-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
}
.project-note {
  margin-top: 24px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.project-note a { color: var(--color-primary); font-weight: 600; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  font-weight: 600;
}
.contact-value {
  font-weight: 600;
  word-break: break-word;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 24px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Blog ---------- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.blog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
}
.blog-card h3 { margin: 0 0 6px; color: var(--color-primary); }
.blog-card .blog-meta {
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.blog-card p { color: var(--color-text-muted); margin: 0; }
.empty-state {
  color: var(--color-text-muted);
  padding: 40px 0;
  text-align: center;
}

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.post-content h1 { color: var(--color-primary); }
.post-meta {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.post-content p { color: var(--color-text); margin: 0 0 18px; }
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 48px; flex-direction: column; text-align: center; }
  .hero-actions, .hero-socials { justify-content: center; }
  .hero-text h1 { font-size: 2.1rem; }
}
