:root {
  color-scheme: light;
  --background: #f8f9fc;
  --surface: #fff;
  --ink: #172033;
  --muted: #4b576d;
  --line: #dce2ec;
  --blue: #1f4bb8;
  --blue-dark: #193a8b;
}

* { box-sizing: border-box; }

body {
  background: var(--background);
  color: var(--ink);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--blue); }

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.frame {
  width: min(calc(100% - 3rem), 56rem);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner, .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-inner { min-height: 4.5rem; }

.wordmark {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.links { display: flex; gap: 1.25rem; }

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.links a:hover, .links a[aria-current] {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.hero { padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem); }

.intro-label {
  margin-bottom: 0.45rem;
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 650;
}

h1, h2 {
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.45rem);
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  letter-spacing: -0.035em;
}

.lede {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.65rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 6px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.button-primary { background: var(--blue); color: var(--surface); }

.button-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }

.button-secondary { border-color: var(--line); background: var(--surface); }

.button-secondary:hover { border-color: var(--blue); background: #eef3ff; }

.about {
  padding-block: 1.8rem 4rem;
  border-top: 1px solid var(--line);
}

.about h2 { margin-bottom: 1rem; }

.about p {
  max-width: 65ch;
  line-height: 1.75;
}

.about p + p { margin-top: 1rem; }

.project-card {
  padding: clamp(1.15rem, 4vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-card p { margin-top: 0.55rem; color: var(--muted); }

.project-card h2 {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  letter-spacing: -0.025em;
}

.project-card h2 a { text-underline-offset: 0.2em; }
.project-card h2 a:hover { color: var(--blue-dark); }
.project-card .project-tech { margin-top: 1rem; font-size: 0.875rem; }

.footer-inner a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.footer-inner a:hover { color: var(--blue-dark); }

.page-heading { padding-block: clamp(3rem, 8vw, 5.5rem) 1.6rem; }

.posts {
  display: grid;
  gap: 1rem;
  padding-bottom: 4rem;
}

.project-detail { padding-bottom: 3.5rem; }

.back-link {
  display: inline-block;
  margin-bottom: 0.9rem;
  text-underline-offset: 0.2em;
}

.project-visual {
  padding: clamp(1rem, 4.5vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  animation: visual-appear 350ms ease-out both;
}

.typing-visual { background: #eaf1ff; }

.keyboard {
  display: grid;
  width: min(100%, 31rem);
  margin-inline: auto;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(0.125rem, 0.75vw, 0.45rem);
}

.keyboard span {
  display: grid;
  min-height: clamp(1.5rem, 4.5vw, 2.55rem);
  place-items: center;
  border: 1px solid #c6d3eb;
  border-radius: 4px;
  background: var(--surface);
  font: 650 clamp(0.73rem, 2vw, 1rem)/1 ui-monospace, monospace;
}

.keyboard .home-key { background: var(--blue); color: var(--surface); }

.project-visual figcaption {
  max-width: 62ch;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.catalogue-visual { background: #edf5f3; }

.catalogue-visual h2 { font-size: 1.35rem; }

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.catalogue-grid div {
  padding: 0.7rem;
  border: 1px solid #cbded9;
  border-radius: 6px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.catalogue-grid dt { font-size: 0.875rem; color: var(--muted); }
.catalogue-grid dd { font-weight: 650; }

.project-notes {
  display: grid;
  gap: 1.35rem;
  margin-top: 1.8rem;
}

.project-notes h2 { margin-bottom: 0.4rem; font-size: 1.25rem; }
.project-notes p { max-width: 65ch; }

.archive-note {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@keyframes visual-appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-footer { border-top: 1px solid var(--line); }

.footer-inner {
  min-height: 4.25rem;
  padding-block: 0.9rem;
  color: var(--muted);
}

.footer-divider { margin-inline: 0.22rem; }

.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  inset: 0.5rem auto auto 0.5rem;
  z-index: 1;
  padding: 0.5rem;
  background: var(--surface);
}

@media (min-width: 640px) {
  .posts, .project-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .frame { width: calc(100% - 2rem); }
  .header-inner { gap: 0.65rem; font-size: 0.9rem; }
  .links { gap: 0.75rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .project-visual { animation: none; }
}
