:root {
  color-scheme: light;

  --paper: #f3efe6;
  --paper-raised: #faf7f0;
  --paper-sunken: #eae4d8;
  --ink: #1f1d1a;
  --ink-soft: #4a463f;
  --ink-meta: #6b655b;
  --line: #d6cfc2;
  --line-strong: #b9b0a1;
  --accent: #b23a2f;
  --accent-strong: #963027;
  --accent-ink: #ffffff;
  --pass: #2f6b4f;
  --warn: #8a5a1f;
  --focus: #1f1d1a;

  --font-display: "Shippori Mincho", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --motion-fast: 150ms;
  --motion-slow: 160ms;
  --scroll-behavior: smooth;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #191817;
  --paper-raised: #211f1d;
  --paper-sunken: #141312;
  --ink: #f0ebe1;
  --ink-soft: #c9c2b6;
  --ink-meta: #a39b8d;
  --line: #3a3632;
  --line-strong: #4e4943;
  --accent: #e0604f;
  --accent-strong: #ef7a6a;
  --accent-ink: #191817;
  --pass: #8cc4a6;
  --warn: #d6a05c;
  --focus: #f0ebe1;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: var(--scroll-behavior);
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.7rem + 3.4vw, 4.4rem);
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.6rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  text-wrap: pretty;
}

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

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

.shell {
  width: min(calc(100% - (var(--gutter) * 2)), var(--shell));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--accent);
}

.section-label::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.lede {
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
}

.muted {
  color: var(--ink-meta);
}

.mono {
  font-family: var(--font-mono);
}

.icon {
  flex: none;
}

.icon-slot {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
}

.noscript {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-sunken);
  font-size: 0.88rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0.01ms;
    --motion-slow: 0.01ms;
    --scroll-behavior: auto;
  }
}
