@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg-deep: #060d18;
  --bg-surface: rgba(12, 22, 40, 0.72);
  --bg-card: rgba(18, 32, 56, 0.85);
  --border: rgba(148, 163, 184, 0.14);
  --text: #e8edf5;
  --text-muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --gold: #d4a853;
  --nav-height: 64px;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
}

/* Page-specific photographic backgrounds (static, no animation) */
.page-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--bg-deep);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.page-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, rgba(6, 13, 24, 0.82) 0%, rgba(10, 22, 40, 0.78) 50%, rgba(6, 13, 24, 0.88) 100%),
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(45, 212, 191, 0.12), transparent 55%);
}

.page-home .page-background {
  background-image: url('../img/backgrounds/home-minneapolis.jpg');
}

.page-about .page-background {
  background-image: url('../img/backgrounds/about-outdoors.jpg');
}

.page-education .page-background {
  background-image: url('../img/backgrounds/education-campus.jpg');
}

.page-experience .page-background {
  background-image: url('../img/backgrounds/experience-research.jpg');
}

.page-projects .page-background {
  background-image: url('../img/backgrounds/projects-data.jpg');
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  background: rgba(6, 13, 24, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  width: min(1100px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav-brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-nav-brand-logo {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(18, 32, 56, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.2s, background 0.2s;
}

.site-nav-brand-logo:hover {
  background: rgba(18, 32, 56, 0.68);
  border-color: rgba(45, 212, 191, 0.28);
}

.site-nav-brand span {
  color: var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.brand-mark::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 210deg, rgba(45, 212, 191, 0.0), rgba(45, 212, 191, 0.65), rgba(96, 165, 250, 0.55), rgba(45, 212, 191, 0.0));
  filter: blur(10px);
  opacity: 0.55;
}

.brand-mark span {
  position: relative;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--text);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  display: block;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--text);
  background: var(--accent-soft);
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 2.5rem) 1.5rem 3rem;
}

/* Ensure page headings remain readable on photos */
.section-label,
.page-title {
  display: inline-block;
  color: var(--text);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.section-label {
  color: var(--accent);
  background: rgba(6, 13, 24, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.page-title {
  margin-top: 0.75rem;
  padding: 0.25rem 0.2rem;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(6, 13, 24, 0.6);
}

/* Home hero */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 4rem;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto 0.5rem;
}

.hero-typed {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--gold);
  min-height: 1.6em;
  margin: 0.5rem 0 1.75rem;
}

.hero-typed .typed-cursor {
  color: var(--accent);
}

.hero-avatar {
  width: 104px;
  height: 104px;
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 10%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 0 0 1.25rem;
  background: rgba(255, 255, 255, 0.04);
}

.hero-icons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 1.1rem;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.hero-icons a:hover {
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.45);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

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

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin: 0 0 2rem;
  line-height: 1.15;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr min(320px, 38%);
  gap: 2.5rem;
  align-items: start;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.about-portrait {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.04);
}

.about-portrait img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}

.about-mini-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.about-mini {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.about-mini img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.about-text p {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
}

.about-text p strong {
  color: var(--text);
  font-weight: 600;
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.about-highlights li {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 999px;
}

.profile-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.profile-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(6, 13, 24, 0.5));
  pointer-events: none;
  z-index: 1;
}

.profile-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.profile-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.photo-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

/* Timeline (education & experience) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}

.timeline-card:hover {
  border-color: rgba(45, 212, 191, 0.25);
}

.timeline-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.timeline-meta {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.timeline-heading {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-org {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.timeline-details {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-details li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.timeline-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
}

.timeline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.timeline-link:hover {
  text-decoration: underline;
}

.honors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.honor-card {
  padding: 1.25rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.honor-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.honor-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.bg-credit {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.5);
  margin-top: 0.35rem;
}

/* Project flip cards */
.projects-intro {
  max-width: 42rem;
  margin: -1rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.flip-card {
  perspective: 1200px;
  min-height: 300px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.flip-card-front {
  background: var(--bg-card);
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}

.flip-card-back {
  background: linear-gradient(145deg, rgba(18, 32, 56, 0.95), rgba(12, 28, 48, 0.98));
  transform: rotateY(180deg);
  overflow-y: auto;
}

.flip-card-front h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.flip-card-affiliation {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.flip-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: auto;
}

.tag {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.flip-hint {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.flip-card-back ul {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.flip-card-back li {
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .page-background {
    background-attachment: scroll;
  }
  .site-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .site-nav {
    height: auto;
    padding: 0.75rem 1rem;
  }

  .site-nav-links {
    justify-content: center;
  }

  .page-main {
    padding-top: calc(var(--nav-height) + 4rem);
  }

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

  .profile-frame {
    max-width: 280px;
    margin: 0 auto;
  }

  .timeline-card {
    grid-template-columns: 1fr;
  }

  .timeline-logo {
    width: 56px;
    height: 56px;
  }

  .flip-card:hover .flip-card-inner {
    transform: none;
  }

  .flip-hint::after {
    content: ' (tap to flip)';
  }
}

@media (prefers-reduced-motion: reduce) {
  .flip-card-inner {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
