/* ==========================================================================
   The Hallmark Society
   Design language: the plate book. A scholarly catalogue of objects -
   hairline rules, engraved figures, numbered plates, generous margins.
   Deliberately not letterpress-on-linen, deliberately not a shop.
   ========================================================================== */

:root {
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --body: 'Literata', Georgia, 'Times New Roman', serif;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --paper: #f5f3ef;
  --surface: #fffefb;
  --sunk: #efece5;
  --ink: #15171c;
  --ink-soft: #3d4048;
  --muted: #6d6b64;
  --line: #ddd7cb;
  --line-soft: #e9e4da;
  --gold: #a4813e;
  --gold-soft: #d3bb87;
  --jewel: #1c4a3b;
  --jewel-soft: #dfe9e4;
  --shadow: 0 1px 2px rgba(21, 23, 28, 0.04), 0 8px 24px -16px rgba(21, 23, 28, 0.35);

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 78rem;
}

[data-theme='dark'] {
  --paper: #0d0f13;
  --surface: #14171d;
  --sunk: #101317;
  --ink: #e9e6df;
  --ink-soft: #c7c3ba;
  --muted: #96938b;
  --line: #2a2f37;
  --line-soft: #21252b;
  --gold: #c9a45f;
  --gold-soft: #6d5a33;
  --jewel: #7cbfa4;
  --jewel-soft: #17241f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -18px rgba(0, 0, 0, 0.9);
}

@media (prefers-color-scheme: dark) {
  [data-theme='auto'] {
    --paper: #0d0f13;
    --surface: #14171d;
    --sunk: #101317;
    --ink: #e9e6df;
    --ink-soft: #c7c3ba;
    --muted: #96938b;
    --line: #2a2f37;
    --line-soft: #21252b;
    --gold: #c9a45f;
    --gold-soft: #6d5a33;
    --jewel: #7cbfa4;
    --jewel-soft: #17241f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -18px rgba(0, 0, 0, 0.9);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* faint plate-paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

main,
.masthead,
.foot {
  position: relative;
  z-index: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
}

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

/* ---------- masthead ---------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.masthead::after {
  content: '';
  display: block;
  height: 2px;
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid transparent;
  opacity: 0.8;
}

.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
}
.brand__mark {
  color: var(--gold);
  display: block;
  flex: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.brand:hover .brand__mark {
  transform: rotate(45deg);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__name {
  font-family: var(--display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.brand__tag {
  font-family: var(--ui);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
}

.nav ul {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.navtoggle {
  display: none;
  font-family: var(--ui);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.themetoggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.themetoggle__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink) 0 50%, transparent 50% 100%);
  border: 1px solid var(--ink);
}

@media (max-width: 860px) {
  .masthead__inner {
    gap: 0.7rem;
    position: relative;
  }
  .brand {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    gap: 0.5rem;
  }
  .brand__text {
    min-width: 0;
  }
  .brand__name {
    font-size: 1rem;
    line-height: 1.15;
  }
  .brand__tag {
    display: none;
  }
  .themetoggle {
    order: 4;
  }
  .navtoggle {
    display: block;
    order: 3;
    padding: 0.45rem 0.7rem;
  }
  .nav {
    order: 5;
  }
}

@media (max-width: 420px) {
  .brand__mark svg {
    width: 26px;
    height: 26px;
  }
  .brand__name {
    font-size: 0.92rem;
  }
}

@media (max-width: 860px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0 var(--gutter);
    background: var(--paper);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 5;
  }
  .nav[data-open='true'] {
    max-height: 24rem;
    border-bottom: 1px solid var(--line);
  }
  .nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
  }
  .nav a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

/* ---------- shared blocks ---------------------------------------------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--ui);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}
.eyebrow a:hover {
  color: var(--jewel);
}

.pagehead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--gutter) 2.5rem;
  border-bottom: 1px solid var(--line);
}
.pagehead h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.pagehead .standfirst {
  max-width: 40rem;
}

.standfirst {
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* ---------- cards ------------------------------------------------------- */

/* Rules come from the cells themselves, not from a coloured backing showing
   through the gaps. A backing leaves a filled block wherever the last row is
   short of a full set of columns. */
.cards {
  list-style: none;
  margin: 2.5rem 0 4rem;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.card a {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  padding: 1.9rem 1.7rem 2.2rem;
  background: var(--surface);
  transition: background 0.25s;
  position: relative;
}
.card a::after {
  content: '';
  position: absolute;
  left: 1.7rem;
  right: 1.7rem;
  bottom: 1.3rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card a:hover::after {
  transform: scaleX(1);
}
.card a:hover {
  background: var(--sunk);
}
.card__eyebrow {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.card__title {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.18;
}
.card__desc {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- article ----------------------------------------------------- */

.article__head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) 2.2rem;
}
.article__head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.4vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0 0 1.1rem;
  max-width: 22ch;
}
.article__head .standfirst {
  max-width: 42rem;
}
.byline {
  font-family: var(--ui);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.8rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.7rem;
}

.article__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}
@media (max-width: 1000px) {
  .article__grid {
    grid-template-columns: 1fr;
  }
}

.toc {
  position: sticky;
  top: 6.5rem;
  padding-top: 0.4rem;
}
@media (max-width: 1000px) {
  .toc {
    position: static;
    border: 1px solid var(--line);
    padding: 1.3rem 1.4rem;
    background: var(--surface);
    margin-bottom: 2.5rem;
  }
}
.toc__label {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 0.55rem;
}
.toc a {
  font-family: var(--ui);
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--muted);
  display: block;
  transition: color 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--gold);
  margin-right: 0.55rem;
  font-size: 0.7rem;
}
.toc a:hover,
.toc a.is-active {
  color: var(--ink);
}

/* Reading text is held to a comfortable measure, but tables, plates and
   diagrams get the whole column. A five-column comparison table does not fit
   in 34rem and was being cut off at the right. */
.prose {
  max-width: none;
  font-size: 1.09rem;
}
.prose > p,
.prose > ul,
.prose > ol,
.prose > blockquote,
.prose > h2,
.prose > h3,
.prose > h4,
.prose > .keybox,
.prose > .note,
.prose > .elsewhere,
.prose > dl {
  max-width: var(--measure);
}
.prose > .tablewrap,
.prose > .plate {
  max-width: min(100%, 54rem);
}
.prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.9em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--jewel);
}
.prose h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 3.2rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 6rem;
}
.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 2.2rem 0 0.7rem;
  scroll-margin-top: 6rem;
}
.prose h4 {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.6rem;
}
.prose p {
  margin: 0 0 1.35rem;
}
.prose a {
  color: var(--jewel);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--gold-soft);
  transition: text-decoration-color 0.2s;
}
.prose a:hover {
  text-decoration-color: var(--jewel);
}
.prose ul,
.prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.3rem;
}
.prose li {
  margin-bottom: 0.6rem;
}
.prose ul {
  list-style: none;
  padding-left: 1.1rem;
}
.prose ul li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  transform: rotate(45deg) translateY(-3px);
  border: 1px solid var(--gold);
  margin-left: -1.1rem;
  margin-right: 0.65rem;
}
.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold-soft);
  font-style: italic;
  color: var(--ink-soft);
}
.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--sunk);
  border: 1px solid var(--line-soft);
  padding: 0.08em 0.35em;
}

/* tables - the format AI assistants reuse most */
.tablewrap {
  overflow-x: auto;
  margin: 2rem 0 2.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  min-width: 24rem;
}
/* a hint that there is more table to the right */
.tablewrap {
  scrollbar-width: thin;
  background-image: linear-gradient(to right, var(--surface) 30%, transparent),
    linear-gradient(to left, var(--surface) 30%, transparent),
    linear-gradient(to right, rgba(21, 23, 28, 0.09), transparent 12px),
    linear-gradient(to left, rgba(21, 23, 28, 0.09), transparent 12px);
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 28px 100%, 28px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
.prose th {
  font-family: var(--ui);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
  white-space: nowrap;
}
.prose td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.55;
}
.prose tr:last-child td {
  border-bottom: 0;
}

/* callouts */
.keybox {
  border: 1px solid var(--line);
  border-left: 3px solid var(--jewel);
  background: var(--surface);
  padding: 1.5rem 1.6rem 0.5rem;
  margin: 2.2rem 0;
}
.keybox__label,
.note__label,
.elsewhere__label {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jewel);
  margin: 0 0 0.7rem;
}
.keybox p:last-child,
.note p:last-child,
.elsewhere p:last-child {
  margin-bottom: 1rem;
}
.note {
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  padding: 1.4rem 0 0.4rem;
  margin: 2.2rem 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.note__label {
  color: var(--gold);
}
.elsewhere {
  background: var(--jewel-soft);
  padding: 1.4rem 1.6rem 0.5rem;
  margin: 2.4rem 0;
  font-size: 0.96rem;
}
.elsewhere__label {
  color: var(--jewel);
}

/* engraved plates */
.plate {
  margin: 2.8rem 0;
}
.plate__frame {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.plate__frame svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}
.plate figcaption {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.9rem;
  line-height: 1.5;
}
.plate__no {
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.66rem;
  margin-right: 0.4rem;
}

/* ---------- related ----------------------------------------------------- */

.related {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.related__title {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  margin: 0;
}

/* ---------- home -------------------------------------------------------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6.5rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.15rem, 6.2vw, 4.6rem);
  line-height: 1.01;
  letter-spacing: -0.018em;
  margin: 0 0 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--jewel);
}
.hero__lede {
  font-size: 1.2rem;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 32rem;
  margin: 0 0 2rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.btn {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.95rem 1.5rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-block;
}
.btn:hover {
  background: var(--jewel);
  border-color: var(--jewel);
  color: #fff;
}
.btn--ghost {
  background: none;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  background: none;
  color: var(--jewel);
  border-color: var(--jewel);
}

.vitrine {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  position: relative;
}
.vitrine::after {
  content: 'Pl. I';
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  font-family: var(--ui);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.vitrine svg {
  display: block;
  width: 100%;
  color: var(--ink);
}
.vitrine figcaption {
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  margin-top: 1.2rem;
  padding-top: 0.9rem;
}

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.strip__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.strip__inner b {
  color: var(--gold);
  font-weight: 500;
}

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) 0;
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}
.section__head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  margin: 0;
}
.section__more {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}
.section__more:hover {
  color: var(--jewel);
}
.section__blurb {
  max-width: 40rem;
  color: var(--ink-soft);
  margin: 1.4rem 0 0;
}

/* ---------- tools ------------------------------------------------------- */

.tool {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  margin: 2.5rem 0;
}
.panel__label {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}

label {
  display: block;
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
input[type='text'],
input[type='search'],
input[type='number'],
select {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--jewel);
}
.field {
  margin-bottom: 1.4rem;
}
.fieldrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.2rem;
}

.choices {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.choice {
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 1.15rem 1.2rem;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.5;
  transition: background 0.2s;
}
.choice:hover {
  background: var(--sunk);
}
.choice[aria-pressed='true'] {
  background: var(--jewel-soft);
  box-shadow: inset 3px 0 0 var(--jewel);
}
.choice b {
  display: block;
  font-family: var(--ui);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.result {
  border-top: 1px solid var(--line);
  margin-top: 1.8rem;
  padding-top: 1.6rem;
}
.result__headline {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.6rem;
}
.result__meta {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin: 1.5rem 0;
}
.figures div {
  background: var(--surface);
  padding: 1.1rem 1.2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.figures dt {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.figures dd {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 500;
}

.pill {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.3rem 0.65rem;
  margin: 0 0.35rem 0.35rem 0;
  color: var(--muted);
}
.pill--on {
  border-color: var(--jewel);
  color: var(--jewel);
}

.hits {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.hits li {
  border-bottom: 1px solid var(--line-soft);
  padding: 1.15rem 0;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.hits .mark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--jewel);
  line-height: 1.1;
}
.hits .mark small {
  display: block;
  font-family: var(--ui);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.3rem;
}
.hits h3 {
  font-family: var(--body);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}
.hits p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.hits .tag {
  font-family: var(--ui);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.45rem;
  display: block;
}

.stepper {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}
.stepper span {
  flex: 1;
  height: 2px;
  background: var(--line);
}
.stepper span.on {
  background: var(--jewel);
}

.compare {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.compare svg {
  display: block;
  width: 100%;
  height: clamp(240px, 38vw, 400px);
  color: var(--ink);
}
.compare__b {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--gold);
  cursor: ew-resize;
}
.compare__handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid var(--gold);
  background: var(--surface);
}
.compare__tag {
  position: absolute;
  bottom: 0.8rem;
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- glossary ---------------------------------------------------- */

.alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 2rem 0 3rem;
}
.alphabet a {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  color: var(--muted);
}
.alphabet a:hover {
  border-color: var(--jewel);
  color: var(--jewel);
}
.gloss {
  border-top: 1px solid var(--line);
}
.gloss__letter {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 500;
  color: var(--gold);
  margin: 2.6rem 0 0.6rem;
  scroll-margin-top: 6rem;
}
.gloss dl {
  margin: 0;
}
.gloss dt {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 1.5rem;
  scroll-margin-top: 6rem;
}
.gloss dd {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.gloss dd a {
  color: var(--jewel);
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 0.15em;
}

/* ---------- footer ------------------------------------------------------ */

.foot {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.foot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}
@media (max-width: 760px) {
  .foot__inner {
    grid-template-columns: 1fr;
  }
}
.foot__name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
}
.foot__blurb {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 34rem;
  margin: 0 0 0.9rem;
}
.foot__blurb--fine {
  font-size: 0.87rem;
}
.foot__label {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.foot__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot__col li {
  margin-bottom: 0.6rem;
}
.foot__col a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}
.foot__col a:hover {
  border-bottom-color: var(--gold);
}
.foot__rule {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 1px;
  background: var(--line);
}
.foot__legal {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem var(--gutter) 3rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.6;
}

@media print {
  .masthead,
  .foot,
  .toc,
  body::before {
    display: none;
  }
  .article__grid {
    grid-template-columns: 1fr;
  }
}

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