:root {
  --bg: #151515;
  --text: #d2d2d2;
  --strong: #eeeeee;
  --muted: #9a9a9a;
  --line: #333333;
  --accent: #c2925f;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
}

main {
  max-width: 80ch;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }

/* top row: home on the left (inner pages), icons on the right */
.top {
  display: flex;
  align-items: center;
  margin: -24px -10px 24px;
}
.links { display: flex; gap: 4px; margin-left: auto; }
.home,
.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
}
.home:hover,
.links a:hover { color: var(--accent); }

/* homepage intro */
.intro p { max-width: 62ch; }
.intro p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.intro p a:hover { color: var(--strong); }

h1 {
  margin: 0 0 32px;
  font-size: clamp(24px, 6vw, 28px);
  line-height: 1.3;
  font-weight: 700;
  color: var(--strong);
}

h2, h3 { color: var(--strong); font-weight: 700; }
h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.4; }
h3 { margin: 0; font-size: 16px; line-height: 1.5; }

p { margin: 0 0 16px; }
.gap { margin-bottom: 40px; }
.view > p:last-of-type:not(.gap) { margin-bottom: 0; }

h2.plain { margin: 0 0 8px; }

/* FAQ (native details) */
.faq { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover h3 { color: var(--accent); }
.faq .answer { padding: 4px 0 20px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* chapter list on the start view */
.toc { margin-top: 16px; border-bottom: 1px solid var(--line); }
.toc .row { margin: 0; border-top: 1px solid var(--line); }
.toc .row a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
}
.toc .row a:hover { color: var(--accent); }

/* chapter pages */
.chapter h2 { margin-bottom: 28px; }
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--strong);
}
a.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn[aria-disabled="true"] { opacity: 0.35; }

/* with JS: one view at a time. Without JS: everything shows as a plain document. */
.js .view { display: none; }
.js .view.active { display: block; }
html:not(.js) .chapter { margin-top: 56px; }
html:not(.js) .pager { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: auto; }
}

/* homepage entries: link, then its sentence */
.intro .item { margin-bottom: 4px; }
.intro .gap { margin-bottom: 32px; }
.intro p.gap + .item { margin-top: 0; }

/* resume */
.cv .role, .cv .project { margin-bottom: 28px; }
.cv .role h3, .cv .project h3 { margin-bottom: 2px; }
.cv .meta { margin: 0 0 8px; color: var(--muted); }
.cv ul { margin: 0; padding-left: 2ch; }
.cv li { margin-bottom: 4px; }
.cv h2 { margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.cv .sub { margin: 0 0 32px; color: var(--muted); }
.cv .skills { margin: 0 0 8px; }
.cv .skills b { color: var(--strong); }
.cv a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* homepage: icons sit below the intro, aligned with the text */
.links.head { margin: -16px 0 24px -10px; }

/* homepage dates */
.intro .date { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.intro .item { margin-bottom: 0; }

/* page title with a date underneath */
h1.has-date { margin-bottom: 4px; }
.date { margin: 0 0 32px; color: var(--muted); font-size: 13px; line-height: 1.6; }
