/* Neil Beckwith — personal site
   Calm science-portfolio theme; light with dark-mode support */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1c2421;
  --muted: #4a5652;
  --header-bg: #ffffff;
  --border: #d8ddd8;
  --accent: #1f6b5c;
  --accent-hover: #165247;
  --accent-soft: #e6f2ee;
  --accent-contrast: #ffffff;
  --link: #1f6b5c;
  --focus: #c9a227;
  --page-wash: linear-gradient(180deg, #f7f5f1 0%, #f7f5f1 100%);
  --bg-elevated: var(--surface);
  --text-muted: var(--muted);
  --max: 44rem;
  --nav-max: 58rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 36, 33, 0.06), 0 8px 24px rgba(28, 36, 33, 0.04);
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121816;
    --surface: #1a221f;
    --text: #e8ece9;
    --muted: #a3aea9;
    --header-bg: #17201d;
    --border: #2e3a35;
    --accent: #72c4b0;
    --accent-hover: #94d9c6;
    --accent-soft: #1e332e;
    --accent-contrast: #10201b;
    --link: #7ed0ba;
    --focus: #e0b84a;
    --page-wash: linear-gradient(180deg, #121816 0%, #121816 100%);
    --bg-elevated: var(--surface);
    --text-muted: var(--muted);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}


/* Per-page nature palettes. Surfaces stay opaque and calm so text, cards, and photos remain readable. */
body.theme-sky {
  --bg: #edf7fb;
  --surface: #ffffff;
  --text: #163047;
  --muted: #405b6c;
  --header-bg: #f9fcfd;
  --border: #bfd5df;
  --accent: #17698f;
  --accent-hover: #0f4d6c;
  --accent-soft: #dcedf4;
  --accent-contrast: #ffffff;
  --link: #17698f;
  --focus: #9a5b00;
  --page-wash: radial-gradient(circle at 84% 4%, rgba(255, 255, 255, 0.85) 0 4.5rem, transparent 4.8rem), radial-gradient(circle at 72% 7%, rgba(255, 255, 255, 0.58) 0 3.2rem, transparent 3.5rem), linear-gradient(180deg, #d9effa 0, #edf7fb 19rem, #edf7fb 100%);
  --nature-art: url("../assets/svg/sky-silhouettes.svg");
}

body.theme-forest {
  --bg: #eef5ed;
  --surface: #fffefd;
  --text: #183326;
  --muted: #426051;
  --header-bg: #f7fbf6;
  --border: #c4d7c6;
  --accent: #216b49;
  --accent-hover: #164e36;
  --accent-soft: #e0eee1;
  --accent-contrast: #ffffff;
  --link: #216b49;
  --focus: #8b5700;
  --page-wash: radial-gradient(circle at 8% 5%, rgba(111, 157, 113, 0.14) 0 4rem, transparent 4.2rem), radial-gradient(circle at 93% 15%, rgba(76, 126, 84, 0.1) 0 5rem, transparent 5.2rem), linear-gradient(180deg, #e2efe2 0, #eef5ed 20rem, #eef5ed 100%);
  --nature-art: url("../assets/svg/forest-silhouettes.svg");
}

body.theme-ocean {
  --bg: #eaf5f7;
  --surface: #fbfefe;
  --text: #123444;
  --muted: #3f5d68;
  --header-bg: #f6fcfd;
  --border: #b8d6db;
  --accent: #126b78;
  --accent-hover: #0d4d59;
  --accent-soft: #d9eff1;
  --accent-contrast: #ffffff;
  --link: #126b78;
  --focus: #8e5600;
  --page-wash: radial-gradient(ellipse at 88% 2%, rgba(100, 190, 194, 0.18) 0 5rem, transparent 5.3rem), radial-gradient(ellipse at 14% 12%, rgba(255, 255, 255, 0.6) 0 7rem, transparent 7.4rem), linear-gradient(180deg, #d9f0f2 0, #eaf5f7 21rem, #eaf5f7 100%);
  --nature-art: url("../assets/svg/ocean-silhouettes.svg");
}

body.theme-snow {
  --bg: #f1f5f8;
  --surface: #ffffff;
  --text: #1d2d3a;
  --muted: #536674;
  --header-bg: #fafeff;
  --border: #c9d6df;
  --accent: #2b6387;
  --accent-hover: #204b67;
  --accent-soft: #e4eff5;
  --accent-contrast: #ffffff;
  --link: #2b6387;
  --focus: #8a5200;
  --page-wash: radial-gradient(ellipse at 16% 5%, rgba(255, 255, 255, 0.95) 0 5rem, transparent 5.3rem), radial-gradient(ellipse at 86% 4%, rgba(196, 220, 235, 0.26) 0 6rem, transparent 6.4rem), linear-gradient(180deg, #e7f0f7 0, #f1f5f8 22rem, #f1f5f8 100%);
  --nature-art: url("../assets/svg/snow-silhouettes.svg");
}

body.theme-alpine {
  --bg: #f2f0f7;
  --surface: #fffdfc;
  --text: #2a2940;
  --muted: #5d5a72;
  --header-bg: #fbfaff;
  --border: #d2d0df;
  --accent: #53698f;
  --accent-hover: #3d4f76;
  --accent-soft: #e7e5f2;
  --accent-contrast: #ffffff;
  --link: #53698f;
  --focus: #9a5d00;
  --page-wash: radial-gradient(ellipse at 86% 3%, rgba(119, 178, 178, 0.2) 0 5rem, transparent 5.3rem), radial-gradient(ellipse at 12% 4%, rgba(139, 122, 177, 0.18) 0 6rem, transparent 6.4rem), linear-gradient(180deg, #e8e4f2 0, #f2f0f7 21rem, #f2f0f7 100%);
  --nature-art: url("../assets/svg/alpine-silhouettes.svg");
}

@media (prefers-color-scheme: dark) {
  body {
    --nature-filter: invert(1);
  }

  body.theme-sky {
    --bg: #142832;
    --surface: #1b3541;
    --text: #e6f3f8;
    --muted: #aec4cd;
    --header-bg: #182f3a;
    --border: #355461;
    --accent: #79c7e1;
    --accent-hover: #a0dced;
    --accent-soft: #214554;
    --accent-contrast: #10242c;
    --link: #83d1e8;
    --focus: #edc66a;
    --page-wash: radial-gradient(circle at 84% 4%, rgba(145, 207, 226, 0.14) 0 4.5rem, transparent 4.8rem), linear-gradient(180deg, #10232d 0, #142832 20rem, #142832 100%);
  }

  body.theme-forest {
    --bg: #142119;
    --surface: #1c3023;
    --text: #e9f4ea;
    --muted: #b3c8b7;
    --header-bg: #182a1e;
    --border: #36523d;
    --accent: #83cf9a;
    --accent-hover: #a5dfb4;
    --accent-soft: #284633;
    --accent-contrast: #102017;
    --link: #8bd6a1;
    --focus: #edc66a;
    --page-wash: radial-gradient(circle at 8% 5%, rgba(122, 183, 130, 0.15) 0 4rem, transparent 4.2rem), linear-gradient(180deg, #13271b 0, #142119 20rem, #142119 100%);
  }

  body.theme-ocean {
    --bg: #10262f;
    --surface: #173944;
    --text: #e4f4f6;
    --muted: #afc9cd;
    --header-bg: #142f39;
    --border: #315964;
    --accent: #71d0d0;
    --accent-hover: #9ae3df;
    --accent-soft: #204b54;
    --accent-contrast: #102529;
    --link: #7cdddc;
    --focus: #edc66a;
    --page-wash: radial-gradient(ellipse at 88% 2%, rgba(86, 191, 190, 0.18) 0 5rem, transparent 5.3rem), linear-gradient(180deg, #0d242d 0, #10262f 21rem, #10262f 100%);
  }

  body.theme-snow {
    --bg: #17232d;
    --surface: #22333f;
    --text: #edf5f9;
    --muted: #bacbd4;
    --header-bg: #1d2d38;
    --border: #405663;
    --accent: #8dc9e8;
    --accent-hover: #b1ddf1;
    --accent-soft: #2b4655;
    --accent-contrast: #12232d;
    --link: #9ad5ed;
    --focus: #edc66a;
    --page-wash: radial-gradient(ellipse at 16% 5%, rgba(215, 238, 249, 0.18) 0 5rem, transparent 5.3rem), linear-gradient(180deg, #172a37 0, #17232d 22rem, #17232d 100%);
  }

  body.theme-alpine {
    --bg: #211f31;
    --surface: #302e43;
    --text: #f0eef9;
    --muted: #c3bfd4;
    --header-bg: #29273b;
    --border: #4a4760;
    --accent: #aab7e4;
    --accent-hover: #c8d0f0;
    --accent-soft: #413f5d;
    --accent-contrast: #1d2130;
    --link: #b8c5ee;
    --focus: #edc66a;
    --page-wash: radial-gradient(ellipse at 86% 3%, rgba(108, 189, 187, 0.18) 0 5rem, transparent 5.3rem), linear-gradient(180deg, #27243c 0, #211f31 21rem, #211f31 100%);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--page-wash);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* Theme-specific silhouettes sit behind content and never intercept interaction. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--nature-art), var(--nature-art);
  background-position: center top, center bottom;
  background-size: 100% 14rem, 100% 15rem;
  background-repeat: no-repeat;
  opacity: 0.82;
  filter: var(--nature-filter, none);
}

body > * {
  position: relative;
  z-index: 1;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

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

a:focus-visible,
button:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header / nav */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-header::after,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--nature-art) center bottom / 100% 12rem no-repeat;
  opacity: 0.76;
  filter: var(--nature-filter, none);
}

.header-inner,
.footer-inner {
  position: relative;
  z-index: 1;
}

.header-inner {
  max-width: var(--nav-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-title:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav ul {
    flex-direction: column;
    padding: 0.25rem 0 0.5rem;
    width: 100%;
  }

  .site-nav a {
    padding: 0.65rem 0.75rem;
  }
}

/* Main layout */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 38rem;
}

.meta-line {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0.35rem 0 0;
}

/* Cards / sections */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card h2,
section h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
}

.card h3,
.job h3,
.edu h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.section-gap {
  margin-top: 2.25rem;
}

ul.clean {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

ul.clean li {
  margin-bottom: 0.4rem;
}

ul.clean li:last-child {
  margin-bottom: 0;
}

/* Home hero */
.hero {
  margin-bottom: 2rem;
}

.hero p {
  margin: 0 0 1rem;
}

.hero-with-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
}

.hero-photo {
  width: clamp(7rem, 24vw, 10rem);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--bg-elevated);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.photo-grid-dense {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.photo-grid-dense img {
  border-radius: 6px;
}

.photo-grid figure {
  margin: 0;
  min-width: 0;
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
}

.photo-grid figcaption {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* Resume */
.resume-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.resume-headshot {
  width: 5.25rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.resume-contact a {
  color: var(--link);
}

.job,
.edu {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.job:last-child,
.edu:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.job:first-of-type,
.edu:first-of-type {
  padding-top: 0.25rem;
}

.job-meta,
.edu-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.print-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Ideas */
.idea-block {
  margin-bottom: 1.5rem;
}

.idea-block p:last-child {
  margin-bottom: 0;
}

.highlight-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  padding: 1.25rem 1.25rem 1.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.footer-inner {
  max-width: var(--nav-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer a {
  color: var(--link);
}

@media (max-width: 520px) {
  .hero-with-photo {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    width: 7.5rem;
  }

  .resume-heading {
    align-items: start;
  }

  .photo-grid,
  .photo-grid.photo-grid-dense {
    grid-template-columns: 1fr;
  }
}

/* Print */
@media print {
  body::before,
  .site-header::after,
  .site-footer::before,
  .skip-link,
  .site-header,
  .site-footer,
  .nav-toggle,
  .cta-row,
  .print-note,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
  }

  .page-header h1 {
    font-size: 18pt;
  }

  h2 {
    font-size: 13pt;
    margin-top: 1rem;
  }
}

/* Research-card cites & science-lane headings */
.cite-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0;
  line-height: 1.55;
}

.cite-line a {
  color: var(--link);
}

.lane-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.lane-intro {
  color: var(--text-muted);
  margin: 0 0 1.15rem;
  max-width: 40rem;
}

.lane-block .card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.65rem;
}

.page-toc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.75rem;
}

.page-toc a {
  color: var(--link);
}

.hero-portrait,
.resume-portrait {
  margin: 0;
  text-align: center;
}
.hero-portrait figcaption,
.resume-portrait figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted, #5a6570);
  max-width: 12rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.3;
}
