:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-2: #e7e0d3;
  --paper: #faf7f1;
  --ink: #1a1612;
  --muted: #4a433c;
  --faint: #6e665c;
  --line: #d4cbbd;
  --line-2: #c4b9a8;
  --accent: #b42318;
  --accent-2: #8a1a12;
  --accent-ink: #fff8f4;
  --ad: #ece6da;
  --ok: #1f6b3a;
  --font-display: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font: "Avenir Next", "Segoe UI", "Gill Sans", "Trebuchet MS", sans-serif;
  --touch: 2.75rem;
  --header-h: 3.4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;
  --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);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --z-header: 40;
  --wrap: 74rem;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --bg-2: #1c1916;
  --paper: #1a1714;
  --ink: #eee8df;
  --muted: #c9c0b4;
  --faint: #9a9186;
  --line: #2e2924;
  --line-2: #3d372f;
  --accent: #e0564c;
  --accent-2: #ff8a7a;
  --accent-ink: #1a100f;
  --ad: #1c1916;
  --ok: #6bcb77;
}

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

html {
  overflow-x: clip;
  background: var(--bg);
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

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

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

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

:focus {
  outline: none;
}

:focus-visible {
  box-shadow: var(--focus);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 80;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.8rem;
}

.skip:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.wrap {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  padding-top: var(--safe-top);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.header-scroll {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  min-width: max-content;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: var(--touch);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

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

.brand-mark {
  width: 1.35rem;
  height: 0.55rem;
  background: var(--ink);
  box-shadow: 0 3px 0 var(--accent);
}

.nav {
  display: flex;
  gap: 0.1rem;
  flex: 0 0 auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.65rem;
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
}

.header-search {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  background: var(--paper);
}

.header-search input {
  min-height: 2.25rem;
  min-width: 11rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  padding: 0 0.7rem;
}

.header-search button,
.search-block button,
.theme-toggle,
.lang-select {
  min-height: 2.25rem;
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  cursor: pointer;
}

.header-search button,
.search-block button {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 0.85rem;
}

.header-search button:hover,
.search-block button:hover {
  background: var(--accent-2);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: auto;
  flex: 0 0 auto;
}

.lang-select,
.theme-toggle {
  min-width: 2.25rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding-inline: 0.55rem;
}

.theme-toggle {
  display: grid;
  place-items: center;
  padding: 0;
}

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

main {
  flex: 1;
}

.page {
  padding-block: 2rem 3.5rem;
}

.kicker {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.15rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.7rem;
}

h3 {
  font-size: 1.12rem;
  margin: 0 0 0.4rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.meta-line,
.meta-row,
.byline,
.footer-note,
.ad-label,
.rail-label {
  color: var(--faint);
  font-size: 0.875rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.note {
  border-left: 3px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.8rem;
  color: var(--muted);
}

.search-block {
  display: flex;
  gap: 0;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line-2);
  background: var(--paper);
}

.search-block label {
  flex: 1;
}

.search-block input {
  width: 100%;
  min-height: 3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0 0.9rem;
}

.hub-grid,
.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.hub-tile,
.term-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.1rem 0.95rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  min-height: var(--touch);
}

.hub-tile:hover,
.term-card:hover {
  color: inherit;
  border-bottom-color: var(--accent);
}

.term-card-kind,
.hub-tile span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.term-card strong,
.hub-tile strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.term-card span:last-child {
  color: var(--muted);
  font-size: 0.95rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--faint);
}

.entry-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.examples,
.plain-list,
.trans-list,
.rail-list,
.chip-list {
  margin: 0;
  padding: 0;
}

.examples {
  list-style: none;
}

.examples li {
  border-left: 2px solid var(--line-2);
  padding: 0.2rem 0 0.2rem 0.9rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.chip-list li {
  border: 1px solid var(--line);
  padding: 0.25rem 0.55rem;
  font-size: 0.875rem;
}

.trans-list {
  list-style: none;
}

.trans-list span {
  display: inline-block;
  min-width: 2.2rem;
  color: var(--faint);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-right: 0.4rem;
}

.faq-item {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.ad-slot {
  display: grid;
  place-items: center;
  background: var(--ad);
  border: 1px dashed var(--line-2);
  margin: 0.75rem 1.25rem;
}

.ad-slot--leader {
  min-height: 100px;
}

.ad-slot--inarticle {
  min-height: 280px;
  margin-inline: 0;
  margin-block: 1.25rem;
}

.ad-slot--rail {
  min-height: 280px;
  margin: 0 0 1rem;
}

.ad-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.rail-list {
  list-style: none;
}

.rail-list a {
  display: block;
  min-height: var(--touch);
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 calc(2rem + var(--safe-bottom));
  background: var(--bg-2);
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 0.3rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

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

@media (min-width: 960px) {
  .entry-shell {
    grid-template-columns: 1fr 18rem;
  }

  .rail {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .ad-slot--leader {
    margin-inline: auto;
    width: min(100%, var(--wrap));
  }
}

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

.prose h2 {
  margin-top: 1.75rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
