/* ── Reset & Base ── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --bg: #fff;
  --bg-secondary: #fafafa;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --code-bg: #f5f5f5;
  --tag-bg: #f0f4ff;
  --max-width: 720px;
}

[data-theme="dark"] {
  --text: #e4e4e7;
  --text-secondary: #a1a1aa;
  --bg: #18181b;
  --bg-secondary: #27272a;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --border: #3f3f46;
  --code-bg: #27272a;
  --tag-bg: #1e293b;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  text-align: justify;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

a:hover {
  text-decoration: underline;
}

/* ── Container ── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header & Navigation ── */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: border-color 0.3s;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* ── Main Content ── */

main.container {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - 160px);
}

/* ── Home Page ── */

.home-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.home-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.home-text h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.home-text .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.home-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.home-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.home-links a:hover {
  text-decoration: underline;
}

/* ── Section Headings ── */

main h2, main h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Education ── */

.education-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.edu-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 1.1rem 1.4rem;
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.edu-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.edu-main {
  flex: 1;
  min-width: 0;
}

.edu-school {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.edu-degree {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.edu-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.edu-dates {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.edu-location {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .edu-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .edu-meta {
    align-items: flex-start;
  }
}

/* ── Theme Toggle ── */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  transition: border-color 0.3s;
}

.site-footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
