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

:root {
  --accent: #2a7a9b;
  --accent-dark: #1c5a73;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --border: #e0ddd7;
  --text: #1a1a1a;
  --muted: #5a5754;
  --max-width: 860px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

/* ── Layout wrapper ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Navigation ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  flex-wrap: wrap;
}

nav .nav-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-dark);
  text-decoration: none;
  margin-right: auto;
}

nav a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  color: var(--accent);
}

/* ── Hero ── */
header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.hero-logo {
  display: block;
  width: 4rem;
  height: auto;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

header p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 600px;
}

/* ── Sections ── */
main {
  padding-bottom: 3rem;
}

section {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

section:last-child {
  border-bottom: none;
}

section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.section-intro {
  color: var(--muted);
  margin-bottom: 1.75rem;
  max-width: 620px;
}

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.card .links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card .links a,
.card > a {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.card .links a:hover,
.card > a:hover {
  text-decoration: underline;
  color: var(--accent-dark);
}

/* ── Projects subsections ── */
.project-group {
  margin-bottom: 2rem;
}

.project-group h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.project-group p {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  max-width: 620px;
}

.project-group > a {
  font-size: 0.9375rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.project-group > a:hover {
  text-decoration: underline;
  color: var(--accent-dark);
}

.link-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-list li a {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: border-color 0.15s;
}

.link-list li a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ── Research & Family ── */
.solo-link {
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
}

.solo-link:hover {
  text-decoration: underline;
  color: var(--accent-dark);
}

.note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* ── Footer ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ── Links (global) ── */
a {
  color: var(--accent);
}

/* ── Mobile ── */
@media (max-width: 520px) {
  nav .container {
    gap: 0.75rem;
  }

  header {
    padding: 2.5rem 0 2rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}
