*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #fcfcfa;
  --text: #1a1a18;
  --muted: #6e6e66;
  --line: #e4e3dc;
  --accent: #9a5b3d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --text: #e8e6e0;
    --muted: #8b8a82;
    --line: #2b2a27;
    --accent: #c98a68;
  }
}

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

body {
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
  max-width: 48rem;
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 5rem;
  font-size: 0.875rem;
}

.site-nav__brand {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.011em;
}

.site-nav__links {
  display: flex;
  gap: 1rem;
}

.site-nav__links a {
  color: var(--muted);
}

.site-nav__links a[aria-current="page"] {
  color: var(--text);
}

::selection { background: var(--accent); color: var(--bg); }

h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.021em;
  line-height: 1.35;
  text-wrap: pretty;
  margin: 0 0 1rem;
}

h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 2.5rem 0 1rem;
}

p {
  margin: 0 0 0.75rem;
  text-wrap: pretty;
}

.lede {
  max-width: 38rem;
  font-size: 1.1rem;
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.link-card {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.link-card:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-color: var(--accent);
}

.link-card strong {
  font-weight: 600;
}

.link-card span {
  color: var(--muted);
  font-size: 0.875rem;
}

.repo-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo-card {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.repo-card:last-child {
  border-bottom: 1px solid var(--line);
}

.repo-card__heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.repo-card__heading a {
  color: var(--text);
  text-decoration: none;
}

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

.repo-tag {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.repo-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.github-note {
  margin-top: 1.5rem;
}

.project-list {
  display: grid;
  gap: 2.5rem;
}

.project-card {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.project-card__meta {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-card h2 {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: -0.021em;
  text-transform: none;
}

.project-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.project-card h2 a:hover {
  color: var(--accent);
}

.project-card p:last-child {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.photo-generator {
  margin: 1.25rem 0 0;
  text-align: center;
}

.generate-photo {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, opacity .15s ease;
}
.generate-photo:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.generate-photo:disabled {
  cursor: wait;
  opacity: 0.65;
}

.photo-result {
  max-width: 30rem;
  margin: 1rem auto 0;
}
.photo-status {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.photo-result.is-loading .photo-status::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: loading-dots 1.2s steps(4, end) infinite;
}
figure {
  margin: 0;
}
figure img {
  display: block;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
}
figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}
@keyframes loading-dots {
  0%, 20% { content: ""; }
  40% { content: "."; }
  60% { content: ".."; }
  80%, 100% { content: "..."; }
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: r;
  border-top: 1px solid var(--line);
}
ol li {
  counter-increment: r;
  position: relative;
  padding: 1.15rem 0 1.15rem 2.6rem;
  border-bottom: 1px solid var(--line);
}
ol li::before {
  content: counter(r, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-size: 0.75rem;
  line-height: 1.9;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--accent);
}
ol li strong {
  display: block;
  font-weight: 600;
  letter-spacing: -0.011em;
  margin-bottom: 0.15rem;
}
ol li br { display: none; }

dl { margin: 0; border-top: 1px solid var(--line); }
dt {
  font-weight: 600;
  letter-spacing: -0.011em;
  padding-top: 1.15rem;
}
dd {
  margin: 0.15rem 0 0;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

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

.muted {
  color: var(--muted);
  text-wrap: pretty;
}

@media (max-width: 480px) {
  body { padding: 3rem 1.25rem 4rem; }
  h1 { font-size: 1.25rem; }
  h2 { margin-top: 2.5rem; }
  .site-nav { margin-bottom: 3.5rem; }
  .link-grid { grid-template-columns: 1fr; }
}
