@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4/roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4/italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #faf7f2;
  --surface: #f4efe6;
  --surface-raised: #fdfbf7;
  --ink: #1a1c18;
  --muted: #666c62;
  --line: #e8e4db;
  --line-strong: #d5cfc2;
  --accent: #364a32;
  --accent-ink: #faf7f2;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tooth-crest: rgba(255, 255, 255, 0.08);
  --tooth-trough: rgba(45, 38, 28, 0.032);
  --pulp-nodule: rgba(45, 38, 28, 0.020);
  --pulp-dimple: rgba(255, 255, 250, 0.05);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-synthesis: none;
  font-optical-sizing: auto;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #161816;
  --surface: #1d211d;
  --surface-raised: #222722;
  --ink: #f1efe6;
  --muted: #959d90;
  --line: #2b332b;
  --line-strong: #3b453b;
  --accent: #b9cca1;
  --accent-ink: #161816;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --tooth-crest: rgba(255, 255, 255, 0.03);
  --tooth-trough: rgba(0, 0, 0, 0.085);
  --pulp-nodule: rgba(0, 0, 0, 0.055);
  --pulp-dimple: rgba(255, 255, 255, 0.018);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161816;
    --surface: #1d211d;
    --surface-raised: #222722;
    --ink: #f1efe6;
    --muted: #959d90;
    --line: #2b332b;
    --line-strong: #3b453b;
    --accent: #b9cca1;
    --accent-ink: #161816;
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --tooth-crest: rgba(255, 255, 255, 0.03);
    --tooth-trough: rgba(0, 0, 0, 0.085);
    --pulp-nodule: rgba(0, 0, 0, 0.055);
    --pulp-dimple: rgba(255, 255, 255, 0.018);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  max-width: 960px;
  margin: auto;
  padding: 0 40px 40px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 30% 25%, var(--tooth-crest) 0.6px, transparent 0.9px),
    radial-gradient(circle at 70% 75%, var(--tooth-trough) 0.6px, transparent 0.9px),
    radial-gradient(ellipse at 45% 40%, var(--pulp-nodule) 1px, transparent 1.6px),
    radial-gradient(ellipse at 80% 30%, var(--tooth-crest) 1px, transparent 1.8px),
    radial-gradient(circle at 20% 80%, var(--pulp-dimple) 1.5px, transparent 2.4px),
    radial-gradient(ellipse at 60% 60%, var(--tooth-trough) 1.2px, transparent 2.2px),
    radial-gradient(circle at 50% 50%, var(--pulp-nodule) 1.8px, transparent 3.5px);
  background-size:
    5px 5px,
    7px 7px,
    11px 11px,
    17px 17px,
    23px 23px,
    31px 31px,
    47px 47px;
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink);
}

.skip {
  position: absolute;
  top: 8px;
  left: 16px;
  transform: translateY(-200%);
  padding: 12px;
  background: var(--paper);
}

.skip:focus {
  transform: none;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 96px;
}

.wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.5px;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-dot {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  font-size: 13px;
}

.site-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
}

.theme-control {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-control[hidden] {
  display: none;
}

.theme-control svg {
  pointer-events: none;
}

.theme-control:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-icon-light,
.theme-icon-dark {
  display: none;
}

:root[data-theme="light"] .theme-icon-device,
:root[data-theme="dark"] .theme-icon-device {
  display: none;
}

:root[data-theme="light"] .theme-icon-light,
:root[data-theme="dark"] .theme-icon-dark {
  display: inline;
}

.tools-heading {
  padding: 28px 0 36px;
}

.tools-heading h1 {
  margin: 0 0 12px;
  font: 400 clamp(32px, 5vw, 44px)/1.18 var(--serif);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tools-heading p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

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

.tools-list li {
  border-bottom: 1px solid var(--line);
}

.tools-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px 0;
  text-decoration: none;
}

.tools-list a:hover .tool-name {
  color: var(--accent);
  text-decoration: underline;
}

.tool-meta {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font: 11px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-name {
  display: block;
  font: 450 26px/1.25 var(--serif);
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 0.15s ease;
}

.tool-desc {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 60ch;
}

.tool-arrow {
  color: var(--muted);
  font: 15px var(--mono);
  transition: transform 0.15s ease, color 0.15s ease;
}

.tools-list a:hover .tool-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding: 20px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 0 20px 28px;
  }

  .site-header {
    min-height: 76px;
    gap: 12px;
    padding-block: 12px;
  }

  .site-header nav {
    gap: 14px;
    font-size: 12px;
  }

  .tools-heading {
    padding: 16px 0 24px;
  }

  .tools-list a {
    padding: 22px 0;
  }

  .tool-name {
    font-size: 23px;
  }

  .site-footer {
    margin-top: 40px;
    flex-direction: column;
    gap: 4px;
  }

  .site-footer div {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
