/* style.css - UNC Themed Portfolio */
:root {
  /* UNC Colors */
  --carolina-blue: #4B9CD3;
  --carolina-blue-dark: #2c6e9e;
  --carolina-blue-light: #7bb8df;
  --navy: #13294B;
  --navy-light: #1e3a5f;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --gray-light: #e9ecef;
  --gray: #6c757d;
  --gold: #b8962e;        /* kept for contrast but used sparingly */
  --gold-light: #d4af54;
  
  /* Updated theme vars */
  --ink: #13294B;
  --ink-light: #1e3a5f;
  --cream: #f8f9fa;
  --cream-dark: #e9ecef;
  --accent: #4B9CD3;
  --accent-dark: #2c6e9e;
  --rule: rgba(75, 156, 211, 0.35);
  --text: #212529;
  --text-muted: #495057;
  --card-bg: #ffffff;
  --bg-alt: #f0f4f8;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

body.dark-theme {
  --ink: #e2e2f0;
  --ink-light: #c0c0d8;
  --cream: #121212;
  --cream-dark: #1e1e2a;
  --accent: #6c9bcf;
  --accent-dark: #4b7bb5;
  --rule: rgba(75, 156, 211, 0.25);
  --text: #e8e8f0;
  --text-muted: #a0a0b8;
  --card-bg: #1a1a24;
  --bg-alt: #16161e;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  transition: background 0.3s ease, color 0.2s ease;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px;
  z-index: 200;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus {
  top: 0;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
  transition: background 0.2s;
}
body.dark-theme .navbar {
  background: rgba(18, 18, 26, 0.94);
  border-bottom-color: var(--accent);
}
.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.nav-logo::before {
  content: '⚓';
  font-size: 0.9rem;
  margin-right: 0.3rem;
  color: var(--accent);
  display: inline-block;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}
.nav-links a.active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle-wrapper {
  margin-left: 1rem;
}
.theme-toggle {
  background: var(--cream-dark);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.1rem;
  transition: background 0.2s;
}
.theme-toggle:hover {
  background: var(--accent);
  color: white;
}

/* Hero Section with UNC-inspired background */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 0 3rem;
  background: linear-gradient(135deg, var(--cream) 0%, var(--bg-alt) 100%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10% 20%, rgba(75, 156, 211, 0.05) 0%, transparent 50%),
                    repeating-linear-gradient(45deg, rgba(75, 156, 211, 0.02) 0px, rgba(75, 156, 211, 0.02) 2px, transparent 2px, transparent 8px);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero-left {
  padding-right: 1rem;
  animation: fadeUp 0.8s ease both;
}
.hero-eyebrow span {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 0.8rem;
}
h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 300;
  line-height: 1.05;
  margin: 1.5rem 0 1rem;
}
h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-desc {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink-light);
  max-width: 90%;
  margin-bottom: 2rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 40px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(75, 156, 211, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
}
.hero-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.affiliation-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--cream-dark);
}
.affiliation-item:last-child {
  border: none;
}
.affil-icon {
  width: 40px;
  height: 40px;
  background: var(--cream-dark);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
}
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: bounce 1.5s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Sections */
.section {
  padding: 5rem 0;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.alt-bg {
  background: var(--bg-alt);
  position: relative;
}
.alt-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: repeating-linear-gradient(45deg, rgba(75, 156, 211, 0.02) 0px, rgba(75, 156, 211, 0.02) 2px, transparent 2px, transparent 8px);
  pointer-events: none;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.section-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}
h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.light-rule {
  background: rgba(75, 156, 211, 0.3);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
}
.about-highlights {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.about-highlights span {
  font-size: 0.8rem;
  background: var(--cream-dark);
  padding: 0.3rem 1rem;
  border-radius: 40px;
}
.interests-box {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--rule);
}
.interest-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.interest-tag {
  background: var(--bg-alt);
  padding: 0.3rem 0.9rem;
  border-radius: 30px;
  font-size: 0.8rem;
  transition: var(--transition);
  cursor: default;
}
.interest-tag:hover {
  background: var(--accent);
  color: white;
}
.edu-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* Research */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}
.paper-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.8rem;
  transition: var(--transition);
  border: 1px solid var(--rule);
}
.paper-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.paper-card.wide {
  grid-column: span 2;
}
.paper-type {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.paper-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.paper-footer {
  margin-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
}
.paper-link {
  text-decoration: none;
  font-weight: 500;
  color: var(--accent);
}
.paper-link:hover {
  color: var(--gold);
}

/* Teaching */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.teach-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  transition: var(--transition);
}
.teach-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.teaching-philosophy {
  margin-top: 2.5rem;
  background: var(--bg-alt);
  padding: 1.8rem;
  border-radius: 20px;
  font-style: italic;
  border-left: 4px solid var(--accent);
}

/* CV Section */
.cv-section {
  background: var(--navy);
  color: var(--cream);
}
.cv-section .section-num,
.cv-section h2 {
  color: var(--cream);
}
.cv-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.cv-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.cv-stat {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(75, 156, 211, 0.3);
}
.cv-stat:hover {
  border-color: var(--accent);
  background: rgba(75, 156, 211, 0.1);
}
.cv-stat-num {
  font-size: 2.4rem;
  font-weight: 300;
  font-family: 'Cormorant Garamond', serif;
  color: var(--accent);
}
.cv-request-btn {
  margin-top: 1rem;
  background: var(--accent);
  border: none;
  color: white;
}
.cv-request-btn:hover {
  background: var(--accent-dark);
}

/* Contact */
.contact-inner {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 3rem;
}
.contact-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 300;
}
.contact-tagline em {
  color: var(--accent);
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  border: 1px solid var(--rule);
}
.contact-link:hover {
  transform: translateX(5px);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
}
.link-icon {
  color: var(--accent);
  font-size: 1.2rem;
  width: 32px;
  text-align: center;
}

/* Footer */
footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  border-top: 2px solid var(--accent);
}
footer a {
  color: var(--accent-light);
  text-decoration: none;
}
footer a:hover {
  color: var(--gold-light);
}

/* Animations & Responsive */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .cv-inner,
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .research-grid {
    grid-template-columns: 1fr;
  }
  .paper-card.wide {
    grid-column: span 1;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 80%;
    height: calc(100vh - 70px);
    background: var(--card-bg);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    transition: 0.3s;
    box-shadow: var(--shadow-md);
    gap: 1.8rem;
  }
  .nav-links.active {
    left: 0;
  }
  .nav-container {
    padding: 0.8rem 1.5rem;
  }
}
@media (max-width: 600px) {
  .container {
    padding: 0 1.2rem;
  }
  .hero-left {
    padding-right: 0;
  }
}