/* =========================================================================
   Cyr-Racine Research Group -- site stylesheet
   Dark "cosmology" theme. Plain CSS, no build step.

   HOW TO EDIT COLORS: change the variables in :root below.
   HOW TO EDIT LAYOUT WIDTH: change --content-width.
   ========================================================================= */

:root {
  /* ---- palette ---- */
  --bg: #090c14;
  --bg-soft: #0c1120;
  --surface: #121a2c;
  --surface-2: #17203a;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.3);

  --text: #e8ecf6;
  --text-muted: #a0aac2;
  --text-faint: #6c7690;

  --accent: #67e8f9;       /* cyan -- primary accent */
  --accent-2: #a78bfa;     /* violet -- secondary accent */
  --accent-warm: #fbbf6b;  /* warm amber -- badges / news */
  --unm-red: #ba0c2f;      /* UNM Cherry (PMS 200C) -- institutional accent */

  --accent-rgb: 103, 232, 249;
  --accent-2-rgb: 167, 139, 250;

  /* ---- layout ---- */
  --content-width: 1180px;
  --radius: 16px;
  --radius-sm: 10px;

  /* ---- misc ---- */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  --transition: 180ms ease;
}

/* =========================================================================
   Reset
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.55) 0, transparent 60%),
    radial-gradient(1px 1px at 60% 15%, rgba(255,255,255,.4) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 80% 60%, rgba(255,255,255,.5) 0, transparent 60%),
    radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,.35) 0, transparent 60%),
    radial-gradient(1px 1px at 90% 85%, rgba(255,255,255,.4) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 10% 90%, rgba(255,255,255,.3) 0, transparent 60%),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,.25) 0, transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

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

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

ul { margin: 0; padding: 0; }

hr { display: none; }

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================================
   Eyebrow / section headers
   ========================================================================= */

.eyebrow {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6em;
}

.section-head {
  max-width: 720px;
  margin: 0 0 2.5em;
}

.section-head h2 {
  font-size: clamp(1.6em, 2.6vw, 2.1em);
}

.section-head p {
  color: var(--text-muted);
  margin-top: 0.6em;
}

/* =========================================================================
   Header / Nav
   ========================================================================= */

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 12, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--unm-red);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand strong {
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand span {
  font-size: 0.72em;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.92em;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}

.nav-links .current a {
  color: #fff;
  background: var(--unm-red);
}
.nav-links .current a:hover { background: var(--unm-red); }

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}
.nav-toggle-label svg { display: block; }

@media (max-width: 780px) {
  .nav-toggle-label { display: block; }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-soft);
    border-bottom: 0 solid var(--border);
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 220ms ease, padding 220ms ease;
  }

  .nav-links a { padding: 12px 14px; }

  #nav-toggle:checked ~ .nav-links {
    max-height: 420px;
    padding: 10px 20px 18px;
    border-bottom-width: 1px;
  }
}

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

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.32;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9,12,20,0.55) 0%, rgba(9,12,20,0.86) 65%, var(--bg) 100%),
    radial-gradient(60% 90% at 15% 0%, rgba(var(--accent-2-rgb), 0.28), transparent 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 5.5em 0 4em;
}

.hero h1 {
  font-size: clamp(2.1em, 5vw, 3.4em);
  max-width: 15em;
}

.hero .tagline {
  margin-top: 0.6em;
  font-size: clamp(1.05em, 2vw, 1.3em);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 34em;
}

.hero .dept-line {
  margin-top: 1.4em;
  font-size: 0.95em;
  color: var(--text-faint);
}
.hero .dept-line a { color: var(--text-muted); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2.2em;
}

.quote-block {
  margin-top: 3em;
  max-width: 38em;
  padding-left: 1.1em;
  border-left: 2px solid var(--accent-2);
  color: var(--text-muted);
  font-style: italic;
}
.quote-block cite {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-size: 0.85em;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* News strip */
.news-list {
  margin-top: 3em;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 46em;
}

.news-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.94em;
}

.news-tag {
  flex: none;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent-warm);
  padding: 3px 8px;
  border-radius: 999px;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.92em;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #06222a;
}
.btn-primary:hover { transform: translateY(-1px); background: #8beefc; }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================================
   Sections / page shell
   ========================================================================= */

main { display: block; }

.section {
  padding: 4.5em 0;
}

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

.page-head {
  padding: 3.5em 0 2.5em;
  border-bottom: 1px solid var(--border);
}

.page-head .eyebrow { margin-bottom: 0.5em; }

.page-head h1 {
  font-size: clamp(1.9em, 4vw, 2.6em);
}

.page-head p {
  margin-top: 0.7em;
  color: var(--text-muted);
  max-width: 42em;
}

/* =========================================================================
   Cards -- research interests
   ========================================================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 22px 24px 26px; }

.card-body h3 {
  font-size: 1.15em;
  margin-bottom: 0.5em;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.94em;
}

/* =========================================================================
   About / intro block
   ========================================================================= */

.intro {
  max-width: 62em;
  font-size: 1.06em;
  color: var(--text-muted);
}
.intro a { color: var(--accent); }

/* =========================================================================
   Bio / CV page
   ========================================================================= */

.cv-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 820px) {
  .cv-layout { grid-template-columns: 1fr; }
}

.cv-side {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 820px) {
  .cv-side { position: static; flex-direction: row; align-items: center; }
}

.cv-photo {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.cv-photo img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 820px) {
  .cv-photo { width: 130px; max-width: 130px; flex: none; }
}

.cv-side-name h2 { font-size: 1.3em; }
.cv-side-name p { color: var(--text-faint); font-size: 0.9em; margin-top: 0.3em; }

.cv-section { margin-bottom: 2.6em; }
.cv-section:last-child { margin-bottom: 0; }

.cv-section h3 {
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid var(--border);
}

.cv-entries {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 18px;
  font-size: 0.98em;
}

@media (max-width: 560px) {
  .cv-entry { grid-template-columns: 1fr; gap: 2px; }
}

.cv-entry .when {
  color: var(--text-faint);
  font-size: 0.88em;
  font-variant-numeric: tabular-nums;
  padding-top: 0.15em;
}

.cv-entry .what { color: var(--text-muted); }
.cv-entry .what strong { color: var(--text); font-weight: 600; }
.cv-entry .what a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.cv-entry .what a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.press-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.press-list li {
  padding-left: 1.2em;
  position: relative;
  color: var(--text-muted);
}
.press-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.press-list a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.press-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* =========================================================================
   Group members
   ========================================================================= */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

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

.member-card.no-photo { display: flex; flex-direction: column; justify-content: center; min-height: 100%; }

.member-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
.member-photo img { width: 100%; height: 100%; object-fit: cover; }

.member-name { font-size: 1.08em; margin-bottom: 2px; }

.member-role {
  display: inline-block;
  font-size: 0.74em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.member-card p {
  font-size: 0.92em;
  color: var(--text-muted);
}

.member-card p a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); }
.member-card p a:hover { color: var(--accent); }

.group-subhead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 3.2em 0 1.6em;
}
.group-subhead:first-child { margin-top: 0; }
.group-subhead h2 { font-size: 1.4em; }
.group-subhead .count { color: var(--text-faint); font-size: 0.9em; }

.group-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 3em;
}

/* =========================================================================
   Teaching
   ========================================================================= */

.course-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.course-item {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 560px) {
  .course-item { grid-template-columns: 1fr; gap: 4px; }
}

.course-term {
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.course-item a {
  font-size: 1.05em;
  color: var(--text);
  font-weight: 500;
}
.course-item a:hover { color: var(--accent); }

/* =========================================================================
   Publications
   ========================================================================= */

.pub-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 28px;
  box-shadow: var(--shadow-card);
}

#arxivfeed { color: var(--text-muted); padding: 1.2em 0; }
#arxivfeed a { color: var(--accent); }
#arxivfeed hr { display: block; border: none; border-top: 1px solid var(--border); margin: 1.6em 0; }
#arxivfeed b, #arxivfeed strong { color: var(--text); }

.pub-fallback {
  margin-top: 1.5em;
  font-size: 0.9em;
  color: var(--text-faint);
}

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

#site-footer {
  border-top: 1px solid var(--border);
  padding: 3em 0;
  margin-top: 2em;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.footer-inner p {
  color: var(--text-faint);
  font-size: 0.86em;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  font-size: 0.86em;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.unm-badge {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px 16px;
}
.unm-badge img { height: 40px; width: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
