/* swapnilb222.github.io: one stylesheet, light by default, dark via prefers-color-scheme. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-2: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e6e5e1;
  --accent: #1f4fd1;
  --accent-soft: #eef2fd;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315;
    --surface: #1a1b1e;
    --text: #ececea;
    --text-2: #c9c9c6;
    --muted: #9a9a96;
    --line: #2c2d31;
    --accent: #8fb0ff;
    --accent-soft: #1d2540;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 650; margin-top: 2.6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
time, .meta { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; min-height: 60px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  color: var(--text-2); text-decoration: none; border-radius: 8px; font-size: .95rem;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 3.5rem; padding-top: 2.5rem; padding-bottom: 3rem; }
main { max-width: 72ch; }

/* ---------- sidebar ---------- */
.profile { position: sticky; top: 1.5rem; align-self: start; }
.profile picture img { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.profile .name { font-size: 1.3rem; font-weight: 700; margin: 1rem 0 .15rem; }
.profile .role { color: var(--text-2); margin: 0 0 .1rem; line-height: 1.45; font-size: .95rem; }
.profile .org { color: var(--muted); font-size: .9rem; line-height: 1.45; margin-bottom: .9rem; }
.links { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.links li { display: flex; align-items: center; gap: .55rem; min-height: 36px; color: var(--text-2); }
.links a { color: var(--text-2); text-decoration: none; }
.links a:hover { color: var(--accent); text-decoration: underline; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }

/* ---------- home ---------- */
.lede { font-size: 1.2rem; color: var(--text-2); margin-top: -.2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0 .5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1.1rem;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #0e1530; } }
.btn .icon { color: currentColor; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.stats li { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: .9rem 1rem; }
.stats b { display: block; font-size: 1.55rem; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: .35rem; }

/* focus-area tree */
.tree { margin-top: 1.2rem; }
.tree-root {
  width: fit-content; margin: 0 auto; padding: .6rem 1.2rem; border: 1px solid var(--accent);
  border-radius: 999px; background: var(--accent-soft); font-weight: 650; text-align: center;
}
.tree-branches { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; margin-top: 1.25rem; padding: 0; list-style: none; }
.tree-branches::before { content: ""; position: absolute; left: 50%; top: -1.25rem; bottom: 1.5rem; border-left: 1px solid var(--line); }
.branch { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.1rem .6rem; }
.branch::before { content: ""; position: absolute; top: 1.5rem; width: .75rem; border-top: 1px solid var(--line); }
.branch:nth-child(odd)::before { right: calc(-.75rem - 1px); }
.branch:nth-child(even)::before { left: calc(-.75rem - 1px); }
.branch h3 { font-size: 1rem; margin-bottom: .5rem; }
.branch ul { list-style: none; padding: 0; margin: 0; }
.branch li { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .93rem; line-height: 1.45; }
.branch li:first-child { border-top: 0; }
.branch li a { color: var(--text); text-decoration: none; }
.branch li a:hover { color: var(--accent); text-decoration: underline; }
.tag { flex: none; display: inline-block; padding: 0 .45rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: .76rem; font-weight: 600; white-space: nowrap; vertical-align: 1px; }

/* news */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; }
.more { display: inline-block; margin-top: .6rem; font-weight: 600; }

/* ---------- projects / experience ---------- */
.project, .job { padding: 1.3rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
h2 + .project, h2 + .job { border-top: 0; padding-top: .4rem; }
.project h3, .job h3 { margin-bottom: .15rem; }
.project .meta, .job .meta { margin: 0 0 .6rem; }
.project ul, .job ul { margin: .4rem 0 .6rem; }
.project li, .job li { margin: .25rem 0; }
.figures { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .7rem; padding: 0; list-style: none; }
.figures li { margin: 0; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 6px; font-size: .86rem; color: var(--text-2); background: var(--surface); }
.figures b { color: var(--text); }
.stack { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin: 0; }
.intro { color: var(--text-2); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .6rem 0 1rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.skills { display: grid; grid-template-columns: 11rem 1fr; gap: .4rem 1rem; margin: 0; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--text-2); }

.pubs { padding-left: 1.4em; }
.pubs li { margin: 0 0 1rem; padding-left: .3rem; }
.pubs .venue { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 1.5rem 0 2.5rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.5rem; }
  .profile { position: static; display: grid; grid-template-columns: 96px 1fr; gap: 0 1.1rem; align-items: center; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
  .profile picture img { width: 96px; height: 96px; }
  .profile .name { margin-top: 0; }
  .profile .links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin-top: .6rem; }
  .profile .loc { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 2rem; }
  .wrap { padding: 0 1.1rem; }
  .topbar .wrap { padding-top: .4rem; padding-bottom: .2rem; }
  .nav { margin-left: -.75rem; }
  .tree-branches { grid-template-columns: 1fr; margin-top: 1rem; padding-left: 1rem; border-left: 1px solid var(--line); margin-left: 1rem; }
  .tree-branches::before, .branch::before { display: none; }
  .tree-root { margin: 0; }
  .news li { grid-template-columns: 1fr; gap: .1rem; }
  .skills { grid-template-columns: 1fr; }
  .wide-task th:nth-child(2), .wide-task td:nth-child(2) { display: none; }
  .skills dd { margin-bottom: .6rem; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-2: #222; --muted: #555; --line: #ccc; --accent: #000; }
  body { font-size: 11pt; }
  .topbar, .skip, .cta, .site-footer ul, .more { display: none !important; }
  .layout { display: block; padding: 0; }
  .profile { position: static; display: flex; gap: 1rem; align-items: center; border-bottom: 1px solid #ccc; margin-bottom: 1rem; }
  .profile picture img { width: 72px; height: 72px; }
  main { max-width: none; }
  a { color: inherit; text-decoration: none; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; word-break: break-all; }
  .project, .job, .branch, .stats li { break-inside: avoid; }
}
