:root {
  --byu-blue: #002E5D;
  --byu-blue-deep: #001A33;
  --accent: #2C7BE5;
  --surface: #F7FAFC;
  --surface-strong: #FFFFFF;
  --text: #102A43;
  --muted: #52667A;
  --line: rgba(0, 46, 93, 0.14);
  --shadow: 0 18px 50px rgba(0, 26, 51, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sidebar-width: 330px;
  --max-content: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at top right, rgba(44, 123, 229, 0.16), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 38%, #eef4fa 100%);
}

a { color: inherit; }

.skip-link {
  position: absolute;
  top: -60px;
  left: 18px;
  z-index: 99;
  background: var(--byu-blue);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 18px; }

.page-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.5rem;
}

.sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  height: calc(100vh - 3rem);
  max-height: calc(100vh - 3rem);
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, var(--byu-blue), var(--byu-blue-deep));
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: auto -7rem -6rem auto;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: white;
  color: var(--byu-blue);
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(0, 26, 51, 0.22);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-kicker,
.eyebrow {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-kicker { color: rgba(255, 255, 255, 0.72); }

.sidebar h1 {
  margin: 0.16rem 0 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.sidebar-headline {
  position: relative;
  margin: 1.3rem 0 1.5rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.98rem;
}

.sidebar-nav,
.sidebar-links {
  position: relative;
  display: grid;
  gap: 0.55rem;
}

.sidebar-nav a,
.sidebar-links a {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-links a:hover,
.sidebar-links a:focus-visible {
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.sidebar-links {
  margin-bottom: 2rem;
}

.sidebar-links a { font-size: 0.94rem; }

.content {
  width: min(100%, var(--max-content));
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 3.3rem);
  color: white;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.12), rgba(255,255,255,0)),
    linear-gradient(135deg, var(--byu-blue-deep), var(--byu-blue) 58%, #174f92);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  right: -5rem;
  top: -7rem;
  width: 22rem;
  height: 22rem;
  background: rgba(255, 255, 255, 0.12);
}

.hero::after {
  left: 48%;
  bottom: -8rem;
  width: 18rem;
  height: 18rem;
  background: rgba(44, 123, 229, 0.24);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 870px;
}

.hero .eyebrow { color: rgba(255, 255, 255, 0.78); }

.hero h2 {
  margin: 0.55rem 0 0.7rem;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.45rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.78rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible { transform: translateY(-2px); }
.button.primary { background: white; color: var(--byu-blue); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16); }
.button.secondary { border-color: rgba(255,255,255,0.28); color: white; background: rgba(255,255,255,0.1); }

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 1.5rem;
}

.fact-card,
.panel,
.timeline-card,
.skill-group,
.achievement-card,
.project-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 36px rgba(0, 26, 51, 0.07);
  backdrop-filter: blur(10px);
}

.fact-card {
  padding: 1rem;
}

.fact-card strong {
  display: block;
  color: var(--byu-blue);
  font-size: 1.35rem;
  line-height: 1.1;
}

.fact-card span {
  display: block;
  margin-top: 0.42rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.sections { display: grid; gap: 1.2rem; }

.panel {
  padding: clamp(1.15rem, 2.5vw, 1.65rem);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  color: var(--byu-blue-deep);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.035em;
}

.section-header p {
  margin: 0;
  max-width: 500px;
  color: var(--muted);
}

.rich-copy {
  display: grid;
  gap: 0.88rem;
  color: var(--text);
  font-size: 1.03rem;
}
.rich-copy p { margin: 0; }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
  margin-top: 1.1rem;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  color: var(--byu-blue);
  background: rgba(0, 46, 93, 0.08);
  border: 1px solid rgba(0, 46, 93, 0.12);
  font-size: 0.9rem;
  font-weight: 750;
}

.timeline-grid,
.project-grid,
.achievement-grid,
.skill-grid,
.contact-grid {
  display: grid;
  gap: 0.95rem;
}

.timeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.timeline-card,
.project-card,
.achievement-card,
.skill-group,
.contact-card {
  padding: 1rem;
}

.timeline-card h3,
.project-card h3,
.achievement-card h3,
.skill-group h3 {
  margin: 0 0 0.35rem;
  color: var(--byu-blue-deep);
  font-size: 1.08rem;
  line-height: 1.3;
}

.timeline-meta,
.publication-meta {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.timeline-card p,
.project-card p,
.achievement-card p,
.skill-group p,
.contact-card p,
.publication-card p {
  margin: 0;
}

.clean-list {
  margin: 0.72rem 0 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.clean-list li + li { margin-top: 0.28rem; }

.publication-list {
  display: grid;
  gap: 0.95rem;
}

.publication-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,252,0.92));
}

.publication-card h3 {
  margin: 0 0 0.4rem;
  color: var(--byu-blue-deep);
  font-size: 1.12rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.78rem;
}

.inline-link {
  display: inline-flex;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  color: var(--byu-blue);
  border: 1px solid rgba(0, 46, 93, 0.18);
  background: rgba(0, 46, 93, 0.06);
  text-decoration: none;
  font-weight: 800;
  transition: background 0.18s ease, transform 0.18s ease;
}

.inline-link:hover,
.inline-link:focus-visible {
  background: rgba(0, 46, 93, 0.12);
  transform: translateY(-1px);
}

.project-card {
  display: grid;
  gap: 0.72rem;
  align-content: start;
}

.project-card a {
  text-decoration: none;
}

.project-card .project-title:hover,
.project-card .project-title:focus-visible {
  text-decoration: underline;
}

.skill-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0.72rem 0 0;
}

.skill-group li {
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  color: var(--text);
  background: rgba(44, 123, 229, 0.08);
  border: 1px solid rgba(44, 123, 229, 0.16);
  font-size: 0.93rem;
}

.contact-card a {
  color: var(--byu-blue);
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.note-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(0, 46, 93, 0.06);
  border: 1px solid rgba(0, 46, 93, 0.12);
  color: var(--muted);
}

.footer {
  padding: 1rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.footer code,
.note-card code {
  padding: 0.16rem 0.34rem;
  border-radius: 6px;
  background: rgba(0, 46, 93, 0.08);
}

.not-found-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.not-found-card {
  width: min(100%, 680px);
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.not-found-card .eyebrow { color: var(--accent); }
.not-found-card h1 { margin: 0.5rem 0; color: var(--byu-blue-deep); font-size: clamp(2rem, 5vw, 3.4rem); }
.not-found-card p { color: var(--muted); }
.not-found-card .button.primary { background: var(--byu-blue); color: white; }

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    min-height: auto;
    overflow: hidden;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .quick-facts,
  .timeline-grid,
  .project-grid,
  .achievement-grid,
  .skill-grid,
  .contact-grid,
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: grid;
  }
}

@media (max-width: 560px) {
  .page-shell { padding: 0.8rem; gap: 1rem; }
  .sidebar, .hero, .panel { border-radius: 22px; }
  .sidebar-brand { align-items: flex-start; }
  .button-row { display: grid; }
  .button { width: 100%; }
}
