:root {
  --paper: #f5f0e6;
  --surface: #fffdf8;
  --ink: #26312d;
  --muted: #63706a;
  --line: #c9c1b3;
  --accent: #9b5136;
  --accent-soft: #ead8ca;
  --focus: #b76b26;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

body.dark {
  --paper: #202925;
  --surface: #29342f;
  --ink: #f2eee5;
  --muted: #c4cec6;
  --line: #65736a;
  --accent: #edab86;
  --accent-soft: #493a33;
  --focus: #ffd166;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
}

.site-header,
main,
footer {
  width: min(100% - 2rem, 760px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 2;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.site-name {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

nav a {
  color: var(--muted);
  font-size: 0.9rem;
}

nav a:hover,
nav a:focus-visible,
.project-link:hover,
.project-link:focus-visible,
footer a:hover,
footer a:focus-visible {
  color: var(--accent);
}

.theme-control {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.theme-toggle {
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0.4rem 0.65rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
}

.theme-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}

.theme-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.intro {
  padding: 3.5rem 0 3rem;
}

.section-kicker,
.project-type,
.project-status,
h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.12;
}

h1 {
  max-width: 20ch;
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.15rem, 7vw, 3.6rem);
  letter-spacing: -0.02em;
}

.intro > p:last-child,
.about-section > p {
  max-width: 64ch;
  margin-bottom: 0;
}

.journal-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 1.4rem;
}

h2 {
  max-width: 24ch;
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 5vw, 2.45rem);
  letter-spacing: -0.015em;
}

.build-notes {
  display: grid;
  gap: 1rem;
}

.build-note {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.note-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

h3 {
  margin: 0.2rem 0 0;
  font-size: 1.65rem;
}

.project-status {
  width: fit-content;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
}

.problem {
  margin: 1rem 0;
}

.note-details {
  display: grid;
  gap: 1rem;
}

.note-details section {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

h4 {
  color: var(--ink);
}

ul {
  padding-left: 1.2rem;
}

.note-details ul {
  margin: 0.55rem 0 0;
}

.note-details li + li {
  margin-top: 0.35rem;
}

code {
  padding: 0.05rem 0.22rem;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

.project-link {
  display: inline-block;
  margin-top: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}

.learning-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.learning-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.learning-list strong {
  color: var(--accent);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1.4rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--ink);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (min-width: 720px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .theme-control {
    margin-left: auto;
  }

  .note-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .note-details {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

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