/* =========================================================
   QUICK DESIGN CONTROLS
   Change these variables first to restyle the whole website.
   ========================================================= */
:root {
  --page-bg: #f4f7fb;
  --page-bg-2: #edf2ff;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.1);

  --accent: #2155d6;
  --accent-2: #7a4dff;
  --accent-soft: rgba(33, 85, 214, 0.1);
  --success-soft: rgba(22, 163, 74, 0.11);

  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.05);

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;

  --max-width: 1120px;
  --nav-height: 76px;
  --section-space: 5.5rem;
  --card-pad: 1.5rem;

  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --page-bg: #0b1020;
  --page-bg-2: #10172b;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-strong: #101827;
  --text: #edf2f7;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.16);

  --accent: #78a6ff;
  --accent-2: #b48eff;
  --accent-soft: rgba(120, 166, 255, 0.14);
  --success-soft: rgba(34, 197, 94, 0.13);

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.26);
}

/* ========================
   Base / reset
   ======================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(122, 77, 255, 0.07), transparent 30%),
    radial-gradient(circle at top right, rgba(33, 85, 214, 0.08), transparent 26%),
    linear-gradient(180deg, var(--page-bg), var(--page-bg-2));
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 180ms ease, color 180ms ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: var(--accent-soft);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* ========================
   Decorative background
   ======================== */
.page-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(90px);
  z-index: -3;
  opacity: 0.6;
  pointer-events: none;
}

.page-glow--one {
  background: rgba(122, 77, 255, 0.16);
  top: -10rem;
  left: -8rem;
}

.page-glow--two {
  background: rgba(33, 85, 214, 0.14);
  bottom: -12rem;
  right: -10rem;
}

.page-grid {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 80%);
  opacity: 0.35;
}

html[data-theme="light"] .page-grid {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

/* ========================
   Layout utilities
   ======================== */
.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: var(--section-space) 0;
  scroll-margin-top: calc(var(--nav-height) + 1.2rem);
}

.section--compact {
  padding-top: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   Header / navigation
   ======================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--page-bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: var(--shadow-soft);
}

.brand-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.site-nav a,
.icon-button,
.button {
  border-radius: 999px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  transition: color 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.menu-toggle,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.menu-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border-radius: 18px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px 0;
  border-radius: 999px;
  background: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.78rem 1.05rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: var(--shadow);
}

.button--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.button--text {
  background: transparent;
  color: var(--accent);
  padding-left: 0;
  padding-right: 0;
}

/* ========================
   Card system
   ======================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--card-pad);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.card-title {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 1.15rem 0;
}

.muted {
  color: var(--muted);
}

.clean-list {
  margin: 0;
  padding-left: 1.15rem;
}

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

.stack-list {
  display: grid;
  gap: 0.8rem;
}

.stack-item {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
}

.stack-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.stack-item__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.stack-item__meta {
  color: var(--muted);
  font-size: 0.93rem;
  white-space: nowrap;
}

/* ========================
   Hero
   ======================== */
.hero {
  padding-top: 4.4rem;
  padding-bottom: 2.4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 2.4rem;
  align-items: start;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 1rem;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.hero-copy {
  max-width: 50rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.3vw, 3.55rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0 0 0.7rem;
}

.hero-tagline {
  font-size: clamp(1.1rem, 1.65vw, 1.34rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  max-width: 40rem;
  margin: 0 0 1.15rem;
}

.hero-intro {
  max-width: 44rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.82;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-meta li {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-portrait {
  display: flex;
  justify-content: center;
}

.profile-image {
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  border-radius: 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  object-fit: cover;
  object-position: center 18%;
  background: var(--surface-strong);
}

.profile-fallback {
  display: none !important;
}

.hero-side {
  display: grid;
  gap: 1rem;
}

.spotlight h2,
.contact-card h2,
.section-head h2 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.spotlight h2 {
  font-size: 1rem;
  margin: 0 0 0.55rem;
}

.spotlight p {
  margin: 0;
  color: var(--muted);
}

.hero-facts {
  display: grid;
  gap: 0.8rem;
}

.fact-row {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.fact-row__label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.fact-row__value {
  display: block;
  line-height: 1.45;
}

/* ========================
   Highlights
   ======================== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-soft);
}

.info-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.38rem;
}

.info-card__value {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ========================
   Section headings / prose
   ======================== */
.section-head {
  max-width: 46rem;
  margin-bottom: 1.6rem;
}

.section-head h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.06;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 0.95rem;
}

.about-grid,
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  font-size: 0.92rem;
}

.tag-list--large .tag {
  padding: 0.6rem 0.8rem;
}

.interests-card {
  width: 100%;
}

/* ========================
   Project cards
   ======================== */
.projects-group + .projects-group {
  margin-top: 2.1rem;
}

.projects-subhead {
  max-width: 44rem;
  margin-bottom: 1rem;
}

.projects-subhead h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

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

.project-card__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: auto -10% -80px 30%;
  height: 160px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.project-card--featured {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}

.project-card__top,
.timeline-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.project-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.project-card__period,
.timeline-item__period {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.project-card__summary {
  margin: 0 0 1rem;
  color: var(--muted);
}

.project-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.link-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

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

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* ========================
   Timeline
   ======================== */
.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.8rem;
  bottom: -1rem;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child::before {
  bottom: 0.8rem;
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -0.15rem;
  top: 0.85rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-soft);
}

.timeline-item__role {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.timeline-item__org {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* ========================
   Contact / footer
   ======================== */
.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.contact-copy {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.site-footer {
  padding: 0 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}

.footer-note {
  margin: 0;
  text-align: right;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 980px) {
  :root {
    --section-space: 4.5rem;
  }

  .hero-grid,
  .about-grid,
  .research-grid,
  .card-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 420px;
  }

  .hero-portrait {
    justify-content: flex-start;
  }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-wrap {
    gap: 0.8rem;
  }
}

@media (max-width: 760px) {
  :root {
    --section-space: 4rem;
    --card-pad: 1.15rem;
  }

  .header-inner {
    position: relative;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-wrap {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    box-shadow: var(--shadow);
  }

  .nav-wrap.is-open {
    display: flex;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav a {
    padding: 0.8rem 0.9rem;
  }

  .header-actions {
    justify-content: space-between;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-grid,
  .about-grid,
  .research-grid,
  .card-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 12vw, 3.2rem);
  }

  .hero-tagline {
    font-size: 1.02rem;
  }

  .hero-links {
    gap: 0.6rem;
  }

  .hero-meta li,
  .button {
    width: 100%;
    justify-content: center;
  }

  .profile-image,
  .profile-fallback {
    width: min(100%, 300px);
  }

  .project-card__footer,
  .stack-item__top,
  .project-card__top,
  .timeline-item__top,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-note {
    text-align: left;
  }

  .timeline-item {
    padding-left: 1.2rem;
  }

  .timeline-item::after {
    left: -0.05rem;
  }

  .timeline-item::before {
    left: 0.32rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}


.no-js .reveal {
  opacity: 1;
  transform: none;
}
