/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:        #f7f2e6;
  --bg-soft:   #efe7d4;
  --fg:        #23231f;
  --muted:     #726c5c;
  --rule:      #ddd3ba;
  --blue:      #1d5fa8;
  --blue-h:    #123f75;
  --slate:     #5c5f63;
  --slate-bg:  #e6e4de;
  --max:       840px;
  --nav-h:     64px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.075rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Nav ────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

nav .inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
}

nav .brand img {
  opacity: 0.95;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

nav ul a {
  position: relative;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.3rem;
  transition: color 0.15s;
}

nav ul a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

nav ul a:hover { color: var(--fg); }
nav ul a:hover::after,
nav ul a.active::after { transform: scaleX(1); }
nav ul a.active { color: var(--fg); }

/* ─── Layout ─────────────────────────────────────────────── */
main {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.75rem 1.5rem 6rem;
}

/* ─── Typography ─────────────────────────────────────────── */
h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}

h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.8rem 0 0.7rem;
  letter-spacing: -0.005em;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 2rem 0 0.5rem;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { color: var(--blue-h); border-bottom-color: currentColor; text-decoration: none; }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ─── Section divider (hr / tick / label / tick / hr) ───────── */
.section-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 3.5rem 0;
}

.section-divider hr {
  width: 100%;
  margin: 0;
}

.section-divider .divider-tick {
  width: 1px;
  height: 1.5rem;
  background: var(--rule);
}

.section-divider h3 {
  margin: 0.6rem 0;
}

/* ─── Home hero ──────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.75rem;
  align-items: stretch;
  padding: 2.25rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.75rem;
}

.hero-text .tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.9rem;
}

.hero-photo {
  height: 100%;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 285px;
  border-radius: 0;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 18px -8px rgba(35, 35, 31, 0.25);
}

.hero-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-bottom: 1px solid var(--blue);
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.btn:hover {
  background-color: var(--blue);
  color: var(--bg);
  border-bottom-color: var(--blue);
}

/* ─── Home quick-links section ───────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.ql-card {
  background: var(--bg-soft);
  border-left: 3px solid transparent;
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}

.ql-card:hover {
  border-left-color: var(--blue);
  text-decoration: none;
  transform: translateX(2px);
}

.ql-card .ql-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ql-card .ql-desc {
  font-family: 'Source Serif 4', serif;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.ql-card.ql-cv {
  background: var(--slate-bg);
  border-left: 3px solid var(--blue);
}

.ql-card.ql-cv .ql-title {
  color: var(--blue);
}

.ql-card.ql-cv:hover {
  border-color: var(--blue-h);
  background: var(--bg-soft);
}

/* ─── Research cards ─────────────────────────────────────── */
.research-item {
  border-top: 1px solid var(--rule);
  padding: 2.1rem 0;
}

.research-item:last-child { border-bottom: 1px solid var(--rule); }

.research-item .meta {
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.5rem;
}

.research-item h2 {
  margin: 0 0 0.7rem;
  font-size: 1.3rem;
}

.research-item .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.paper-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.cite-meta {
  color: var(--muted);
}

.paper-list strong {
  font-weight: 600;
}

.research-figure {
  margin: 1.25rem 0;
}

.research-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.research-figure figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.5;
}

.research-figure figcaption code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

.research-figure.inset-left {
  float: left;
  width: 270px;
  margin: 0.2rem 1.5rem 1rem 0;
}

.research-figure.inset {
  float: right;
  width: 440px;
  margin: 0.2rem 0 1rem 1.5rem;
}

.tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--slate-bg);
  color: var(--slate);
  border-radius: 3px;
  padding: 0.25rem 0.65rem;
}

/* ─── Contact ────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.contact-item .label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.3rem;
}

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: 2rem 1.5rem;
  text-align: center;
}

footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

footer .social-links { display: flex; gap: 1.2rem; }
footer .social-links a { color: var(--muted); border-bottom: none; transition: color 0.15s; }
footer .social-links a:hover { color: var(--blue); text-decoration: none; }

/* ─── About page side photos ────────────────────────────── */
.side-photo {
  display: none;
  position: absolute;
  width: 200px;
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 4px;
  box-shadow: 0 8px 18px -8px rgba(35, 35, 31, 0.35);
}

@media (min-width: 1360px) {
  .side-photo { display: block; }
}

.side-photo-talk {
  width: 230px;
  right: -255px;
  top: 400px;
}

.side-photo-hiking {
  left: -245px;
  top: 140px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { display: none; }
  .quick-links { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .research-figure.inset,
  .research-figure.inset-left { float: none; width: 100%; margin: 1rem 0; }
  nav ul { gap: 1rem; }
}
