/* Prashant Bhusal — portfolio. Dark by default, light via toggle. */

:root {
  --bg: #121212;
  --surface: #1a1a1a;
  --text: #e8e8e6;
  --muted: #9a9a96;
  --line: #2c2c2a;
  --accent: #d8d8d4;
  --focus: #8ab4f8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fafaf8;
  --surface: #f0f0ed;
  --text: #1c1c1b;
  --muted: #62625e;
  --line: #dcdcd7;
  --accent: #2a2a28;
  --focus: #1a5fd0;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

a { color: var(--text); text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }

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

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 24px; padding-top: 18px; padding-bottom: 18px;
}
.brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; text-decoration: none; margin-right: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.92rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

.theme-toggle {
  font: inherit; font-size: 0.85rem; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }

/* Main */
main { padding: 56px 0 72px; }

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 2.7rem); letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-top: 48px; margin-bottom: 12px; }
p { margin: 0 0 16px; max-width: 62ch; }
.lead { color: var(--muted); font-size: 1.1rem; margin-top: 8px; }

/* Intro */
.hero { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.portrait {
  position: relative; width: 168px; height: 168px; flex: none;
  border-radius: 50%; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 2.6rem; color: var(--muted);
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button {
  display: inline-block; text-decoration: none; font-size: 0.95rem;
  padding: 9px 18px; border: 1px solid var(--text); border-radius: 4px;
}
.button.primary { background: var(--text); color: var(--bg); }
.button:hover { opacity: 0.85; }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px; font-size: 0.92rem; }

dl.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* Project list on intro */
.project-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.project-list li { border-bottom: 1px solid var(--line); }
.project-list a {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  padding: 16px 0; text-decoration: none;
}
.project-list a:hover .p-title { text-decoration: underline; text-underline-offset: 3px; }
.p-title { font-family: var(--serif); font-size: 1.1rem; }
.p-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Project page */
.meta { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }
.back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: 0.92rem; text-decoration: none; }
.back:hover { color: var(--text); }
ul.plain { padding-left: 1.2em; margin: 0 0 16px; max-width: 62ch; }
ul.plain li { margin-bottom: 6px; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.pager a { text-decoration: none; color: var(--muted); }
.pager a:hover { color: var(--text); }

/* Report content on project pages */
.note { color: var(--muted); font-size: 0.92rem; max-width: 62ch; }
figure.fig { margin: 24px 0 8px; }
figure.fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
figure.fig figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; max-width: 62ch; }
dl.results { margin: 0 0 16px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; max-width: 62ch; }
dl.results dt { color: var(--muted); }
dl.results dd { margin: 0; }
@media (max-width: 520px) {
  dl.results { grid-template-columns: 1fr; gap: 0; }
  dl.results dd { margin-bottom: 10px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  main { padding-top: 40px; }
  .portrait { width: 132px; height: 132px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 10px; }
  .p-date { display: none; }
}
