/* ajinkyamawal.com — iteration 0 */

:root {
  --bg: #f8f5ef;
  --fg: #1c1a17;
  --muted: #6e675d;
  --line: #e4ddd0;
  --accent: #9a4a2a;
  --accent-soft: #f1e3da;
  --code-bg: #efe9df;
  --measure: 40rem;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311;
    --fg: #ebe6dc;
    --muted: #9a9387;
    --line: #2b2825;
    --accent: #e2976f;
    --accent-soft: #2e2320;
    --code-bg: #1f1c19;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #151311;
  --fg: #ebe6dc;
  --muted: #9a9387;
  --line: #2b2825;
  --accent: #e2976f;
  --accent-soft: #2e2320;
  --code-bg: #1f1c19;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.25rem 0;
  margin-bottom: 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

header.site.scrolled { border-bottom-color: var(--line); }

header.site .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.005em;
}

nav.primary {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

nav.primary a {
  color: var(--muted);
  text-decoration: none;
}

nav.primary a:hover,
nav.primary a[aria-current="page"] {
  color: var(--fg);
}

nav.primary a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
}

/* Main */

main {
  flex: 1;
  padding-bottom: 3rem;
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 1.9rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.25rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.25rem; }

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms ease;
}

a:hover { color: var(--accent); }

.meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Small inline tag next to a name, e.g. a funding note */
a.pill {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.05em 0.6em;
  margin-left: 0.15em;
  vertical-align: 0.15em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}

a.pill:hover {
  color: var(--accent);
  border-color: var(--accent);
}

h2 a.pill { font-weight: 400; vertical-align: 0.35em; }

/* Lists of things */

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

ul.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0.5rem;
  margin: 0 -0.5rem;
  border-top: 1px solid var(--line);
  border-radius: 4px;
  transition: background-color 120ms ease;
}

ul.list li:has(> a):hover { background: var(--accent-soft); }

ul.list li:last-child { border-bottom: 1px solid var(--line); }

ul.list li a { text-decoration: none; }
ul.list li a:hover { text-decoration: underline; }

ul.list .meta { white-space: nowrap; }

ul.list .soon { color: var(--muted); }

@media (max-width: 480px) {
  ul.list li { flex-direction: column; gap: 0.1rem; }
  ul.list .meta { white-space: normal; }
}

/* Prose bullets */

ul.prose {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

ul.prose li { margin-bottom: 0.4rem; }

/* Entries on work and projects pages */

.entry { margin-top: 2.25rem; }
.entry:first-of-type { margin-top: 0; }

.entry h2 { margin-top: 0; }

.entry .meta { display: block; margin-bottom: 0.6rem; }

.tags {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
}

/* Portrait beside a paragraph */

.with-portrait {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.with-portrait p { margin-top: 0.2rem; }

.portrait {
  flex: 0 0 auto;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  border: 1px solid var(--line);
}

.portrait.small { width: 4.5rem; height: 4.5rem; margin-bottom: 1rem; }

@media (max-width: 520px) {
  .with-portrait { flex-direction: column; gap: 1rem; }
}

/* Articles */

article time { color: var(--muted); }

article h1 + .meta { display: block; margin: -0.75rem 0 1.5rem; }

blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code { background: none; padding: 0; font-size: inherit; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
}

footer.site .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

footer.site .links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

footer.site a {
  color: var(--muted);
  text-decoration: none;
}

footer.site a:hover { color: var(--fg); }

button.theme {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}

button.theme:hover { color: var(--fg); border-color: var(--muted); }

/* Utilities */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

::selection { background: var(--accent-soft); }
