/* ============================================
   A. J. Winter — Personal Academic Website
   ============================================ */

:root {
  --navy: #0d1b2a;
  --navy-mid: #1b3a5c;
  --accent: #2e86c1;
  --accent-light: #5dade2;
  --gold: #d4a843;
  --text: #1a1a2e;
  --text-muted: #5a6a7a;
  --bg: #ffffff;
  --bg-light: #f5f7fa;
  --bg-card: #ffffff;
  --border: #e0e6ed;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --max-w: 1100px;
  --radius: 8px;
  --shadow: 0 2px 16px rgba(13,27,42,0.08);
  --shadow-hover: 0 6px 28px rgba(13,27,42,0.14);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--navy);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text); }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* ---- Layout ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 5rem 0; }
section:nth-child(even) { background: var(--bg-light); }

/* ---- Navigation ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,27,42,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: var(--accent-light); }

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

.nav-links a {
  color: rgba(255,255,255,0.78);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  border-bottom-color: var(--gold);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 0.75rem 2rem;
    border-bottom: none;
  }
}

/* ---- Hero ---- */
.hero {
  padding: 9rem 0 5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a4a7a 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(46,134,193,0.15) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero h1 { color: #fff; margin-bottom: 1rem; }

.hero-title-sub {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1.75rem;
  font-weight: 400;
}

.hero-bio {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  max-width: 55ch;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(46,134,193,0.35);
}

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.35);
}
.btn-outline:hover {
  border-color: rgba(255,255,255,0.8);
  color: #fff;
  transform: translateY(-1px);
}

.hero-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  text-align: center;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-photo {
    margin: 0 auto;
    order: -1;
  }
  .hero-actions { justify-content: center; }
  .hero-bio { margin: 0 auto 2rem; }
}

/* ---- Info pills ---- */
.info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}

/* ---- Section headings ---- */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-heading {
  margin-bottom: 0.75rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

/* ---- Research cards ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.25s;
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-mid), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.card-img {
  margin: -1.75rem -1.75rem 1rem;
}
.card-img img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}
.img-credit {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  padding: 0 0.2rem;
}
.img-credit a { color: inherit; text-decoration: underline; }
.card-img .img-credit { font-size: 0.6rem; }

.card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.card-link:hover { gap: 0.5rem; }

/* ---- About / bio section ---- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.about-text p + p { margin-top: 1rem; }

.sidebar-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.sidebar-box h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.sidebar-list {
  list-style: none;
}
.sidebar-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list li strong { color: var(--text); display: block; font-size: 0.85rem; }

/* ---- Contact section ---- */
section.contact-section {
  background: var(--navy);
  color: #fff;
}
section.contact-section .section-label { color: var(--gold); }
section.contact-section h2 { color: #fff; }
section.contact-section p { color: rgba(255,255,255,0.65); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

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

.contact-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-item-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.2rem;
}
.contact-item-text a,
.contact-item-text span {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.contact-item-text a:hover { color: var(--accent-light); }

/* ---- Footer ---- */
footer {
  background: #080f18;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
}

/* ---- Page header (inner pages) ---- */
.page-hero {
  padding: 8rem 0 4rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
}
.page-hero .section-label { color: var(--gold); }
.page-hero h1 { color: #fff; margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.65); max-width: 55ch; }

/* ---- Research page ---- */
.research-topic {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.research-topic:last-child { border-bottom: none; }

.research-topic--with-img {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
}

.research-topic--with-img.reverse .research-topic-img-block { order: 2; }
.research-topic--with-img.reverse .research-topic-content  { order: 1; }

.research-topic-img-block img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.research-topic-content h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
.research-topic-content p { color: var(--text-muted); margin-bottom: 0.75rem; }

@media (max-width: 768px) {
  .research-topic--with-img {
    grid-template-columns: 1fr;
  }
  .research-topic--with-img.reverse .research-topic-img-block { order: unset; }
  .research-topic--with-img.reverse .research-topic-content  { order: unset; }
}


/* ---- CV page ---- */
.cv-section {
  margin-bottom: 3rem;
}

.cv-section h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cv-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 2px;
}

.cv-entry-main h4 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.cv-entry-main p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.cv-download-bar {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy));
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.cv-download-bar p { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin: 0; }
.cv-download-bar strong { color: #fff; display: block; font-size: 1rem; }

/* ---- Utility ---- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted { color: var(--text-muted); }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease both;
}
.fade-up-2 { animation-delay: 0.1s; }
.fade-up-3 { animation-delay: 0.2s; }
.fade-up-4 { animation-delay: 0.3s; }
