/* ========================================
   DESIGN TOKENS — Ink & Denim
   ======================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* =============================================
     COLOR PALETTE — Ink & Denim
     Ink Black #0D1321 | Deep Space Blue #1D2D44
     Blue Slate #3E5C76 | Dusty Denim #748CAB
     Eggshell #F0EBD8
     ============================================= */
  --color-bg: #0D1321;
  --color-surface: #1D2D44;
  --color-surface-2: #162336;
  --color-border: #3E5C76;
  --color-text: #F0EBD8;
  --color-text-muted: #748CAB;
  --color-text-faint: #4e6a88;

  /* Primary — Eggshell / Dusty Denim */
  --color-primary: #748CAB;
  --color-primary-hover: #8fa3be;
  --color-primary-dim: rgba(116, 140, 171, 0.12);
  --color-primary-glow: rgba(116, 140, 171, 0.3);

  /* Secondary — Eggshell warm */
  --color-secondary: #F0EBD8;
  --color-secondary-dim: rgba(240, 235, 216, 0.1);

  /* Accent — Blue Slate */
  --color-accent: #3E5C76;
  --color-accent-dim: rgba(62, 92, 118, 0.15);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'General Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ========================================
   GLOBAL
   ======================================== */

body {
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

/* Subtle grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(116, 140, 171, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 140, 171, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(116, 140, 171, 0.25);
  color: var(--color-text);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 19, 33, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav--hidden {
  transform: translateY(-100%);
}

.nav__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

.nav__logo svg {
  width: 28px;
  height: 28px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav__links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav__links a:hover {
  color: var(--color-primary);
}

.nav__links a:hover::after {
  width: 100%;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    flex-direction: column;
    background: rgba(29, 45, 68, 0.98);
    backdrop-filter: blur(24px);
    padding: var(--space-20) var(--space-8);
    gap: var(--space-6);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--color-border);
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__hamburger {
    display: flex;
    z-index: 110;
  }

  .nav__hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__hamburger.open span:nth-child(2) {
    opacity: 0;
  }
  .nav__hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* ========================================
   HERO
   ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(100px, 14vh, 160px);
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 var(--space-8);
  max-width: 800px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  line-height: 0.95;
  white-space: nowrap;
}

.hero-name span {
  display: inline;
  background: linear-gradient(135deg, #748CAB, #F0EBD8, #8FA3BE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
  opacity: 0.85;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #0D1321;
  background: var(--color-secondary);
  border: none;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__cta:hover {
  background: #F0EBD8;
  box-shadow: 0 4px 20px rgba(240, 235, 216, 0.2);
  transform: translateY(-2px);
}

/* Canvas container below CTA — transparent, blends with page */
.hero__canvas-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  height: clamp(360px, 50vh, 620px);
  margin-top: var(--space-3);
}

.hero__canvas {
  width: 100%;
  height: 100%;
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

/* ========================================
   SECTIONS (shared)
   ======================================== */

.section {
  position: relative;
  z-index: 2;
  padding: clamp(var(--space-16), 8vw, var(--space-32)) var(--space-6);
}

.section__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.section__header {
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.section__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section__label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--color-primary);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* Alternating section */
.section--alt {
  background: linear-gradient(180deg, var(--color-surface), transparent);
}

/* ========================================
   ABOUT
   ======================================== */

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: start;
}

.about__text p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.stat {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat:hover {
  border-color: rgba(116, 140, 171, 0.4);
  box-shadow: 0 4px 16px rgba(116, 140, 171, 0.08);
}

.stat__number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-1);
}

.stat__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   EDUCATION
   ======================================== */

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 1px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-border), transparent);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-8);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 6px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 8px rgba(116, 140, 171, 0.25);
}

.timeline__item:first-child .timeline__dot {
  background: var(--color-primary);
  box-shadow: 0 0 12px rgba(116, 140, 171, 0.35);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  margin-bottom: var(--space-1);
  letter-spacing: 0.04em;
}

.timeline__degree {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline__school {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========================================
   RESEARCH
   ======================================== */

.research__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.research-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.research-card:hover {
  border-color: rgba(116, 140, 171, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(116, 140, 171, 0.08);
}

.research-card:hover::before {
  opacity: 1;
}

.research-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  color: var(--color-primary);
}

.research-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.research-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.research-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-primary);
  background: var(--color-primary-dim);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  .research__grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   PUBLICATIONS
   ======================================== */

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pub-item {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pub-item:hover {
  border-left-color: var(--color-secondary);
  box-shadow: 0 4px 16px rgba(116, 140, 171, 0.06);
}

.pub-item-title-link,
.pub-item-title-link:visited,
.pub-item-title-link:active {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.pub-item-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.pub-item-title-link:hover .pub-item-title,
.pub-item-title-link:focus-visible .pub-item-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.pub-item-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.pub-item-meta a {
  color: var(--color-primary);
  text-decoration: none;
}

.pub-item-meta a:hover,
.pub-item-meta a:focus-visible {
  text-decoration: underline;
}

.pub-badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.pub-badge--first {
  background: rgba(116, 140, 171, 0.12);
  color: var(--color-primary);
}

.pub-badge--collab {
  background: rgba(184, 152, 64, 0.12);
  color: var(--color-accent);
}

.pub-author-highlight {
  color: var(--color-text);
  font-weight: 700;
}
/* ========================================
   SKILLS
   ======================================== */

.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.skill-group {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.skill-group__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skill-group__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-chip {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: rgba(62, 92, 118, 0.2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid rgba(62, 92, 118, 0.35);
  transition: all 0.25s ease;
}

.skill-chip:hover {
  color: var(--color-primary);
  border-color: rgba(116, 140, 171, 0.4);
  background: var(--color-primary-dim);
}

@media (max-width: 768px) {
  .skills__grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   CONFERENCES
   ======================================== */

.conferences__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.conference-item {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.conference-item__year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  white-space: nowrap;
  min-width: 50px;
  padding-top: 2px;
}

.conference-item__info {
  flex: 1;
}

.conference-item__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  font-style: italic;
}

.conference-item__venue {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ========================================
   CONTACT / FOOTER
   ======================================== */

.contact {
  text-align: center;
}

.contact__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact__link:hover {
  color: var(--color-primary);
  border-color: rgba(116, 140, 171, 0.4);
  box-shadow: 0 4px 16px rgba(116, 140, 171, 0.08);
}

.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border);
}

.footer__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
}

/* ========================================
   ANIMATIONS
   ======================================== */

.fade-in { opacity: 1; }
@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}
@keyframes reveal-fade { to { opacity: 1; } }
@supports not (animation-timeline: scroll()) {
  .fade-in { opacity: 0; transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
  .fade-in.visible { opacity: 1; }
}

.section-divider { display: flex; align-items: center; justify-content: center; padding: var(--space-4) 0; }
.section-divider__line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--color-border), transparent); }
.section-divider__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary); margin: 0 var(--space-4); box-shadow: 0 0 8px rgba(116, 140, 171, 0.3); }
