:root {
  /* Dario Amodei palette */
  --bg: #fdfdfc;
  --text: #1f1e1d;
  /* slate dark */
  --text-secondary: #5e5d59;
  /* slate light */
  --border: #d1cfc5;
  /* cloud light */
  --muted: #87867f;
  /* cloud dark */
  --link: #1010ff;
  --serif: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #1a1a1b;
  /* neutral dark, mirrors the cool near-white */
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --border: #2e2e30;
  --muted: #71717a;
  --link: #8ab4ff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--serif);
  background-color: var(--bg);
  color: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: 38.75rem;
  /* narrow container, ~620px */
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5rem;
}

header .name {
  font-weight: 500;
  font-size: 1.6em;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  margin: 0;
}

header a.name:hover {
  color: var(--link);
}

header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.05rem;
}

header nav a:hover {
  color: var(--link);
}

.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--serif);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--muted);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0 0 2em;
}

.tag {
  display: inline-block;
  padding: 0.25em 0.75em;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

h1 {
  font-family: var(--serif);
  font-size: 3.1em;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 0.3em;
}

h2 {
  font-size: 1.6em;
  line-height: 1.2;
  font-weight: 500;
  margin: 2.5em 0 0.5em;
}

h3 {
  font-size: 1.2em;
  line-height: 1.2;
  font-weight: 500;
  margin: 2em 0 0.5em;
}

p {
  margin: 0 0 1em;
}

p.lead {
  font-size: 1.2em;
  line-height: 1.4;
  color: var(--text);
}

strong {
  font-weight: 500;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* Archive list, styled like the essay/post list */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li {
  border-top: 1px solid var(--border);
}

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

.links a.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85em 0;
  color: var(--text);
  text-decoration: none;
}

.links a.row .label {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.links .meta {
  color: var(--muted);
  font-size: 0.9em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Posts list reuses .links but with larger titles */
.posts a.row .label {
  font-size: 1.15em;
}

.posts a.row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.posts .row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.tags-inline .tag {
  font-size: 0.7rem;
  padding: 0.2em 0.6em;
}

/* ── Article (individual post page) ── */
article {
  margin-bottom: 4rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 2.5rem;
}

article p,
article ul,
article ol {
  margin: 0 0 1.2em;
}

article ul,
article ol {
  padding-left: 1.4em;
}

article li {
  margin-bottom: 0.4em;
}

article blockquote {
  margin: 1.5em 0;
  padding: 0.2em 0 0.2em 1.2em;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
  font-style: italic;
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

article pre {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.5;
}

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

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.05rem;
}

.back-link:hover {
  color: var(--link);
}

footer {
  margin-top: 5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .wrap {
    padding: 3.5rem 1.25rem;
  }

  header {
    margin-bottom: 3.5rem;
  }

  h1 {
    font-size: 2.4em;
  }
}
