:root {
  /* Clean neutral light theme (no warm tint) */
  --paper: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --faint: #e6e6e6;
  --hairline: #ececec;
  --underline: color-mix(in srgb, var(--ink) 32%, transparent);
  --maxw: 43.25rem;   /* aadityan --max-width-page */
}
@media (prefers-color-scheme: dark) {
  :root {
    /* aadityan's exact colors: bg 16/16/16, fg 238, muted 184 */
    --paper: #101010;
    --ink: #eeeeee;
    --muted: #b8b8b8;
    --faint: #2a2a2a;
    --hairline: #262626;
  }
}
:root[data-theme="light"] {
  --paper: #ffffff; --ink: #111111; --muted: #6b6b6b; --faint: #e6e6e6; --hairline: #ececec;
}
:root[data-theme="dark"] {
  --paper: #101010; --ink: #eeeeee; --muted: #b8b8b8; --faint: #2a2a2a; --hairline: #262626;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;          /* 16px */
  line-height: 1.625;       /* 26px on 16px */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Centered column, left-aligned content — aadityan mx-auto max-w-page px-page-x py-page-y */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: left;
}
@media (min-width: 640px) {
  .wrap { padding: 6rem 1.5rem; }
}

/* ---- Dark/light toggle ---- */
#theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}
#theme-toggle:hover { color: var(--ink); }
#theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#theme-toggle svg { width: 18px; height: 18px; display: block; }

/* Icon reflects the ACTIVE theme — mirror the same cascade as the color tokens.
   Light → show moon (click to go dark). Dark → show sun (click to go light). */
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  #theme-toggle .icon-sun { display: block; }
  #theme-toggle .icon-moon { display: none; }
}
:root[data-theme="light"] #theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] #theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  body, #theme-toggle, a { transition: none; }
}

/* ---- Links: aadityan .article-underline ---- */
a {
  color: var(--ink);
  font-weight: 500;
  text-decoration-line: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--underline);
  transition: text-decoration-color 0.2s ease-out, color 0.2s ease-out;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Name (landing) ---- */
h1 {
  font-size: 1.5rem;        /* bigger than the section headings */
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 1.25rem;
}

/* ---- Landing ---- */
.intro { margin: 0; color: var(--muted); }
.intro p { margin: 0; }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;               /* aadityan gap-4 */
  margin-top: 1rem;        /* mt-4 */
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;             /* gap-2 */
  margin-top: 3rem;        /* mt-12 */
}
.sections a { width: fit-content; }
@media (min-width: 640px) {
  .sections { margin-top: 4rem; }   /* sm:mt-16 */
}

/* ---- Sub-page header ---- */
.pagehead { margin-bottom: 3rem; }
.home {
  font-weight: 500;
  color: var(--muted);
  text-decoration-color: var(--underline);
}
.home:hover { color: var(--ink); text-decoration-color: var(--ink); }
.page-title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.375;
  margin: 0 0 1.5rem;      /* mb-6 */
}

/* Short intro line under a page title (e.g. Posts) */
.page-intro {
  color: var(--muted);
  margin: -0.75rem 0 1.75rem;
}

/* Individual article title — distinct from section headings */
.article-title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 1.5rem;
}

/* ---- Bulleted lists (projects, commonplace book) ---- */
ul.list { list-style: disc; margin: 0; padding: 0 0 0 1.25rem; }
ul.list > li { margin: 0 0 0.3rem; }
ul.list > li:last-child { margin-bottom: 0; }
ul.list > li::marker { color: var(--muted); }
.desc { color: var(--muted); font-weight: 400; }

/* ---- Post list: bulleted like commonplace/projects; title left, date right ---- */
ul.postlist { list-style: disc; margin: 0; padding: 0 0 0 1.25rem; }
ul.postlist > li { margin: 0 0 0.3rem; }
ul.postlist > li:last-child { margin-bottom: 0; }
ul.postlist > li::marker { color: var(--muted); }
.date { color: var(--muted); font-weight: 400; font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Quotes ---- */
.quotes { display: flex; flex-direction: column; gap: 1.75rem; }
blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--hairline);
}
blockquote p { margin: 0; }
blockquote cite {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---- Article (individual post) ---- */
.article p { margin: 0 0 0.5rem; }
.article p:last-child { margin-bottom: 0; }