/* ============================================================
   Andrew Bridger, personal site
   Typography: Inter (headings / UI) + Source Serif 4 (body)
   Palette: off-white surfaces, charcoal text, deep slate-blue accent
   ============================================================ */

:root {
  /* Colour palette */
  --bg:          #ffffff;
  --surface:     #f6f8fa;
  --ink:         #1a2433;   /* near-charcoal navy, primary text */
  --ink-soft:    #3f4b5b;
  --muted:       #6b7787;   /* secondary text */
  --accent:      #1f4e79;   /* deep slate blue */
  --accent-deep: #14223b;
  --border:      #e6eaef;
  --tag-bg:      #eef2f6;

  /* Type */
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Layout */
  --maxw: 760px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-sans); color: var(--ink); line-height: 1.25; }

/* ============================== NAV ============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav__brand {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.01em;
  color: var(--ink);
}
.nav__brand:hover { color: var(--ink); text-decoration: none; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__links a {
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav__links a:hover { color: var(--accent); text-decoration: none; }
.nav__cv {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .75rem;
  color: var(--accent) !important;
}
.nav__cv:hover { background: var(--surface); border-color: var(--accent); }

/* ============================== HERO ============================== */
.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 4rem;
  padding-bottom: 2.5rem;
}
.hero__text { flex: 1; }
.eyebrow {
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
}
.hero__name {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
}
.hero__lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.hero__meta { color: var(--muted); margin: 0 0 1.5rem; }
.hero__photo { flex-shrink: 0; }
.hero__photo img {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(20, 34, 59, .12);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 500;
}

/* ============================== SECTIONS ============================== */
.section {
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
  border-top: 1px solid var(--border);
}
.section__title {
  font-size: 1.0rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.section__note {
  color: var(--muted);
  margin: -0.75rem 0 1.5rem;
  font-size: 1rem;
}

/* ---------- Research interest tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag {
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .85rem;
}

/* ---------- Research entries ---------- */
.entry { margin-bottom: 2rem; }
.entry:last-child { margin-bottom: 0; }
.entry__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 .3rem;
}
.entry__byline {
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .6rem;
}
.entry__desc { margin: 0 0 .7rem; color: var(--ink-soft); }
.entry__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 500;
}

/* ---------- Plain link list (policy work) ---------- */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  display: flex;
  flex-direction: column;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.link-list li:last-child { border-bottom: none; }
.link-list li > a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.02rem;
}
.link-list__meta {
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--muted);
  margin-top: .15rem;
}

/* ---------- Code cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 .5rem;
}
.card__desc {
  font-size: .98rem;
  color: var(--ink-soft);
  margin: 0 0 .75rem;
}
.card .entry__links { font-size: .88rem; }

/* ---------- Experience / education timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 1.75rem; }
.timeline__item { }
.timeline__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.timeline__role {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0;
}
.timeline__date {
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
}
.timeline__org {
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 500;
  color: var(--accent);
  margin: .15rem 0 .5rem;
}
.timeline__desc { margin: 0; color: var(--ink-soft); }

/* ============================== FOOTER ============================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 1rem;
  padding: 2rem 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--muted);
}
.footer__inner p { margin: 0; }
.footer__links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 500;
}

/* ---------- Legal pages (disclaimer / terms) ---------- */
.legal { max-width: 100%; }
.legal__h {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 .4rem;
}
.legal p {
  color: var(--ink-soft);
  margin: 0 0 .5rem;
}
.legal > p:first-child { margin-top: 0; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 640px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.5rem;
    padding-top: 2.5rem;
  }
  .hero__name { font-size: 2.1rem; }
  .hero__lead { font-size: 1.08rem; }
  .hero__photo img { width: 120px; height: 120px; }

  .nav__links { gap: .9rem; }
  .nav__links li:not(:last-child):not(:nth-last-child(2)) { display: none; }

  .timeline__head { flex-direction: column; gap: .1rem; }
}

@media (max-width: 400px) {
  .nav__links a { font-size: .82rem; }
}
