:root {
  /* Color palette — every color on the site is derived from these tokens.
     Re-theme the whole page by editing just this block. */
  --bg: #ffffff;       /* page background */
  --ink: #1c1f26;      /* primary text */
  --muted: #5b6472;    /* secondary text — taglines, captions, authors */
  --faint: #9aa3b2;    /* tertiary text — dates, dividers, dots */
  --line: #e3e6ec;     /* hairlines, card borders */
  --accent: #3457d5;   /* links, active nav state, highlights */
  --accent-soft: color-mix(in srgb, var(--accent) 35%, transparent); /* muted underline, subtle accent fills */

  /* Typeface — change this one line to re-font the whole site.
     "Google Sans" itself isn't distributed for web use (Google's in-house
     UI font, not on Google Fonts or under any open license); Plus Jakarta
     Sans is the standard open-source stand-in with the same geometric,
     rounded character. System fonts are the fallback if the webfont fails
     to load. */
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, .sico:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
#site-head {
  padding-top: 56px;
  padding-bottom: 24px;
}
#site-head .row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 28px;
  align-items: center;
}
#profile-pic img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: block;
}

#profile-desc h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
#profile-desc h2 {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  font-size: 17px;
  margin: 6px 0 14px;
}
#socials { display: flex; gap: 16px; }
.sico { width: 20px; height: 20px; opacity: 0.75; transition: opacity 0.15s; }
.sico:hover { opacity: 1; }

/* desktop menu */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}
#site-nav .container {
  display: flex;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active { color: var(--ink); border-bottom-color: var(--accent); }

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

@media (max-width: 560px) {
  #site-head .row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  #socials { justify-content: center; }
  #site-nav { display: none; }
}

/* mobile bottom menu */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mnav-link {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  color: var(--muted);
  font-size: 11px;
}
.mnav-link svg { width: 22px; height: 22px; }
.mnav-link:hover { text-decoration: none; color: var(--ink); }
.mnav-link.active { color: var(--accent); }

@media (max-width: 560px) {
  #mobile-nav { display: flex; }
  body { padding-bottom: 62px; }
  #contact { padding-bottom: 24px; }
}

hr {
  border: none;
  height: 1px;
  margin: 40px 0;
  background: linear-gradient(to right, transparent, var(--line) 20%, var(--line) 80%, transparent);
}

/* section titles */
.section-title {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}

#bio, #timeline, #projects, #publications, #gallery { scroll-margin-top: 80px; }
@media (max-width: 560px) {
  #bio, #timeline, #projects, #publications, #gallery { scroll-margin-top: 20px; }
}

#bio { font-size: 16px; color: var(--ink); margin-bottom: 48px; }
.bio-text { max-width: 640px; }

/* timeline */
#timeline { margin-bottom: 56px; }

.entry {
  display: grid;
  grid-template-columns: 68px 60px 1fr;
  gap: 16px;
  margin-bottom: 28px;
  min-width: 0;
}
.timespan {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  text-align: right;
  padding-top: 3px;
  white-space: nowrap;
}
.entry-icon {
  position: relative;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}
.entry-dot {
  position: absolute;
  top: 4px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
  border: 2px solid var(--bg);
}
.entry-icon img { width: 44px; height: 44px; border-radius: 8px; display: block; }
.desc { font-size: 15.5px; padding-top: 1px; min-width: 0; overflow-wrap: break-word; }
.desc strong { font-weight: 600; }

.company-name { font-weight: 600; }
.sub-timeline {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sub-entry {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  min-width: 0;
}
.sub-timespan {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  padding-top: 2px;
}
.sub-desc { font-size: 14px; color: var(--muted); min-width: 0; overflow-wrap: break-word; }
.sub-desc strong { font-weight: 600; color: var(--ink); }

@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; }
  .timespan { text-align: left; }
  .entry-icon { border-left: none; padding-left: 0; }
  .entry-dot { display: none; }
  .sub-entry { grid-template-columns: 1fr; gap: 2px; }
}

/* projects */
#projects { margin-bottom: 56px; }
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 769px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.card img { width: 100%; border-radius: 5px; display: block; }
.card-title { font-weight: 600; margin-top: 10px; }
.card-date { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 3px; }
.card-desc { font-size: 14px; color: var(--muted); margin-top: 4px; }
.card-link { display: inline-block; font-size: 14px; margin-top: 8px; }

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

/* publications */
#publications { margin-bottom: 56px; }
.pub {
  font-size: 14px;
  border-left: 4px solid var(--line);
  padding: 4px 0 4px 14px;
  margin-bottom: 14px;
}
.pub-title { display: inline; font-weight: 600; }
.pub-title a,
.ext-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.pub-title a:hover,
.ext-link:hover { text-decoration-color: var(--accent); }
.pub-title a:focus-visible,
.ext-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.pub-venue { display: inline; color: var(--accent); margin-left: 6px; }
.pub-authors { display: block; color: var(--muted); margin-top: 2px; }
.pub-desc { display: block; color: var(--ink); margin-top: 6px; font-size: 14.5px; }

/* gallery */
#gallery { margin-bottom: 56px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gitem img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; display: block; }

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* footer */
#contact {
  padding-bottom: 64px;
  color: var(--muted);
  font-size: 15px;
}
