/* Sayan Adhikari, personal site. Palette: cool instrument paper, cobalt, electron teal, ion amber. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --alt: #e9edf3;
  --ink: #152238;
  --ink-2: #33415a;
  --muted: #5d6a7e;
  --line: #d6dde7;
  --accent: #2f43c4;
  --accent-ink: #ffffff;
  --electron: #0f97a6;
  --ion: #d98a1c;
  --night: #0f1b2e;
  --night-ink: #e8eef6;
  --focus: #2f43c4;

  --t-industry: #2f43c4;
  --t-space: #0f7d8a;
  --t-lab: #8a4fb8;
  --t-sheath: #b5651d;
  --t-fusion: #b2324b;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --wrap: 72rem;
  --radius-s: 6px;
  --radius-m: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1726; --surface: #152035; --alt: #121c2e; --ink: #e5ebf4; --ink-2: #c3cddb;
    --muted: #93a1b6; --line: #26334b; --accent: #8e9bff; --accent-ink: #0f1726;
    --electron: #3cc8d6; --ion: #f0b04f; --focus: #8e9bff;
    --t-industry: #8e9bff; --t-space: #4fc6d3; --t-lab: #c79bf0; --t-sheath: #eba86a; --t-fusion: #f08097;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1726; --surface: #152035; --alt: #121c2e; --ink: #e5ebf4; --ink-2: #c3cddb;
  --muted: #93a1b6; --line: #26334b; --accent: #8e9bff; --accent-ink: #0f1726;
  --electron: #3cc8d6; --ion: #f0b04f; --focus: #8e9bff;
  --t-industry: #8e9bff; --t-space: #4fc6d3; --t-lab: #c79bf0; --t-sheath: #eba86a; --t-fusion: #f08097;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.5em; font-weight: 650; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.icon-sm { width: 0.95em; height: 0.95em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; border-radius: var(--radius-s); }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 720px) { .wrap { padding-inline: 2rem; } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 650 1.1rem/1 var(--display); color: var(--ink); text-decoration: none; }
.brand__mark { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav__list { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav__list a { display: block; padding: .45rem .75rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .98rem; }
.nav__list a:hover { background: var(--alt); color: var(--ink); }
.nav__list a[aria-current="page"] { color: var(--ink); background: var(--alt); }
.nav__toggle { display: none; }
.theme-toggle { margin-left: .4rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { color: var(--ink); background: var(--alt); }
.theme-toggle__moon { display: none; }
[data-mode="dark"] .theme-toggle__sun { display: none; }
[data-mode="dark"] .theme-toggle__moon { display: inline; }

/* On the home page the bar sits over the dark hero */
.page-home .topbar--over:not(.is-scrolled) { background: transparent; border-color: transparent; backdrop-filter: none; }
.page-home .topbar--over:not(.is-scrolled) .brand,
.page-home .topbar--over:not(.is-scrolled) .nav__list a,
.page-home .topbar--over:not(.is-scrolled) .theme-toggle,
.page-home .topbar--over:not(.is-scrolled) .nav__toggle { color: var(--night-ink); }
.page-home .topbar--over:not(.is-scrolled) .brand__mark { color: var(--electron); }
.page-home .topbar--over:not(.is-scrolled) .nav__list a:hover { background: rgba(255,255,255,.1); }
.page-home .topbar--over:not(.is-scrolled) .theme-toggle { border-color: rgba(255,255,255,.25); }
.page-home .topbar { position: fixed; left: 0; right: 0; }

@media (max-width: 760px) {
  .nav__toggle { display: inline-block; font: 500 .95rem var(--body); background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: .4rem .9rem; cursor: pointer; }
  .page-home .topbar--over:not(.is-scrolled) .nav__toggle { border-color: rgba(255,255,255,.25); }
  .nav__list { display: none; position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem; box-shadow: 0 12px 24px -16px rgba(10,20,40,.35); }
  .nav__list.is-open { display: flex; }
  .nav__list a, .page-home .topbar--over:not(.is-scrolled) .nav__list a { color: var(--ink); padding: .75rem .5rem; border-radius: var(--radius-s); }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.25rem; border-radius: 999px; font: 600 1rem/1 var(--body); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--light { background: var(--night-ink); color: var(--night); }
.btn--light:hover { background: #fff; }
.btn--ghost { color: var(--night-ink); border-color: rgba(232,238,246,.4); }
.btn--ghost:hover { border-color: var(--night-ink); background: rgba(255,255,255,.06); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn--outline:hover { border-color: var(--ink); }
.textlink { font-weight: 600; text-decoration: none; white-space: nowrap; }
.textlink:hover { text-decoration: underline; }

/* Hero: the one bold moment */
.hero { position: relative; min-height: min(100svh, 56rem); background: var(--night); color: var(--night-ink); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; cursor: crosshair; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(15,27,46,.92) 0%, rgba(15,27,46,.55) 38%, rgba(15,27,46,0) 70%); }
.hero__content { padding-top: 8rem; padding-bottom: 2.5rem; pointer-events: none; }
.hero__content a, .hero__content .btn { pointer-events: auto; }
.hero__role { font-weight: 500; color: #b8c6da; margin-bottom: 1.25rem; }
.hero__role a { color: inherit; }
.hero__title { font-size: clamp(3.6rem, 1.6rem + 10vw, 9.5rem); line-height: .88; letter-spacing: -0.045em; font-weight: 780; margin: 0 0 1.75rem;
  font-variation-settings: "opsz" 96; }
.hero__lede { max-width: 38rem; font-size: clamp(1.1rem, 1rem + .45vw, 1.35rem); line-height: 1.5; color: #d6dfeb; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__legend { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.5rem; font-size: .85rem; color: #93a3ba; }
.hero__legend p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.hero__hint { margin-left: .75rem; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
.dot--e { background: #3cc8d6; }
.dot--i { background: #f0b04f; margin-left: .6rem; }
.hero__pause { background: transparent; color: #b8c6da; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: .3rem .8rem; font: 500 .82rem var(--body); cursor: pointer; flex: none; }
.hero__pause:hover { color: #fff; border-color: rgba(255,255,255,.5); }
@media (max-width: 600px) { .hero__hint { display: none; } }

/* Sections */
.section { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.section--alt { background: var(--alt); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.section__head h2 { margin: 0; }

.about { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 860px) { .about { grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: 4rem; } }
.about__photo { margin: 0; max-width: 19rem; }
.about__photo img { border-radius: var(--radius-m); filter: grayscale(1) contrast(1.05); aspect-ratio: 1; object-fit: cover; }
.prose { max-width: 40rem; }
.prose p { color: var(--ink-2); }
.facts { margin: 2rem 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { margin: 0; color: var(--ink-2); }
@media (max-width: 520px) { .facts div { grid-template-columns: 1fr; gap: .1rem; } }

/* Research themes on home */
.themes { display: grid; gap: 2.5rem 3rem; }
@media (min-width: 760px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme { display: grid; grid-template-columns: 3.25rem 1fr; grid-template-rows: auto 1fr; column-gap: 1.25rem; align-items: start; }
.theme > h3, .theme > p { grid-column: 2; }
.theme__glyph { width: 3.25rem; height: 3.25rem; grid-row: 1 / span 2; grid-column: 1; color: var(--accent); }
.theme__glyph svg { width: 100%; height: 100%; }
.theme--plasma .theme__glyph, .theme__glyph.theme--plasma { color: var(--electron); }
.theme--agents .theme__glyph, .theme__glyph.theme--agents { color: var(--ion); }
.theme h3 { margin-bottom: .4rem; font-size: 1.3rem; }
.theme p { margin: 0; color: var(--ink-2); max-width: 34rem; }

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.project { display: grid; gap: .25rem 2rem; padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .project { grid-template-columns: 10rem minmax(0, 1fr); } }
.project__when { margin: .2rem 0 0; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.project h3 { font-size: 1.35rem; margin-bottom: .45rem; }
.project p:last-child { margin: 0; color: var(--ink-2); max-width: 46rem; }

/* Publications */
.publist { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1.25rem; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.pub__year { margin: .15rem 0 0; font: 650 1rem/1.3 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.pub__title { font: 600 1.08rem/1.4 var(--body); letter-spacing: 0; margin: 0 0 .3rem; max-width: 50rem; }
.pub__title a { color: var(--ink); text-decoration: none; }
.pub__title a:hover { color: var(--accent); text-decoration: underline; }
.pub__authors { margin: 0 0 .15rem; color: var(--ink-2); font-size: .95rem; }
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__venue { margin: 0 0 .5rem; color: var(--muted); font-size: .95rem; }
.pub__tags { margin: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { font-size: .78rem; font-weight: 500; padding: .12rem .55rem; border-radius: 999px; border: 1px solid currentColor; line-height: 1.5; }
.tag--industry { color: var(--t-industry); } .tag--space { color: var(--t-space); } .tag--lab { color: var(--t-lab); }
.tag--sheath { color: var(--t-sheath); } .tag--fusion { color: var(--t-fusion); } .tag--type { color: var(--muted); }
.pub.is-hidden { display: none; }
.publist--full .pub:first-child { border-top: 0; }

.filters { position: sticky; top: 4rem; z-index: 5; background: var(--bg); padding: 1rem 0 .75rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); }
.search input { width: 100%; max-width: 32rem; font: 400 1rem var(--body); padding: .7rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; }
.chip { font: 500 .9rem var(--body); padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip__n { opacity: .65; margin-left: .2rem; font-variant-numeric: tabular-nums; }
.filters__count { margin: .6rem 0 0; font-size: .9rem; }
.empty { padding: 2rem 0; color: var(--muted); }
.year-break { list-style: none; padding: 2rem 0 .25rem; font: 650 1.6rem/1 var(--display); color: var(--ink); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline > li { display: grid; gap: .2rem 2rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .timeline > li { grid-template-columns: 10rem minmax(0, 1fr); } }
.timeline__when { margin: 0; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.timeline__what { margin: 0; color: var(--ink-2); }
.timeline__what strong { color: var(--ink); font-weight: 600; }
.timeline__body h3 { margin-bottom: .2rem; font-size: 1.25rem; }
.timeline__org { color: var(--ink-2); margin-bottom: .6rem; }
.timeline__org a { color: inherit; }
.timeline__body ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); max-width: 46rem; }
.timeline__body li + li { margin-top: .3rem; }
.timeline--compact > li { padding: .9rem 0; }

/* Contact */
.contact { background: var(--night); color: var(--night-ink); padding-block: clamp(3.5rem, 2rem + 5vw, 6rem); }
.contact__inner { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 860px) { .contact__inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.contact h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); }
.contact p { color: #c4d0df; max-width: 34rem; margin: 0; }
.contact__links { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
@media (min-width: 860px) { .contact__links { align-items: flex-end; } }

/* Inner pages */
.pagehead { padding: clamp(3rem, 2rem + 4vw, 5rem) 0 2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.pagehead h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.75rem); letter-spacing: -0.035em; font-weight: 780; margin-bottom: 1rem; }
.pagehead__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 42rem; }
.jumpnav { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.pagehead .print-hide { margin: 1.25rem 0 0; }
.jumpnav a { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500; background: var(--surface); }
.jumpnav a:hover { border-color: var(--ink-2); color: var(--ink); }

.research { padding-bottom: 4rem; }
.rtheme { display: grid; gap: 1rem 3rem; padding: 3rem 0; border-bottom: 1px solid var(--line); }
.rtheme:last-child { border-bottom: 0; }
@media (min-width: 860px) { .rtheme { grid-template-columns: 6rem minmax(0, 1fr); } }
.rtheme .theme__glyph { width: 4.5rem; height: 4.5rem; }
.rtheme__summary { font-size: 1.15rem; color: var(--ink-2); max-width: 44rem; }
.rtheme__more { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1.25rem 0 0; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; max-width: 46rem; }
@media (min-width: 900px) { .ticks { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.ticks li { position: relative; padding-left: 1.4rem; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .62em; width: .5rem; height: .5rem; border-radius: 50%; border: 2px solid var(--accent); }
.missions { display: grid; gap: 1.5rem 2.5rem; margin-top: 1rem; }
@media (min-width: 900px) { .missions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.missions p { color: var(--ink-2); font-size: .98rem; }
.links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .92rem; font-weight: 500; }
.codes { list-style: none; margin: 1rem 0 1.25rem; padding: 0; display: grid; gap: .1rem 2.5rem; }
@media (min-width: 760px) { .codes { grid-template-columns: 1fr 1fr; } }
.codes li { display: flex; flex-direction: column; padding: .7rem 0; border-top: 1px solid var(--line); }
.codes a { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.codes a:hover { text-decoration: underline; }
.codes span { color: var(--muted); font-size: .95rem; }

.cv { padding-bottom: 4rem; }
.cv__block { padding: 2.5rem 0 1rem; }
.cv__block > h2 { margin-bottom: 1.25rem; }
.cv__sub { margin: 2rem 0 .75rem; font-size: 1.15rem; }
.cv__block p { max-width: 46rem; color: var(--ink-2); }
.skills { display: grid; gap: 1.75rem 2.5rem; }
@media (min-width: 760px) { .skills { grid-template-columns: 1fr 1fr; } }
.skills h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.pills li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .75rem; font-size: .92rem; color: var(--ink-2); }
.plainlist { list-style: none; margin: 0; padding: 0; max-width: 50rem; }
.plainlist li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.plainlist__k { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.plainlist strong { color: var(--ink); font-weight: 600; }

/* Teaching */
.course { padding-block: 2.5rem 4rem; }
.course__meta { color: var(--muted); }
.lectures { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0 2.5rem; }
@media (min-width: 760px) { .lectures { grid-template-columns: 1fr 1fr; } }
.lecture { padding: 1rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: .75rem; }
.lecture__n { font: 650 1.4rem/1 var(--display); color: var(--accent); }
.lecture h3 { font: 600 1rem/1.35 var(--body); margin: 0 0 .1rem; }
.lecture p { margin: 0 0 .35rem; color: var(--muted); font-size: .9rem; }
.lecture ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .95rem; }
.lecture a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer__name { font: 650 1.1rem var(--display); margin: 0 0 .2rem; }
.footer__inner p { margin: 0; }
.footer__fine { margin-top: 1.5rem; font-size: .85rem; }
.iconlinks { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.iconlinks a { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--ink-2); }
.iconlinks a:hover { color: var(--accent); border-color: var(--accent); }
.iconlinks .icon { width: 1.25rem; height: 1.25rem; }

.notfound { padding-block: 6rem; }

@media print {
  .topbar, .footer, .jumpnav, .print-hide, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .pagehead { padding: 0 0 1rem; }
  .pagehead h1 { font-size: 24pt; }
  a { color: inherit; text-decoration: none; }
  .timeline > li, .cv__block { break-inside: avoid; }
}
