/* Dylan Neve Personal Website - Clean, Modern, Accessible CSS */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Dark theme (default) */
  --bg-primary: #0b0f17;
  --bg-surface: #131b2a;
  --bg-surface-elevated: #1a2438;
  --bg-surface-hover: #222f49;
  --border-color: #243049;
  --border-subtle: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.15);
  
  --accent-emerald: #34d399;
  --accent-emerald-bg: rgba(52, 211, 153, 0.12);
  --accent-purple: #a78bfa;
  --accent-purple-bg: rgba(167, 139, 250, 0.12);
  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(251, 191, 36, 0.12);

  --badge-bg: rgba(56, 189, 248, 0.1);
  --badge-border: rgba(56, 189, 248, 0.25);
  --badge-text: #7dd3fc;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);

  --max-width: 1040px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent-primary: #0284c7;
    --accent-hover: #0369a1;
    --accent-glow: rgba(2, 132, 199, 0.1);

    --accent-emerald: #059669;
    --accent-emerald-bg: rgba(5, 150, 105, 0.1);
    --accent-purple: #7c3aed;
    --accent-purple-bg: rgba(124, 58, 237, 0.1);
    --accent-amber: #d97706;
    --accent-amber-bg: rgba(217, 119, 6, 0.1);

    --badge-bg: rgba(2, 132, 199, 0.08);
    --badge-border: rgba(2, 132, 199, 0.2);
    --badge-text: #0369a1;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  }
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.brand-link:hover {
  text-decoration: none;
  color: var(--accent-primary);
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  align-items: center;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Main Container */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  flex: 1;
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  margin-bottom: 1.25rem;
}

.hero-pill .status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 780px;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #0b0f17;
  font-weight: 700;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #0b0f17;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.section-header {
  margin-bottom: 2.25rem;
}

.section-tag {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.55;
}

/* Featured Research Box */
.research-featured {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.research-featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple), var(--accent-emerald));
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
}

.badge-prep {
  background: var(--accent-amber-bg);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--accent-amber);
}

.badge-emerald {
  background: var(--accent-emerald-bg);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent-emerald);
}

.badge-purple {
  background: var(--accent-purple-bg);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--accent-purple);
}

.card-body {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.card-body p {
  margin-bottom: 1rem;
}

.card-body p:last-child {
  margin-bottom: 0;
}

/* Stats Metric Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.metric-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
}

.metric-card.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, rgba(56, 189, 248, 0.05) 100%);
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.metric-num.cyan {
  color: var(--accent-primary);
}

.metric-num.emerald {
  color: var(--accent-emerald);
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.metric-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Research Highlights Table / Cards */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.result-item {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.15s ease;
}

.result-item:hover {
  border-color: var(--border-subtle);
}

.result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.result-detail {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-md);
}

.project-card-top {
  margin-bottom: 1rem;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.project-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.project-card-bottom {
  margin-top: 1.25rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.project-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Education Section */
.education-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.edu-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.edu-school {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.edu-degree {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.thesis-callout {
  background-color: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.thesis-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.thesis-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.thesis-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.contact-card:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-surface-elevated);
  text-decoration: none;
}

.contact-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.contact-card-val {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-card:hover .contact-card-val {
  color: var(--accent-primary);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.25rem;
  background-color: var(--bg-primary);
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .hero-section {
    padding: 3rem 0 2.5rem;
  }

  .nav-container {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.82rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
  }

  /* Keep hero buttons nicely formatted on 390px */
  .hero-buttons .btn {
    flex: 1 1 calc(50% - 0.6rem);
    min-width: 140px;
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .research-featured {
    padding: 1.35rem;
  }

  .education-card {
    padding: 1.35rem;
  }
}

@media (max-width: 400px) {
  .brand-link {
    font-size: 1.05rem;
  }
  
  .nav-links {
    gap: 0.6rem;
  }
  
  .nav-link {
    font-size: 0.78rem;
  }
}
