/* ---------------------------------------------
   Tokens
--------------------------------------------- */
:root {
  --paper: #F4F5F0;
  --paper-raised: #FFFFFF;
  --ink: #14171A;
  --slate: #565F68;
  --indigo: #3730C4;
  --indigo-soft: #ECEBFB;
  --amber: #E8992B;
  --border: #DBDED4;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

  --rail-min: 220px;
  --content-max: 1060px;   /* content column width — edit this */
}

/* ---------------------------------------------
   Reset & base
--------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;        /* main content font size — edit this */
  font-weight: 400;       /* main content font weight — edit this (400–600) */
  line-height: 1.65;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.5em; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--indigo); }
a:hover { text-decoration-thickness: 2px; }
em { font-style: italic; color: var(--indigo); }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------
   Page layout
--------------------------------------------- */
.page {
  display: grid;
  grid-template-columns: minmax(var(--rail-min), max-content) 1fr;
  min-height: 100vh;
}

main { padding: 4.5rem 1.75rem 6rem; }  /* 1.75rem = minimum side gap — edit this */

section {
  max-width: var(--content-max);
  margin: 0 auto 5rem;
  scroll-margin-top: 2.5rem;
}

.num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--indigo);
  vertical-align: middle;
  margin-right: 0.6em;
  letter-spacing: 0.02em;
}

h2 { font-size: 1.6rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 1.4rem; }

/* ---------------------------------------------
   Rail (landmark navigation)
--------------------------------------------- */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 2.5rem 1.75rem 2.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.rail__avatar {
  display: block;
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--indigo-soft);
  margin: 0 0 0 calc(0.5rem + 2px); /* lines up with nav link text */
}
.rail__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail__avatar-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: var(--indigo);
}
.rail__avatar-fallback.is-visible { display: flex; }

.rail__nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--slate);
  font-size: 1.05rem;      /* nav label size — edit this */
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  white-space: nowrap;
}

.rail__link i {
  font-size: 1rem;         /* nav icon size — edit this */
  width: 1.2em;
  text-align: center;
  color: var(--indigo);
  opacity: 0.55;
}

.rail__link:hover { color: var(--ink); background: var(--paper-raised); }
.rail__link:hover i { opacity: 1; }

.rail__link.is-active {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--amber);
  background: var(--indigo-soft);
}
.rail__link.is-active i { color: var(--amber); opacity: 1; }

/* ---------------------------------------------
   Hero
--------------------------------------------- */
.hero { margin-top: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--indigo);
  margin-bottom: 1rem;
}

.hero__name {
  font-size: clamp(2.6rem, 4vw, 4.4rem);
  line-height: 1.05;
  font-weight: 600;
  margin-bottom: 1.1rem;
}

.hero__dek {
  font-size: 1.1rem;
  color: var(--slate);
  margin-bottom: 1.5rem;
}

.social-row {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  margin: 0 0 1.75rem;
}
.social-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;              /* pill box size — edit this */
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}
.social-pill i { font-size: 1.3rem; line-height: 1; }  /* icon size — edit this */

/* Colorful brand icons */
.social-pill.linkedin       { color: #0a66c2; }
.social-pill.github         { color: #24292f; }
.social-pill.google-scholar { color: #4285f4; }
.social-pill.medium-blog    { color: #191919; }
.social-pill.researchgate   { color: #00ccbb; }

/* On hover, invert: brand-colored background, white icon */
.social-pill.linkedin:hover       { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.social-pill.github:hover         { background: #24292f; border-color: #24292f; color: #fff; }
.social-pill.google-scholar:hover { background: #4285f4; border-color: #4285f4; color: #fff; }
.social-pill.medium-blog:hover    { background: #191919; border-color: #191919; color: #fff; }
.social-pill.researchgate:hover   { background: #00ccbb; border-color: #00ccbb; color: #fff; }

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn--primary { background: var(--indigo); color: #fff; }
.btn--primary:hover { background: #2C27A0; }
.btn--ghost { border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--indigo); color: var(--indigo); }

/* ---------------------------------------------
   Tag list
--------------------------------------------- */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 1.5rem 0 0;
}
.tag-list li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--indigo-soft);   /* tag background — edit this */
  border: 1px solid transparent;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  color: var(--indigo);             /* tag text color — edit this */
}

/* ---------------------------------------------
   Publications & projects
--------------------------------------------- */
.pub, .project { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.pub:last-child, .project:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pub__title, .project__title { font-size: 1.1rem; margin-bottom: 0.4rem; }
.pub__authors { color: var(--slate); margin-bottom: 0.3rem; }
.pub__meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--slate);
  margin-bottom: 0;
}
.project__note { font-style: italic; color: var(--slate); margin-bottom: 0.6rem; }
.project ul { padding-left: 1.2rem; margin: 0; }
.project li { margin-bottom: 0.4rem; }

/* ---------------------------------------------
   Timeline (experience & education)
--------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline__item {
  position: relative;
  padding: 0 0 2.25rem 1.5rem;
  border-left: 2px solid var(--border);
}
.timeline__item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 0.3rem;
}
.timeline__role { font-size: 1.05rem; margin-bottom: 0.5rem; }
.timeline__stack {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--indigo);
  margin-top: 0.6rem;
  margin-bottom: 0;
}

/* ---------------------------------------------
   Skills
--------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
}
.skills-group h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.skills-group p { color: var(--slate); margin-bottom: 0; }

/* ---------------------------------------------
   Contact
--------------------------------------------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;              /* icon circle size — edit this */
  height: 46px;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  font-size: 1.05rem;       /* icon size — edit this */
  flex-shrink: 0;
}
.contact-list a { font-size: 1.05rem; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.site-footer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }

  .rail {
    position: sticky;
    height: auto;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--paper);
    gap: 1.25rem;
    overflow-x: auto;
  }
  .rail__identity {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  .rail__avatar {
    width: 44px;
    height: 54px;
    border-radius: 50%;
    margin-bottom: 0;
  }
  .rail__nav ol { flex-direction: row; gap: 0.4rem; }
  .rail__link { white-space: nowrap; }
  .rail__link i { display: none; }

  main { padding: 3rem 1.25rem 4rem; }
  .skills-grid { grid-template-columns: 1fr; }
}