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

:root {
  --text: #1c1c1c;
  --text-secondary: #555;
  --accent: #1155cc;
  --bg: #fff;
  --bg-subtle: #f5f5f5;
  --border: #e8e8e8;
  --nav-bg: rgba(255, 255, 255, 0.97);
  --max-width: 850px;
}

[data-theme="dark"] {
  --text: #e4e4e4;
  --text-secondary: #a0a0a0;
  --accent: #6ea8fe;
  --bg: #161616;
  --bg-subtle: #222;
  --border: #333;
  --nav-bg: rgba(22, 22, 22, 0.97);
}

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

body {
  font-family: 'Azeret Mono', 'SF Mono', Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

/* Person links: same color as surrounding text, always underlined */
a.person-link {
  color: inherit;
  text-decoration: underline;
}

/* ── Navigation ── */
.nav {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.nav-name:hover {
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem;
  line-height: 1;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.theme-toggle:hover {
  color: var(--text);
}

/* ── Main Content ── */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ── Hero / Intro ── */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  order: 2;
}

.hero-text {
  order: 1;
  flex: 1;
}

.hero-text h1 {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.hero-text .tagline {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-text .tagline .line {
  display: block;
}

.hero-text .tagline .line + .line {
  margin-top: 0.6rem;
}

/* ── Social Links ── */
.social-links {
  margin-bottom: 2.5rem;
  font-size: 0.92rem;
  line-height: 1.8;
  text-align: center;
}

.social-links a {
  color: var(--accent);
}

.social-links .sep {
  color: var(--text-secondary);
  margin: 0 0.3rem;
}

/* ── Section Headings ── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* ── News ── */
.news-list {
  list-style: none;
  margin-bottom: 2.5rem;
}

.news-item {
  padding: 0.35rem 0;
  font-size: 0.93rem;
  line-height: 1.7;
}

.news-date {
  font-weight: 700;
}

/* ── Projects ── */
.project-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.project-card:last-child {
  border-bottom: none;
}

.project-image {
  width: 400px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-image .placeholder {
  width: 100%;
  min-height: 160px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

.project-body {
  flex: 1;
}

.project-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.project-body h3.project-mate {
  font-weight: 400;
}

.project-body h3.project-mate b {
  font-weight: 700;
}

.project-org {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.1rem;
}

.project-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.project-body p {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
}

.project-links {
  margin-top: 0.5rem;
  font-size: 0.88rem;
}

.project-links a {
  margin-right: 0.8rem;
}

/* ── About / Page ── */
.page-title {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.about-section {
  margin-bottom: 2rem;
}

.about-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.about-section p,
.about-section li {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
}

.about-section ul {
  padding-left: 1.2rem;
}

.about-section li {
  margin-bottom: 0.3rem;
}

.entry {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

img.entry-logo {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.entry-content {
  flex: 1;
  min-width: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.entry-header strong {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.entry-subrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.entry-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}

.about-section p.paper {
  margin-bottom: 0.6rem;
}

.entry p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ── Skills Tags ── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: #eef2f7;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
}

/* ── Story (easter egg) ── */
.hero-photo-link {
  order: 2;
  flex-shrink: 0;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.hero-photo-link:hover {
  transform: scale(1.04);
}
.hero-photo-link .hero-photo {
  display: block;
}

.story {
  max-width: 640px;
  margin: 0 auto;
}

.story-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.story-photo {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.story-title {
  font-size: 2rem;
  font-weight: 700;
}

.story-body p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.3rem;
  color: var(--text);
}

/* ── Footer ── */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-photo-link {
    order: 1;
  }

  .hero-photo {
    width: 160px;
    height: 160px;
    order: 1;
  }

  .hero-text {
    order: 2;
  }

  .social-links {
    text-align: center;
  }

  .project-card {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
  }

  .entry-header,
  .entry-subrow {
    flex-direction: column;
  }
}
