:root{
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --bold: #0a2f8a;
  --card: rgba(255,255,255,0.72);
  --card-border: rgba(15,23,42,0.10);
  --border: rgba(15,23,42,0.10);
  --shadow: 0 10px 25px rgba(2,6,23,0.08);
  --radius: 20px;
  --maxw: 1080px;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --pill: rgba(37,99,235,0.10);
  --pill-text: #1d4ed8;
  --code-bg: rgba(15,23,42,0.06);
}

html[data-theme="dark"]{
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --bold: #c4dcff;
  --card: rgba(2,6,23,0.58);
  --card-border: rgba(148,163,184,0.20);
  --border: rgba(148,163,184,0.20);
  --shadow: 0 14px 40px rgba(0,0,0,0.35);
  --link: #60a5fa;
  --link-hover: #93c5fd;
  --pill: rgba(96,165,250,0.16);
  --pill-text: #bfdbfe;
  --code-bg: rgba(148,163,184,0.14);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:transparent;
}

/* Fixed background gradient (prevents banding/discontinuity on scroll) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(56,189,248,0.20), transparent 60%),
    radial-gradient(900px 600px at 100% 30%, rgba(167,139,250,0.18), transparent 55%),
    radial-gradient(900px 700px at 30% 100%, rgba(34,197,94,0.12), transparent 55%),
    linear-gradient(180deg, rgba(248,250,252,1), rgba(255,255,255,1));
}

html[data-theme="dark"] body::before{
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(56,189,248,0.12), transparent 60%),
    radial-gradient(900px 600px at 100% 30%, rgba(167,139,250,0.12), transparent 55%),
    radial-gradient(900px 700px at 30% 100%, rgba(34,197,94,0.08), transparent 55%),
    linear-gradient(180deg, rgba(2,6,23,1), rgba(11,18,32,1));
}

a{color:var(--link); text-decoration:none}
a:hover{color:var(--link-hover); text-decoration:underline}

.skip{
  position:absolute;
  left:-999px;
  top:-999px;
  background:var(--bg);
  border:1px solid var(--card-border);
  padding:10px 12px;
  border-radius:12px;
  box-shadow:var(--shadow);
}
.skip:focus{left:12px; top:12px; z-index:99}
.is-hidden{display:none!important}

.container{max-width:var(--maxw); margin:0 auto; padding:0 20px}

.header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.65);
  border-bottom:1px solid var(--card-border);
}

html[data-theme="dark"] .header{
  background: rgba(2,6,23,0.60);
}
.header__inner{display:flex; align-items:center; justify-content:space-between; padding:12px 0}

.brand{display:inline-flex; gap:10px; align-items:center}
.brand__name{font-weight:700; letter-spacing:-0.02em; font-size:18px; color:var(--bold)}

.nav__toggle{
  display:none;
  border:1px solid var(--card-border);
  background: rgba(255,255,255,0.75);
  padding:8px 12px;
  border-radius:999px;
  font-weight:600;
}
.nav__menu{display:flex; gap:14px; align-items:center}
.nav__menu a{color:var(--muted); font-weight:600; font-size:14px; padding:8px 10px; border-radius:999px}
.nav__menu a:hover{background:rgba(2,6,23,0.04); text-decoration:none; color:var(--text)}

.themeToggle{
  border:1px solid var(--card-border);
  background: rgba(255,255,255,0.75);
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:13px;
  color:var(--muted);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.themeToggle:hover{background:rgba(2,6,23,0.04); color:var(--text)}
.themeToggle svg{width:16px; height:16px}

html[data-theme="dark"] .nav__menu a:hover,
html[data-theme="dark"] .themeToggle:hover{
  background: rgba(148,163,184,0.10);
}

html[data-theme="dark"] .themeToggle{background: rgba(2,6,23,0.55); color: var(--text)}
html[data-theme="dark"] .nav__toggle{background: rgba(2,6,23,0.55); color: var(--text)}

.hero{padding:42px 0 18px}
.hero__grid{
  display:grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap:26px;
  align-items:start;
}
.hero__photoCol{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:flex-start;
}
.hero__photoWrap{
  position:relative;
  width:100%;
  max-width:190px;
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid var(--card-border);
  background:var(--card);
  box-shadow:var(--shadow);
}
.hero__photo{
  width:100%;
  aspect-ratio: 4 / 5;
  height:auto;
  max-height:230px;
  object-fit:cover;
  display:block;
}
.hero__content{padding:4px 0; max-width:92vw;}
.hero__title{margin:0; font-size:30px; letter-spacing:-0.04em; line-height:1.05; color:var(--text)}
.hero__subtitle{margin:10px 0 0; color:var(--muted); font-weight:600}
.hero__about{margin:18px 0 0; color:var(--text); font-size:15px; line-height:1.6}
.hero__about p{margin:0 0 10px}
.hero__sectionTitle{margin:14px 0 6px; font-size:14px; letter-spacing:-0.01em; color:var(--bold)}
.hero__links{display:flex; flex-wrap:wrap; gap:10px; margin-top:14px}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:9px 12px;
  border-radius:999px;
  background:var(--pill);
  color:var(--pill-text);
  font-weight:700;
  font-size:13px;
  border:1px solid rgba(37,99,235,0.18);
}
.pill:hover{filter:brightness(0.98); text-decoration:none}
.pill svg{width:16px; height:16px}

.section{padding:30px 0}
.section__header{display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap}
.section h2{margin:0 0 14px; font-size:22px; letter-spacing:-0.02em; color:var(--bold)}

.segmented{display:inline-flex; border:1px solid var(--card-border); border-radius:999px; background:rgba(255,255,255,0.75); overflow:hidden}
html[data-theme="dark"] .segmented{background: rgba(2,6,23,0.55)}
.segmented__btn{
  border:0;
  background:transparent;
  padding:8px 12px;
  font-weight:700;
  font-size:13px;
  color:var(--muted);
  cursor:pointer;
}
.segmented__btn.is-active{background:rgba(2,6,23,0.06); color:var(--text)}
html[data-theme="dark"] .segmented__btn.is-active{background: rgba(148,163,184,0.12)}

.pubs{display:grid; grid-template-columns:1fr; gap:12px}
.card{
  background:var(--card);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px 16px;
}
.card__title{margin:0; font-size:16px; letter-spacing:-0.01em; color:var(--bold)}
.card__meta{margin-top:8px; color:var(--muted); font-size:13px; line-height:1.5}
.card__links{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap}
.chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--card-border);
  background:rgba(255,255,255,0.72);
  font-weight:700;
  font-size:12px;
  color:var(--text);
}

html[data-theme="dark"] .chip,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .nav__toggle{
  background: rgba(2,6,23,0.55);
  color: var(--text);
}
.chip:hover{text-decoration:none; background:rgba(2,6,23,0.04)}

.timeline{display:grid; grid-template-columns:1fr; gap:12px}
.timelineItem{display:grid; grid-template-columns:1fr; gap:6px}
.timelineItem__top{display:flex; flex-wrap:wrap; gap:10px; align-items:baseline; justify-content:space-between}
.timelineItem__title{font-weight:800; color:var(--bold)}
.timelineItem__dates{color:var(--muted); font-weight:700; font-size:13px}
.timelineItem__sub{color:var(--muted); font-weight:700; font-size:13px}
.timelineItem__bullets{margin:0; padding-left:18px; color:var(--text)}
.timelineItem__bullets li{margin:6px 0; line-height:1.55}

.skills{display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px}
.skillGroup__title{margin:0 0 10px; font-weight:900; font-size:14px; color:var(--bold)}
.skillGroup__items{display:flex; flex-wrap:wrap; gap:8px}
.tag{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--card-border);
  background:rgba(255,255,255,0.72);
  font-weight:700;
  font-size:12px;
  color:var(--text);
}

.honors{display:grid; grid-template-columns:1fr; gap:12px}
.honorRow{display:flex; gap:12px; justify-content:space-between; align-items:baseline; flex-wrap:wrap}
.honorRow__left{font-weight:800}
.honorRow__right{color:var(--muted); font-weight:700; font-size:13px}

.footer{padding:26px 0 40px}
.footer__inner{color:var(--muted); font-weight:700; display:flex; gap:10px; align-items:center; justify-content:center}
.footer__sep{opacity:0.6}

code{background:var(--code-bg); padding:2px 6px; border-radius:8px}

@media (max-width: 820px){
  .hero__grid{grid-template-columns: 1fr;}
  .hero__photo{height:240px}
  .skills{grid-template-columns:1fr}
  .nav__toggle{display:inline-flex}
  .nav__menu{display:none; position:absolute; right:20px; top:58px; flex-direction:column; gap:8px; padding:10px; border-radius:16px; border:1px solid var(--card-border); background:rgba(255,255,255,0.92); box-shadow:var(--shadow)}
  .nav__menu.is-open{display:flex}
}

@media (max-width: 1100px){
  .skills{grid-template-columns:repeat(2, minmax(0,1fr));}
}

html[data-theme="dark"] @media (max-width: 820px){
  .nav__menu{background: rgba(2,6,23,0.80)}
}

/* ---- Publications ---- */
.pubTitleLink{color:var(--text); text-decoration:none}
.pubTitleLink:hover{color:var(--link-hover); text-decoration:underline}
.pubTitleLink.is-disabled{color:var(--muted)}

.note{
  margin:12px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

/* ---- Experience ---- */
.exp{display:grid; grid-template-columns:1fr; gap:12px}
.expSectionTitle{
  margin:8px 0 2px;
  font-size:16px;
  font-weight:900;
  letter-spacing:-0.01em;
  color:var(--bold);
}
.expOrg__top{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between}
.expOrg__right{display:flex; align-items:center; gap:10px}
.expOrg__title{font-weight:900; color:var(--bold)}
.expOrg__dates{color:var(--muted); font-weight:800; font-size:13px}
.expLogo{
  width:56px;
  height:56px;
  border-radius:12px;
  object-fit:contain;
  border:1px dashed var(--border);
  background:rgba(255,255,255,0.6);
  padding:4px;
}
html[data-theme="dark"] .expLogo{background: rgba(0,0,0,0.2);}
.expOrg__focus{margin-top:6px; color:var(--muted); font-weight:700; font-size:13px}
.expProjects{margin-top:10px; display:grid; gap:10px}
.expProject__header{display:flex; justify-content:space-between; gap:10px}
.expProject__label{font-weight:900}
.expProject__title{text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:2px}
.expProject__status{color:var(--muted); font-weight:800; font-size:13px}
.expBullets{margin:8px 0 0; padding-left:18px}
.expBullets li{margin:6px 0; line-height:1.55}


/* Education (school cards with logo slot) */
.eduGrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.eduCard__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; justify-content: space-between; }
.eduLogo { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; border: 1px dashed var(--border); background: rgba(255,255,255,0.6); overflow: hidden; order: 2; margin-left: auto; }
html[data-theme="dark"] .eduLogo { background: rgba(0,0,0,0.2); }
.eduLogo__img { width: 100%; height: 100%; object-fit: contain; }
.eduLogo__placeholder { font-size: 12px; color: var(--muted); }
.eduCard__school { font-weight: 700; order: 1; }
.eduProg { padding: 10px 0; }
.eduProg:first-child { padding-top: 0; }
.eduProg__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.eduProg__degree { font-weight: 600; }
.eduProg__dates { color: var(--muted); font-size: 13px; white-space: nowrap; }
.eduProg__details { margin: 6px 0 0 18px; color: var(--muted); }

/* Links: two rows with a visual break */
.linksRow { display: flex; flex-wrap: wrap; gap: 10px; align-items:center; }
.linksRow--icons { gap: 8px; }
.linksBreak { height: 10px; }

/* Icon-only links */
.linkIcon{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--card-border);
  display:grid;
  place-items:center;
  background:var(--card);
  color:var(--text);
  cursor:pointer;
  transition:transform 120ms ease, box-shadow 120ms ease;
}
.linkIcon:hover{transform:translateY(-1px); box-shadow:var(--shadow);}
.linkIcon__ico svg{width:20px; height:20px;}
.linkIcon--copy{border-style:dashed;}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.20);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 99;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(-4px); }
