@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Zilla Slab";
  src: url("/assets/fonts/zilla-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Azeret Mono";
  src: url("/assets/fonts/azeret-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: oklch(0.13 0 0);
  --surface: oklch(0.18 0 0);
  --ink: oklch(0.94 0.015 210);
  --muted: oklch(0.74 0.025 210);
  --line: oklch(0.32 0.02 210);
  --primary: oklch(0.62 0.1 210);
  --accent: oklch(0.78 0.12 75);
  --on-primary: oklch(0.99 0 0);
  --dofollow: oklch(0.78 0.12 155);
  --nofollow: oklch(0.74 0.06 250);
  --danger: oklch(0.68 0.14 25);
  --header-h: 3.5rem;
  --touch: 2.75rem;
  --radius: 2px;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-section: clamp(1.75rem, 3vw, 2.75rem);
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --display: "Zilla Slab", "Atkinson Hyperlegible", serif;
  --mono: "Azeret Mono", ui-monospace, Menlo, monospace;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sticky: 40;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.97 0.008 210);
  --ink: oklch(0.22 0.03 210);
  --muted: oklch(0.42 0.03 210);
  --line: oklch(0.86 0.02 210);
  --primary: oklch(0.42 0.1 210);
  --accent: oklch(0.52 0.13 70);
  --on-primary: oklch(0.99 0 0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

::selection {
  background: color-mix(in oklch, var(--primary) 35%, transparent);
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent);
}

:focus {
  outline: none;
}

:focus-visible {
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.5rem 0.75rem;
  z-index: 60;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: max(0.75rem, var(--safe-top));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
.main,
.site-footer {
  min-width: 0;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding-top: var(--safe-top);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: clip;
}

.header-scroll {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--header-h);
  width: 100%;
  padding: 0.4rem 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--touch);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--primary);
  color: var(--on-primary);
}

.nav {
  display: flex;
  gap: 0.15rem;
  flex: 1 0 auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.7rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link.is-active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.lang-select,
.theme-toggle {
  min-height: var(--touch);
  min-width: var(--touch);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.lang-select {
  padding: 0 0.6rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
}

html[data-theme="dark"] .theme-icon-dark,
html[data-theme="light"] .theme-icon-light {
  display: none;
}

.main {
  flex: 1;
  padding: var(--space-section) 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.2;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  margin: var(--space-xl) 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.4rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 1rem;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.button:hover {
  color: var(--on-primary);
  filter: brightness(1.08);
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.search-form input {
  min-height: var(--touch);
  min-width: min(18rem, 100%);
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stat-line,
.hub-line,
.how-list,
.tag-list,
.log-meta {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stat-line,
.hub-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.stat-line li,
.hub-line a {
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.how-list {
  display: grid;
  gap: 0.65rem;
}

.how-list li {
  padding-left: 0;
}

.log {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.log-row {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.log-main {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: inherit;
  text-decoration: none;
}

.log-name {
  font-weight: 700;
}

.log-domain {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.log-desc {
  margin: 0;
  color: var(--muted);
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.pill-dofollow {
  border-color: color-mix(in oklch, var(--dofollow) 50%, var(--line));
  color: var(--dofollow);
}

.pill-nofollow {
  border-color: color-mix(in oklch, var(--nofollow) 50%, var(--line));
  color: var(--nofollow);
}

.log-fav {
  width: 20px;
  height: 20px;
  align-self: center;
}

.log-fav-lg {
  width: 32px;
  height: 32px;
}

.detail-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}

.metrics div {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.7rem;
}

.metrics dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.metrics dd {
  margin: 0.2rem 0 0;
}

.req-list {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 1.5rem;
  list-style: none;
}

.req-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
}

.their-about {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.their-about p {
  margin: 0;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: center;
}

.pager a,
.pager span {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}

.source-note,
.count {
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--line);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
}

.tag-list a {
  border: 1px solid var(--line);
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: inherit;
}

.empty {
  padding: 1.5rem 0;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 2rem 0 calc(1.5rem + var(--safe-bottom));
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}

.footer-name {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.footer-heading {
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
}

.footer-meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
