/* ============================================================
   Nathan Seegert — editorial academic site
   ============================================================ */

:root {
  --ink: #17191f;
  --ink-soft: #4a4d57;
  --paper: #f7f4ee;
  --card: #ffffff;
  --line: #e3dcc9;
  --navy: #0f2540;
  --navy-2: #17385f;
  --gold: #a9761f;
  --gold-soft: #f1e6cd;
  --rust: #9c4a2b;
  --gray-soft: #ece8e0;
  --shadow: 0 10px 30px rgba(15, 37, 64, 0.08);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- Top nav ---------------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.topnav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  flex-wrap: nowrap;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-decoration: none;
}

.navlinks {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navlinks a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.navlinks a:hover,
.navlinks a.active {
  background: var(--navy);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  color: var(--navy);
}

/* ---------------- Hero / Profile ---------------- */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
}

.kicker {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--navy);
}

.hero-bio {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 54ch;
  margin: 0 0 26px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 37, 64, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn-ghost:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.hero-email {
  font-size: 14px;
  color: var(--ink-soft);
}
.hero-email a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.hero-email a:hover {
  text-decoration: underline;
}

.hero-photo-frame {
  position: relative;
  justify-self: end;
}

.hero-photo-frame img {
  width: 260px;
  height: 320px;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.hero-photo-frame::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 260px;
  height: 320px;
  border: 2px solid var(--gold);
  border-radius: 10px;
  z-index: 0;
}

.affiliations {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.affil-pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}
.affil-pill:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.affil-pill .role {
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------------- Bio modal ---------------- */

.bio-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.bio-modal.open {
  display: block;
}

.bio-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 37, 64, 0.45);
}

.bio-modal-content {
  position: relative;
  max-width: 560px;
  margin: 12vh auto 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.bio-modal-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--navy);
  margin: 0 0 14px;
}

.bio-modal-content p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

.bio-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.bio-modal-close:hover {
  color: var(--navy);
}

@media (max-width: 700px) {
  .bio-modal-content {
    margin: 8vh 20px 0;
    padding: 26px;
  }
}

/* ---------------- Section chrome ---------------- */

.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 32px;
  margin: 0;
  color: var(--navy);
}

.section-sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: -20px 0 28px;
}

/* ---------------- Research controls ---------------- */

.research-controls {
  margin-bottom: 28px;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 11px 16px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--sans);
}
.search-input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.coauthor-select {
  padding: 11px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--sans);
  min-width: 200px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn .count {
  color: var(--ink-soft);
  font-weight: 500;
}

.tab-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.tab-btn.active .count {
  color: #dfe7f0;
}

.tab-btn:hover:not(.active) {
  border-color: var(--navy);
  color: var(--navy);
}

.tab-btn.featured {
  border-color: var(--gold);
  color: var(--gold);
}
.tab-btn.featured .count {
  color: var(--gold);
}
.tab-btn.featured:hover:not(.active) {
  border-color: var(--gold);
  color: var(--gold);
}
.tab-btn.featured.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.tab-btn.featured.active .count {
  color: #fff8ea;
}

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.topic-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.topic-chip.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.results-count {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ---------------- Paper cards ---------------- */

.papers-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paper-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.paper-card.cat-working {
  border-left-color: var(--ink-soft);
}
.paper-card.cat-revisions {
  border-left-color: var(--gold);
}

.paper-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.paper-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.paper-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.paper-authors {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.paper-authors a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}
.paper-authors a:hover {
  text-decoration: underline;
}

.paper-journal {
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.paper-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.paper-topic-tag {
  font-size: 11.5px;
  font-weight: 600;
  background: var(--gray-soft);
  color: var(--navy);
  padding: 3px 10px;
  border-radius: 999px;
}

.paper-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.paper-actions button,
.paper-actions a.action-link {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.paper-actions button:hover,
.paper-actions a.action-link:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.paper-actions a.action-link.primary {
  background: var(--navy);
  color: #fff;
}
.paper-actions a.action-link.primary:hover {
  background: var(--navy-2);
}

.paper-expand {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}

.paper-expand.open {
  display: block;
}

.paper-expand pre {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  background: var(--paper);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
}

.empty-state {
  color: var(--ink-soft);
  font-size: 15px;
  padding: 24px 0;
}

/* ---------------- Awards ---------------- */

.timeline {
  border-left: 2px solid var(--line);
  margin-left: 6px;
  padding-left: 24px;
}

.timeline-item {
  position: relative;
  margin-bottom: 22px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.timeline-year {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  margin-right: 10px;
}

.timeline-text strong {
  color: var(--rust);
}

/* ---------------- Teaching ---------------- */

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.quote-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px 26px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

.quote-card::before {
  content: "\201C";
  font-family: var(--serif);
  font-size: 32px;
  color: var(--gold);
  display: block;
  line-height: 0.5;
  margin-bottom: 8px;
}

.quote-card::after {
  content: "\201D";
  position: absolute;
  right: 14px;
  bottom: 4px;
  font-family: var(--serif);
  font-size: 32px;
  font-style: normal;
  color: var(--gold);
  line-height: 1;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.course-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.course-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}

.course-score {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.course-score-label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.course-semesters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.course-semesters span {
  font-size: 11.5px;
  background: var(--gray-soft);
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.course-links a {
  display: inline-block;
  margin-right: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.course-links a:hover {
  text-decoration: underline;
}

/* ---------------- Media ---------------- */

.media-category {
  margin-bottom: 28px;
}

.media-category h3 {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 12px;
}

.media-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.media-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.media-list li:last-child {
  border-bottom: none;
}

.media-list a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.media-list a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.media-outlet {
  display: inline-block;
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* ---------------- Code ---------------- */

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.code-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.code-card h3 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--navy);
  margin: 0 0 8px;
}

.code-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gray-soft);
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.code-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 6px 0;
}

.code-card ul {
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.code-card a {
  color: var(--navy);
  font-weight: 600;
}

/* ---------------- Footer ---------------- */

footer {
  padding: 40px 0 60px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}

footer a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo-frame {
    justify-self: start;
    order: -1;
  }
  .hero-photo-frame img,
  .hero-photo-frame::before {
    width: 180px;
    height: 220px;
  }
  .hero h1 {
    font-size: 38px;
  }
}

@media (max-width: 700px) {
  .navlinks {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 20px;
    display: none;
  }
  .navlinks.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .wrap {
    padding: 0 20px;
  }
  .topnav-inner {
    padding: 0 20px;
  }
  .section {
    padding: 44px 0;
  }
  .paper-top {
    flex-direction: column;
  }
}
