/* =============================================
   Root variables & reset
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg:           #f9fafa;
  --surface:      #ffffff;
  --border:       #dce8e4;
  --text:         #1c2b2b;
  --text-muted:   #5a7070;
  --green:        #2d6a4f;
  --green-dark:   #1b4332;
  --green-light:  #eaf4f0;
  --blue:         #1e5f8a;
  --blue-light:   #e8f1f8;
  --accent:       #52b788;

  --font-serif:   'Lora', Georgia, serif;
  --font-sans:    'Inter', system-ui, sans-serif;

  --radius:       6px;
  --max-width:    860px;
  --nav-height:   64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* =============================================
   Typography
   ============================================= */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

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

/* =============================================
   Layout utilities
   ============================================= */

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

.section {
  padding: 3rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* =============================================
   Navigation
   ============================================= */

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-dark);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--green);
  text-decoration: none;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
  border-bottom-color: var(--green);
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* =============================================
   Hero / Home
   ============================================= */

.hero {
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.hero-photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--green-light);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.hero-name {
  font-size: 2.4rem;
  margin-bottom: 0.25rem;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.hero-institution {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}

.btn-outline:hover {
  background: var(--green-light);
  color: var(--green-dark);
  text-decoration: none;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.btn-blue:hover {
  background: #174e75;
  border-color: #174e75;
  color: #fff;
  text-decoration: none;
}

/* =============================================
   Research interests (homepage)
   ============================================= */

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

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

.interest-card h4 {
  color: var(--green-dark);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.interest-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Highlighted current interest — spans the full grid width */
.interest-card-feature {
  grid-column: 1 / -1;
  background: var(--green-light);
  border-color: var(--accent);
}

/* =============================================
   Section headings
   ============================================= */

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-heading h2 {
  font-size: 1.5rem;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =============================================
   Publications & Research
   ============================================= */

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-item {
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  border-left: 3px solid var(--green-light);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pub-item:hover {
  border-left-color: var(--green);
}

.pub-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.pub-venue {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.pub-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-green {
  background: var(--green-light);
  color: var(--green-dark);
}

.tag-blue {
  background: var(--blue-light);
  color: var(--blue);
}

.pub-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue);
}

.pub-link:hover {
  color: var(--green);
}

/* Research projects */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.project-item h3 {
  color: var(--green-dark);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =============================================
   Resume / CV
   ============================================= */

.cv-download {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--green-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}

.cv-download p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.cv-section {
  margin-bottom: 2.5rem;
}

.cv-section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  border-bottom: 1.5px solid var(--green-light);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
  align-items: start;
}

.cv-entry-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.cv-entry-org {
  font-size: 0.875rem;
  color: var(--green);
  font-weight: 500;
}

.cv-entry-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

.cv-entry-desc {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cv-entry-desc ul {
  padding-left: 1.25rem;
}

.cv-entry-desc li {
  margin-bottom: 0.2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.skill-item {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* =============================================
   Timeline (CV page)
   ============================================= */

.timeline {
  position: relative;
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

/* The vertical spine, faded at both ends */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -1.5px;
  width: 3px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(45, 106, 79, 0) 0%,
    var(--green) 6%,
    var(--green) 94%,
    rgba(45, 106, 79, 0) 100%
  );
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 2.5rem;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item.tl-left {
  left: 0;
  text-align: right;
}

.timeline-item.tl-right {
  left: 50%;
  text-align: left;
}

/* Marker dot sitting on the spine */
.timeline-item::before {
  content: '';
  position: absolute;
  top: 1.1rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--green);
  z-index: 2;
}

.timeline-item.tl-left::before {
  right: -6.5px;
}

.timeline-item.tl-right::before {
  left: -6.5px;
}

.timeline-card {
  position: relative;
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-align: left;
  max-width: 100%;
}

/* Little arrow pointing back toward the spine */
.timeline-card::after {
  content: '';
  position: absolute;
  top: 0.9rem;
  border: 7px solid transparent;
}

.tl-left .timeline-card::after {
  left: 100%;
  border-left-color: var(--border);
}

.tl-right .timeline-card::after {
  right: 100%;
  border-right-color: var(--border);
}

.timeline-org {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.3;
}

.timeline-role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 0.15rem;
}

.timeline-detail {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.timeline-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.3rem;
}

/* Education entries use the blue accent to distinguish them from roles */
.timeline-item.tl-edu::before {
  border-color: var(--blue);
}

.timeline-item.tl-edu .timeline-org {
  color: var(--blue);
}

.timeline-item.tl-edu .timeline-date {
  color: var(--green);
}

.timeline-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-legend span::before {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--green);
}

.timeline-legend .legend-edu::before {
  border-color: var(--blue);
}

/* Collapse to a single left-aligned column on narrow screens */
@media (max-width: 700px) {
  .timeline::before {
    left: 6px;
    margin-left: 0;
  }

  .timeline-item,
  .timeline-item.tl-left,
  .timeline-item.tl-right {
    width: 100%;
    left: 0;
    padding: 0 0 0 2rem;
    text-align: left;
  }

  .timeline-item.tl-left::before,
  .timeline-item.tl-right::before {
    left: 0;
    right: auto;
  }

  .timeline-card {
    display: block;
  }

  .tl-left .timeline-card::after,
  .tl-right .timeline-card::after {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: var(--border);
  }
}

.cv-attribution {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =============================================
   Contact page
   ============================================= */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green-dark);
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

input, textarea {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.15s;
  width: 100%;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

/* =============================================
   Footer
   ============================================= */

footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-links a:hover {
  color: var(--green);
  text-decoration: none;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-photo,
  .hero-photo-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }

  .hero-content {
    text-align: center;
  }

  .hero-links {
    justify-content: center;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cv-entry {
    grid-template-columns: 1fr;
  }

  .cv-entry-date {
    text-align: left;
    order: -1;
    color: var(--green);
    font-weight: 500;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* =============================================
   Print styles for the CV page
   Makes resume.html print cleanly from the browser. The downloadable
   assets/bachmann_cv.pdf is Annalyn's own export, not generated from this.
   ============================================= */

@media print {
  nav,
  footer,
  .cv-download,
  .cv-attribution,
  .timeline-legend {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 10.5pt;
  }

  main {
    padding: 0;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .hero {
    padding: 0 0 0.5rem;
  }

  /* No break-inside:avoid here — sections are taller than a page and
     would be pushed whole onto a fresh page, leaving big gaps. */
  .cv-section {
    margin-bottom: 1.25rem;
  }

  .cv-section-title {
    break-after: avoid;
  }

  .cv-entry,
  .pub-item,
  .timeline-item {
    break-inside: avoid;
  }

  /* Single-column timeline prints far more legibly than the alternating layout */
  .timeline::before {
    left: 6px;
    margin-left: 0;
  }

  .timeline-item,
  .timeline-item.tl-left,
  .timeline-item.tl-right {
    width: 100%;
    left: 0;
    padding: 0 0 0 2rem;
    text-align: left;
    margin-bottom: 0.9rem;
  }

  .timeline-item.tl-left::before,
  .timeline-item.tl-right::before {
    left: 0;
    right: auto;
  }

  .timeline-card {
    display: block;
    border-color: #ccc;
  }

  .tl-left .timeline-card::after,
  .tl-right .timeline-card::after {
    display: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
