/* ============================================================
   Aaron S. Nelson — Site stylesheet
   Clean, professional academic style.
   Shared design tokens, typography, navigation, and components
   used across index, cv, research, teaching, contact pages.
   ============================================================ */

:root {
  /* Neutrals */
  --ink: #1c1c1c;          /* primary text */
  --ink-soft: #5a5a5a;     /* secondary text */
  --ink-faint: #8a8a8a;    /* meta / captions */

  --paper: #ffffff;        /* page background */
  --paper-deep: #f5f5f2;   /* alternating section band */
  --paper-bright: #fafafa; /* subtle card fill */

  /* Accent — a restrained academic blue.
     To use UTEP colors instead, change --terra to #ff8200 (orange)
     or #041e42 (navy) and adjust --terra-deep to match. */
  --terra: #1f5c99;        /* links / accent */
  --terra-deep: #16436f;   /* hover / deep accent */
  --sage: #4f6b52;         /* secondary status color */
  --ochre: #9a6a1f;        /* tertiary status color */

  --rule: #e0e0da;         /* borders / dividers */
  --rule-soft: #ececE6;    /* faint dividers */
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 24px -14px rgba(0,0,0,0.18);

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --measure: 720px;        /* comfortable reading width */
  --shell: 960px;          /* main content width */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--terra); color: #fff; }

a { color: var(--terra); }
a:hover { color: var(--terra-deep); }

/* Neutralize the old decorative inline fonts site-wide so pages
   read cleanly without editing every inline style. */
[style*="Fraunces"] { font-family: var(--serif) !important; }
[style*="JetBrains"] { font-family: var(--sans) !important; }

/* ----------------------- NAV ----------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav.scrolled { box-shadow: 0 1px 0 rgba(0,0,0,0.02); }
.nav-mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.nav-mark:hover { color: var(--ink); }
.nav-mark-dot { display: none; }
.nav-links {
  display: flex; gap: 28px; list-style: none;
  font-family: var(--sans);
  font-size: 15px; letter-spacing: 0;
}
.nav-links a {
  color: var(--ink-soft); text-decoration: none;
  padding: 4px 0; position: relative;
  transition: color 160ms ease;
}
.nav-links a::after {
  content: ""; position: absolute;
  left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--terra); transition: width 200ms ease;
}
.nav-links a:hover { color: var(--terra); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--ink); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule);
  padding: 8px 12px; cursor: pointer;
  font-family: var(--sans);
  font-size: 14px; color: var(--ink); border-radius: 4px;
}
@media (max-width: 720px) {
  .nav { padding: 14px 20px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    max-height: 0; overflow: hidden;
    transition: max-height 300ms ease;
  }
  .nav.open .nav-links { max-height: 420px; }
  .nav-links li { border-top: 1px solid var(--rule-soft); }
  .nav-links a { display: block; padding: 15px 20px; }
}

/* ----------------------- HOMEPAGE ----------------------- */
.home {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 64px 32px 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  align-items: start;
}
@media (max-width: 780px) {
  .home { grid-template-columns: 1fr; gap: 36px; padding: 40px 20px 8px; }
}
.home-kicker {
  font-family: var(--sans);
  font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 10px;
}
.home-name {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 52px);
  line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 600; color: var(--ink);
  margin-bottom: 14px;
}
.home-affil {
  font-size: 17px; line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.home-bio p {
  font-size: 18px; line-height: 1.7;
  margin-bottom: 16px; max-width: var(--measure);
}
.home-links {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin-top: 26px;
  font-family: var(--sans); font-size: 15px;
}
.home-links a {
  text-decoration: none; color: var(--terra);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 160ms ease;
}
.home-links a:hover { border-bottom-color: var(--terra); }

.home-aside { position: relative; }
.portrait {
  width: 100%; aspect-ratio: 4/5;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-placeholder {
  font-family: var(--sans);
  font-size: 12px; line-height: 1.6; text-align: center;
  color: var(--ink-faint); padding: 22px;
}
.home-facts {
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 14px; line-height: 1.5;
}
.home-facts dt {
  color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 11px; font-weight: 600;
  margin-top: 14px;
}
.home-facts dd { color: var(--ink); }
.home-facts dd a { color: var(--terra); text-decoration: none; }
.home-facts dd a:hover { text-decoration: underline; }

.home-section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 28px 32px;
}
@media (max-width: 780px) { .home-section { padding: 20px 20px; } }
.section-heading {
  font-family: var(--serif);
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
  padding-bottom: 10px; margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.interest-list {
  list-style: none; columns: 2; column-gap: 40px;
  max-width: var(--measure);
}
@media (max-width: 560px) { .interest-list { columns: 1; } }
.interest-list li {
  padding: 6px 0 6px 18px; position: relative;
  break-inside: avoid;
}
.interest-list li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terra);
}
.pub-list { list-style: none; max-width: var(--measure); }
.pub-list li {
  padding: 14px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 17px; line-height: 1.5;
}
.pub-list li:last-child { border-bottom: none; }
.pub-list .venue { font-style: italic; color: var(--ink-soft); }
.pub-list a { color: var(--terra); text-decoration: none; }
.pub-list a:hover { text-decoration: underline; }
.more-link {
  font-family: var(--sans); font-size: 15px;
  text-decoration: none; color: var(--terra);
  display: inline-block; margin-top: 14px;
}
.more-link:hover { text-decoration: underline; }

/* ----------------------- PAGE HEADER (inner pages) ----------------------- */
.page-header {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 56px 32px 28px;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 768px) { .page-header { padding: 36px 20px 22px; } }
.page-header .eyebrow {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 14px;
}
.page-header .eyebrow::before { content: none; }
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 600;
  color: var(--ink);
  max-width: 900px;
}
.page-header h1 em { font-style: italic; color: var(--ink); }
.page-header .lede {
  font-size: 19px;
  color: var(--ink-soft); line-height: 1.6;
  margin-top: 18px; max-width: var(--measure); font-weight: 400;
}
.page-header .lede em { font-style: italic; color: var(--ink); }

/* ----------------------- SECTIONS ----------------------- */
section { padding: 40px 32px; position: relative; }
@media (max-width: 768px) { section { padding: 30px 20px; } }
section.tight { padding: 32px 32px; }
@media (max-width: 768px) { section.tight { padding: 24px 20px; } }

.section-label {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 20px;
}
.section-label::before { content: none; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.15; letter-spacing: -0.01em; font-weight: 600;
  color: var(--ink);
  margin-bottom: 28px; max-width: 900px;
}
.section-title em { font-style: italic; color: var(--ink); }
.container { max-width: var(--shell); margin: 0 auto; }
.container-narrow { max-width: var(--measure); margin: 0 auto; }

/* ----------------------- ABOUT (legacy home helpers) ----------------------- */
.about-grid {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 48px; align-items: start;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}
.about-portrait {
  width: 100%; aspect-ratio: 4/5;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-portrait-placeholder {
  font-family: var(--sans);
  font-size: 12px; color: var(--ink-faint);
  text-align: center; padding: 22px; line-height: 1.6;
}
.about-prose p {
  font-size: 18px; line-height: 1.7; margin-bottom: 16px; color: var(--ink);
}

/* ----------------------- TIMELINE ----------------------- */
.timeline { border-left: 2px solid var(--rule); padding-left: 24px; position: relative; }
.timeline-item { margin-bottom: 24px; position: relative; }
.timeline-item::before {
  content: ""; position: absolute;
  left: -30px; top: 9px;
  width: 9px; height: 9px;
  border: 2px solid var(--terra); background: var(--paper);
  border-radius: 50%;
}
.timeline-year {
  font-family: var(--sans);
  font-size: 13px; color: var(--ink-faint);
  letter-spacing: 0.02em; margin-bottom: 3px;
}
.timeline-title {
  font-family: var(--serif);
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.3; color: var(--ink);
}
.timeline-place { font-style: italic; color: var(--ink-soft); font-size: 16px; margin-top: 2px; }

/* ----------------------- PAPER CARDS (Research) ----------------------- */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--rule);
  margin-bottom: 8px; flex-wrap: wrap;
}
.tab {
  background: none; border: none; padding: 12px 20px;
  font-family: var(--sans);
  font-size: 15px; color: var(--ink-soft);
  cursor: pointer; position: relative;
  transition: color 160ms ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 600; }
.tab::after {
  content: ""; position: absolute;
  left: 20px; right: 20px; bottom: -1px;
  height: 2px; background: var(--terra);
  transform: scaleX(0); transform-origin: left;
  transition: transform 200ms ease;
}
.tab.active::after { transform: scaleX(1); }
.tab-count {
  display: inline-block; margin-left: 6px;
  font-size: 12px; color: var(--ink-faint); vertical-align: super;
}

.paper {
  padding: 26px 0; border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 64px 1fr;
  gap: 24px; align-items: start;
}
@media (max-width: 768px) {
  .paper { grid-template-columns: 48px 1fr; gap: 14px; padding: 22px 0; }
}
.paper-year {
  font-family: var(--sans); font-size: 14px;
  color: var(--ink-faint); padding-top: 4px;
}
.paper-body { min-width: 0; }
.paper-title {
  font-family: var(--serif);
  font-size: 21px; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 8px; color: var(--ink);
}
.paper-venue { font-style: italic; color: var(--ink-soft); font-size: 16px; margin-bottom: 4px; }
.paper-venue strong { font-style: normal; font-weight: 600; color: var(--ink); }
.paper-coauthors {
  font-family: var(--sans); font-size: 14px;
  color: var(--ink-soft); margin-bottom: 8px;
}
.paper-status {
  display: inline-block; padding: 3px 10px; border-radius: 3px;
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px; margin-right: 8px;
}
.status-published { background: #e8efe9; color: var(--sage); }
.status-accepted { background: #f3ecdd; color: var(--ochre); }
.status-review { background: #f3ecdd; color: var(--ochre); }
.status-working { background: #e7eff6; color: var(--terra); }
.status-practitioner { background: #eeeeea; color: var(--ink-soft); }

.paper-summary {
  font-size: 16px; color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  max-width: var(--measure);
}
.paper-summary em { font-style: italic; color: var(--ink); }
.paper-actions {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; align-items: center;
}
.paper-link {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--terra); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
  display: inline-flex; align-items: center; gap: 5px;
}
.paper-link:hover { border-bottom-color: var(--terra); }
.paper-link::after { content: "↓"; font-size: 13px; }
.paper-link.external::after { content: "↗"; }
.paper-doi { font-family: var(--sans); font-size: 13px; color: var(--ink-faint); }
.paper-doi a { color: var(--terra); text-decoration: none; }
.paper-doi a:hover { text-decoration: underline; }

/* ----------------------- CV PAGE ----------------------- */
.cv-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 14px; letter-spacing: 0;
  text-decoration: none;
  border-radius: 4px;
  transition: all 160ms ease;
  cursor: pointer; border: 1px solid var(--terra);
}
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-deep); border-color: var(--terra-deep); color: #fff; }
.btn-secondary { background: transparent; color: var(--terra); }
.btn-secondary:hover { background: var(--terra); color: #fff; }

.cv-section { margin-bottom: 44px; }
.cv-section-label {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.cv-entry { padding: 12px 0; }
.cv-entry + .cv-entry { border-top: 1px solid var(--rule-soft); }
.cv-entry-row {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 20px; align-items: baseline;
}
@media (max-width: 700px) {
  .cv-entry-row { grid-template-columns: 1fr; gap: 4px; }
}
.cv-entry-meta {
  font-family: var(--sans);
  font-size: 14px; color: var(--ink-faint);
}
.cv-entry-title {
  font-family: var(--serif);
  font-size: 18px; line-height: 1.35; font-weight: 600; color: var(--ink);
}
.cv-entry-detail { color: var(--ink-soft); font-size: 16px; margin-top: 4px; font-style: italic; }
.cv-entry-citation { font-size: 17px; line-height: 1.55; color: var(--ink); }
.cv-entry-citation .venue { font-style: italic; color: var(--ink-soft); }
.cv-entry-citation a { color: var(--terra); text-decoration: none; }
.cv-entry-citation a:hover { text-decoration: underline; }
.cv-list {
  list-style: none; padding-left: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.cv-list li {
  font-size: 17px; line-height: 1.55;
  padding-left: 18px; position: relative;
}
.cv-list li::before {
  content: ""; position: absolute; left: 2px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--terra);
}
.cv-pillrow { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-pill {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0;
  padding: 5px 12px; border: 1px solid var(--rule); border-radius: 20px;
  background: var(--paper-bright); color: var(--ink-soft);
}

/* ----------------------- TEACHING PAGE ----------------------- */
.teaching-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.course {
  background: var(--paper); padding: 24px;
  transition: background 200ms ease;
  min-height: 150px;
  display: flex; flex-direction: column;
}
.course:hover { background: var(--paper-bright); }
.course-code {
  font-family: var(--sans); font-size: 13px;
  letter-spacing: 0.04em; color: var(--terra); font-weight: 600;
  margin-bottom: 10px;
}
.course-title {
  font-family: var(--serif);
  font-size: 19px; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.01em; margin-bottom: 12px; flex-grow: 1; color: var(--ink);
}
.course-level { font-size: 14px; color: var(--ink-soft); font-style: italic; }
.teaching-subsection { margin-top: 44px; }
.teaching-subsection-label {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.teaching-prose p {
  font-size: 18px; line-height: 1.7;
  margin-bottom: 16px; color: var(--ink);
  max-width: var(--measure);
}
.teaching-prose p.lead {
  font-size: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  border-left: 3px solid var(--terra);
  padding-left: 20px;
  margin-bottom: 28px;
}
.teaching-prose p em { font-style: italic; color: var(--ink); }
.teaching-prose h3 { color: var(--ink); }

/* Pull-quote / award callout */
.callout {
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--terra);
  padding: 22px 26px; border-radius: 3px;
  margin: 28px 0; max-width: var(--measure);
  position: relative;
}
.callout::before { content: none; }
.callout-eyebrow {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
  margin-bottom: 8px;
}
.callout-text {
  font-family: var(--serif);
  font-size: 20px; line-height: 1.4; font-weight: 600; color: var(--ink);
}

/* ----------------------- CONTACT PAGE ----------------------- */
.contact-section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 56px 32px 24px;
}
@media (max-width: 768px) { .contact-section { padding: 36px 20px 16px; } }
.contact-section .eyebrow {
  font-family: var(--sans);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--terra); font-weight: 600; margin-bottom: 14px;
}
.contact-section .eyebrow::before { content: none; }
.contact-section h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 46px) !important;
  line-height: 1.08 !important; letter-spacing: -0.02em !important;
  font-weight: 600 !important; color: var(--ink);
}
.contact-section h1 em { font-style: italic; color: var(--ink); }
.contact-section .lede { color: var(--ink-soft); font-weight: 400 !important; }
.contact-section .lede em { color: var(--ink); }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px; margin-top: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.contact-item-label {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-bottom: 10px;
}
.contact-item-value {
  font-family: var(--serif);
  font-size: 19px; line-height: 1.4; color: var(--ink);
}
.contact-item-value a { color: var(--terra); text-decoration: none; }
.contact-item-value a:hover { text-decoration: underline; }
.contact-item-detail {
  font-family: var(--serif);
  font-size: 16px; line-height: 1.5;
  color: var(--ink-soft);
}

/* Light contact strip (home footer band) */
.contact-strip {
  max-width: var(--shell); margin: 0 auto;
  border-top: 1px solid var(--rule);
  padding: 40px 32px 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
@media (max-width: 768px) { .contact-strip { padding: 30px 20px 16px; } }
.contact-strip .contact-item-label { color: var(--ink-faint); }
.contact-strip .contact-item-value { font-size: 18px; color: var(--ink); }
.contact-strip .contact-item-value a { color: var(--terra); }

/* ----------------------- FOOTER ----------------------- */
.site-footer {
  max-width: var(--shell); margin: 0 auto;
  padding: 28px 32px;
  font-family: var(--sans);
  font-size: 14px; color: var(--ink-faint);
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
}

/* Generic prose */
.prose p {
  font-size: 18px; line-height: 1.7; color: var(--ink);
  margin-bottom: 16px; max-width: var(--measure);
}
.prose p em { font-style: italic; }
.prose h3 {
  font-family: var(--serif);
  font-size: 24px; line-height: 1.25; letter-spacing: -0.01em;
  font-weight: 600;
  margin-top: 36px; margin-bottom: 14px;
}
