/* ==============
   Base + Layout
   ============== */

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: radial-gradient(circle at top left, #0f172a, #020617 40%, #001322 80%);
  background-attachment: fixed;
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
}

/* Containing wrapper so content doesn’t get too wide */
.site-wrapper {
  width: 100%;
  max-width: 1100px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Glassy nav bar */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Name in nav */
.nav-brand {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #e5e7eb;
}

/* Links on the right */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-links a {
  text-decoration: none;
  color: #cbd5f5;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-links a:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #f9fafb;
  transform: translateY(-1px);
}

.nav-links a.active {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: #0f172a;
  font-weight: 600;
}

/* ==============
   Main “card”
   ============== */

.main-card {
  margin-top: 8px;
  padding: 24px 24px 28px;
  border-radius: 24px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 22px 50px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
}

/* ==================
   Hero (Home page)
   ================== */

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f9fafb;
}

.role-separator {
  border: 0;
  border-top: 2px solid currentColor; /* same color as surrounding text (incl. your name) */
  margin: 0.2rem 0.2;            /* tweak spacing as you like */
  max-width: 725px;                   /* optional: keeps line from going too wide */
}

.subtitle {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.blurb {
  margin: 0 0 18px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #e5e7eb;
}

.keywords {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: #a5b4fc;
}

.hero-actions {
  margin-bottom: 12px;
}

/* Email line under button */
.email {
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Right-hand side (photo + social) */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Headshot sizing */
.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: #020617;
  box-shadow: 0 12px 25px rgba(56, 189, 248, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(56, 189, 248, 0.55);
}

/* ==============
   Social icons
   ============== */

/* Grid of circular icon buttons under photo */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-auto-rows: 38px;
  gap: 10px;
  justify-content: center;
}

/* placement only */
.social-btn.orcid    { grid-row: 1; grid-column: 1; }
.social-btn.rgate   { grid-row: 1; grid-column: 2; }
.social-btn.scholar  { grid-row: 1; grid-column: 3; }
.social-btn.linkedin { grid-row: 2; grid-column: 1; }
.social-btn.github   { grid-row: 2; grid-column: 2; }
.social-btn.bluesky  { grid-row: 2; grid-column: 3; }

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;

  /* default zoom level for icons (you can tweak this) */
  --icon-zoom: 135%;
}

/* this uses the per-button variable for zoom */
.social-btn img {
  width: var(--icon-zoom);
  height: var(--icon-zoom);
  object-fit: cover; /* fills the circle & crops excess */
}

/* Simple hover lift and glow */
.social-btn:hover {
  transform: translateY(-1px);
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.9);
}

/* Per-icon zoom overrides (tweak these numbers freely) */
.social-btn.orcid {--icon-zoom: 110%;}
.social-btn.bluesky {--icon-zoom: 125%;}
.social-btn.linkedin {--icon-zoom: 167%;}
.social-btn.scholar {--icon-zoom: 135%;}
.social-btn.github {--icon-zoom: 110%;}
.social-btn.rgate {--icon-zoom: 100%;}

/* Optional: slight tint per network (unchanged) */
.social-btn.github:hover,
.social-btn.linkedin:hover,
.social-btn.orcid:hover,
.social-btn.rgate:hover,
.social-btn.bluesky:hover,
.social-btn.scholar:hover {
  border-color: #22c55e;
}

/* ==============
   Page titles & sections
   (for Publications, Talks, etc.)
   ============== */

.page-title {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.page-intro {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: #cbd5f5;
  max-width: 60rem;
}

.page-intro_top {
  margin-top: 0;
  margin-bottom: 0px;
  font-size: 0.95rem;
  color: #cbd5f5;
  max-width: 60rem;
}

/* Header row on content pages: title + button */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* Keep the text block from stretching too wide when the button is present */
.page-header-text {
  flex: 1 1 auto;
}

/* Keep the button from wrapping weirdly */
.page-header .btn {
  white-space: nowrap;
  margin-top: 4px; /* nudges it down so it aligns nicely with the title */
}

/* Stack title and button on small screens */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .btn {
    margin-top: 8px;
  }
}

/* Reusable section block */
.section-block {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.section-block h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.section-block h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bfdbfe;
}

/* Publication list */
.pub-list,
.simple-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.pub-list li,
.simple-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e5e7eb;
}

/* small accent bullet */
.pub-list li::before,
.simple-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #22c55e);
}

.pub-author-highlight {
  /* Fallback: simple accent color if gradients aren't supported */
  color: #38bdf8;

  /* Gradient text using same colors as nav active pill */
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  font-weight: 400; /* normal weight (not bold) */
}

/* Links inside body text */
a {
  color: #38bdf8;
}

a:hover {
  color: #f97316;
}

/* Degree blocks: text + logo side-by-side */
.degree-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* Keep your existing section-block look for the text */
.degree-text {
  flex: 1 1 auto;
}

/* Logo column */
.degree-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Base logo styling */
.degree-logo img {
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  border-radius: 8px; /* remove if you want sharp corners */
}

/* Per-university sizing (adjust these independently) */
.degree-logo-sta img {
  max-width: 125px;   /* St Andrews logo size */
}

.degree-logo-calvin img {
  max-width: 125px;  /* Calvin logo size */
}

/* Stack vertically on small screens */
@media (max-width: 640px) {
  .degree-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .degree-logo {
    margin-top: 8px;
  }
}

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

.site-footer {
  margin-top: 8px;
  padding: 6px 4px 10px;
  font-size: 0.75rem;
  text-align: center;
  color: #9ca3af;
}

/* ==============
   Responsiveness
   ============== */

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .nav-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main-card {
    padding: 18px 16px 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-right {
    order: -1; /* put photo on top on mobile */
  }

  .profile-photo {
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .social-grid {
    grid-template-columns: repeat(4, 34px);
    gap: 8px;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }
}
