:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1a1714;
  --muted: #5c5650;
  --accent: #2d5a4a;
  --accent-hover: #234a3d;
  --border: #e8e4de;
  --radius: 10px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --max: 40rem;
  --space: clamp(1rem, 4vw, 1.75rem);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  left: var(--space);
  top: var(--space);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

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

.site-header__inner {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 1rem var(--space);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

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

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

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

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) var(--space);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 1.25rem var(--space);
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  margin-bottom: 2rem;
}

.panel h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.panel p {
  margin: 0 0 1rem;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Markdown article */
.article {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

.article h1,
.article h2,
.article h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  line-height: 1.25;
}

.article h1 {
  font-size: 2rem;
  margin-top: 0;
}

.article h2 {
  font-size: 1.5rem;
}

.article h3 {
  font-size: 1.2rem;
}

.article p {
  margin: 0 0 1em;
}

.article ul,
.article ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.article li {
  margin-bottom: 0.35em;
}

.article a {
  font-family: var(--font-sans);
  font-size: 0.95em;
}

.article code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--border);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.article pre {
  background: var(--ink);
  color: #f5f2ed;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.5;
}

.article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article blockquote {
  margin: 1em 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.status {
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status--error {
  color: #8b2942;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.page-sub {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}

.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: 3rem;
  margin: 0 0 0.5rem;
}

.error-page p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}
