/* praneetdhoolia.github.io — shared stylesheet for the index and every post artifact.
   Self-contained by design: system font stacks only, no remote fonts, no CDN, no trackers.
   Light and dark are both first-class, driven by prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", "Segoe UI Mono",
          Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #18181b;
  --muted: #52525b;
  --faint: #7a7a85;
  --line: #e4e4e7;
  --accent: #2f5fd0;
  --accent-hover: #1e40af;
  --accent-wash: #eef2fd;
  --code-ink: #9d3b6b;
  --code-bg: #f4f4f5;
  --pre-bg: #1c1c21;
  --pre-ink: #e7e7ea;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.05);

  --measure: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101013;
    --surface: #17171b;
    --ink: #ececef;
    --muted: #a6a6b0;
    --faint: #85858f;
    --line: #2a2a31;
    --accent: #8ab0ff;
    --accent-hover: #adc6ff;
    --accent-wash: #1a2135;
    --code-ink: #f0a8c8;
    --code-bg: #202027;
    --pre-bg: #08080a;
    --pre-ink: #e2e2e6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- shared label type ---------- */

.eyebrow,
.meta,
.tag,
.date,
.pn,
.site-footer {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- site header (post + about pages) ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-header .home {
  font-weight: 650;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-header .home:hover { color: var(--accent); }
.site-header nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

/* ---------- masthead (index + series landing) ---------- */

.masthead { padding: 76px 0 40px; }
.masthead .kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.masthead h1 {
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 18px;
}
.masthead .standfirst {
  font-size: 19px;
  color: var(--muted);
  max-width: 56ch;
  margin: 0;
}
.masthead .links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 26px 0 0;
  font-size: 15px;
}

/* ---------- index note list ---------- */

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.note {
  padding: 36px 0 34px;
  border-bottom: 1px solid var(--line);
}
.note .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  color: var(--faint);
  margin: 0 0 12px;
}
.note .tag { color: var(--accent); font-weight: 700; }
.note .tag.series {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
}
.note h2 {
  font-size: clamp(23px, 3.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.018em;
  font-weight: 680;
  margin: 0 0 10px;
}
.note h2 a { color: inherit; text-decoration: none; }
.note h2 a:hover { color: var(--accent); }
.note .summary {
  margin: 0;
  color: var(--muted);
  max-width: 64ch;
}

/* ---------- series landing: the arc, then the parts as cards ---------- */

.arc {
  margin: 0 0 34px;
  padding: 20px 22px;
  background: var(--accent-wash);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.arc .tag {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.arc p:last-child { margin: 0; }

.part-cards {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
a.part {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease;
}
a.part:hover { border-color: var(--accent); }
a.part .part-kicker {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
a.part h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 660;
  margin: 0 0 10px;
}
a.part:hover h2 { color: var(--accent); }
a.part .sum {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
a.part .read {
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

/* ---------- series part list ---------- */

.parts {
  list-style: none;
  margin: 20px 0 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--line);
}
.parts li { margin: 0 0 14px; }
.parts li:last-child { margin-bottom: 0; }
.parts .pn {
  display: block;
  color: var(--faint);
  font-size: 11px;
  margin-bottom: 2px;
}
.parts a { font-weight: 550; text-decoration: none; }
.parts a:hover { text-decoration: underline; }
.parts .part-summary {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 62ch;
}

/* ---------- article ---------- */

.post-header {
  padding: 56px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.post-header .eyebrow {
  color: var(--accent);
  margin: 0 0 14px;
}
.post-header .eyebrow a { text-decoration: none; }
.post-header .eyebrow a:hover { text-decoration: underline; }
.post-header h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 16px;
}
.post-header .date { color: var(--faint); margin: 0; }

.post-body { padding-bottom: 8px; }

.post-body h2 {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 680;
  margin: 46px 0 14px;
  padding-top: 6px;
}
.post-body h3 {
  font-size: 19.5px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 660;
  margin: 34px 0 12px;
}
.post-body h4 {
  font-size: 17px;
  font-weight: 660;
  margin: 26px 0 10px;
}
.post-body > h2:first-child,
.post-body > h3:first-child { margin-top: 0; }

.post-body p { margin: 0 0 20px; }
.post-body ul,
.post-body ol { margin: 0 0 20px; padding-left: 26px; }
.post-body li { margin: 0 0 8px; }
.post-body li > ul,
.post-body li > ol { margin: 8px 0 4px; }

.post-body strong { font-weight: 650; }

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.post-body blockquote {
  margin: 0 0 20px;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* inline code */
.post-body code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--code-ink);
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.14em 0.36em;
}

/* code blocks — must scroll inside themselves, never the page */
.post-body pre {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--pre-bg);
  color: var(--pre-ink);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow);
}
.post-body pre code {
  font-family: var(--mono);
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
  white-space: pre;
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 26px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-body iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* wide content scrolls in its own box */
.post-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 15px;
}
.post-body th,
.post-body td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.post-body th { background: var(--code-bg); font-weight: 650; }

/* ---------- prev / next ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1 1 240px;
  text-decoration: none;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 160ms ease;
}
.pager a:hover { border-color: var(--accent); }
.pager .dir {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pager .ttl { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.4; }
.pager a:hover .ttl { color: var(--accent); }
.pager .next { text-align: right; }

/* ---------- about ---------- */

.about-section {
  margin: 0 0 34px;
}
.about-section h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.role { margin: 0 0 22px; }
.role:last-child { margin-bottom: 0; }
.role .role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.role .role-title { font-weight: 650; margin: 0; }
.role .role-when {
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.role .role-where { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.role p:last-child { margin-bottom: 0; }
.role .role-note { margin: 6px 0 0; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 56px;
  padding: 26px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.08em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- small screens ---------- */

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 18px; }
  .masthead { padding: 52px 0 32px; }
  .post-header { padding: 36px 0 24px; }
  .site-header .wrap { flex-wrap: wrap; gap: 8px 16px; }
  .pager .next { text-align: left; }
}
