/* ============================================================
   Roshan Dhakal — personal site
   Palette: ink #1a1a1c · teal accent #1f6f6b · hairline #e6e6e8
   Type: Source Serif 4 (display) · Inter (body) · JetBrains Mono (data)
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf9;
  --ink: #1a1a1c;
  --muted: #6a6f76;
  --line: #e6e6e8;
  --accent: #1f6f6b;
  --accent-dark: #14504d;
  --tint: rgba(31, 111, 107, 0.08);
  --wrap: 900px;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }

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

.wrap { width: min(var(--wrap), calc(100% - 44px)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 62px;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.22rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }

.nav-menu { display: flex; align-items: center; gap: 22px; }

.nav-menu a {
  font-size: 0.94rem; font-weight: 500; color: var(--muted);
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-menu a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--line); }
.nav-menu a.is-current { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 12px; font: inherit; font-size: 0.86rem; color: var(--ink); cursor: pointer;
}

/* ---------- Page shell ---------- */

main { padding: 54px 0 24px; }

h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.015em; }

.page-title {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 600; line-height: 1.12;
}

.page-lede { margin: 0 0 34px; color: var(--muted); font-size: 1.02rem; max-width: 62ch; }

.section { margin-top: 56px; }

.section-title {
  margin: 0 0 18px;
  font-size: 1.5rem; font-weight: 600; text-transform: lowercase;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}

/* ---------- Intro (about page) ---------- */

.intro { display: grid; grid-template-columns: 1fr 268px; gap: 44px; align-items: start; }

.intro h1 { margin: 0 0 4px; font-size: clamp(2.3rem, 6vw, 3.1rem); font-weight: 600; line-height: 1.06; }

.tagline {
  margin: 0 0 26px; color: var(--muted);
  font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.02em;
}

.intro-text p { margin: 0 0 17px; }
.intro-text p:last-child { margin-bottom: 0; }

.portrait {
  border-radius: 12px; border: 1px solid var(--line);
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
}

.portrait-note {
  margin: 12px 0 0; text-align: center;
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.01em;
}

.social {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin: 14px 0 0; padding: 0; list-style: none;
}
.social a { display: inline-flex; color: var(--muted); }
.social a:hover { color: var(--accent); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft);
  font-size: 0.9rem; font-weight: 500; color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ---------- Figures ---------- */

.figure { margin: 0; }
.figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; }
.figure figcaption {
  margin-top: 10px; color: var(--muted);
  font-size: 0.88rem; line-height: 1.5; text-align: center;
}

.figure-wide { max-width: 620px; margin-inline: auto; }

/* ---------- News ---------- */

.news { margin: 0; padding: 0; list-style: none; }

.news li {
  display: grid; grid-template-columns: 132px 1fr; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.news li:last-child { border-bottom: 0; }

.news-date {
  font-family: var(--mono); font-size: 0.79rem; color: var(--muted);
  letter-spacing: 0.01em; padding-top: 3px; white-space: nowrap;
}

.news-body { margin: 0; }
.news-body strong { font-weight: 600; }

.news-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--tint); color: var(--accent-dark);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
  vertical-align: 2px;
}

/* ---------- Entry list (publications, research, projects) ---------- */

.entries { display: grid; gap: 34px; }

.entry { display: grid; grid-template-columns: 232px 1fr; gap: 28px; align-items: start; }

.entry-media {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--bg-soft);
}
.entry-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: 8px; }

.entry-title { margin: 0 0 6px; font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.entry-title a { color: var(--ink); }
.entry-title a:hover { color: var(--accent); }

.entry-authors { margin: 0 0 3px; font-size: 0.94rem; color: var(--muted); }
.entry-authors .me { color: var(--ink); font-weight: 600; }

.entry-venue {
  margin: 0 0 10px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.01em;
}

.entry-body { margin: 0 0 12px; font-size: 0.97rem; color: #3f444b; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }

.links a {
  padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 0.73rem; letter-spacing: 0.02em; color: var(--muted);
}
.links a:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); text-decoration: none; }

/* ---------- Directions list ---------- */

.directions { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }

.direction { padding-left: 18px; border-left: 2px solid var(--line); }
.direction h3 { margin: 0 0 5px; font-size: 1.04rem; font-weight: 600; }
.direction p { margin: 0; font-size: 0.96rem; color: #3f444b; }

/* ---------- Facts list ---------- */

.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.facts li { display: grid; grid-template-columns: 132px 1fr; gap: 20px; }
.facts dt, .facts .label {
  font-family: var(--mono); font-size: 0.79rem; color: var(--muted); padding-top: 2px;
}

/* ---------- Contact ---------- */

.contact-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.contact-lines li { display: grid; grid-template-columns: 132px 1fr; gap: 20px; }
.contact-lines .label { font-family: var(--mono); font-size: 0.79rem; color: var(--muted); }

/* ---------- Footer ---------- */

.footer {
  margin-top: 72px; padding: 26px 0 42px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.86rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  main { padding-top: 36px; }

  .nav-toggle { display: block; }

  .nav-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 6px 22px 14px;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { width: 100%; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-menu a.is-current { border-bottom-color: var(--accent); }

  .intro { grid-template-columns: 1fr; gap: 28px; }
  .intro-media { max-width: 250px; margin-inline: auto; }

  .entry { grid-template-columns: 1fr; gap: 16px; }
  .entry-media { max-width: 340px; }

  .news li, .facts li, .contact-lines li { grid-template-columns: 1fr; gap: 4px; }
  .news-date { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
