/* Syntagm site stylesheet
   Palette is taken from the Syntagm mark (#0070BA) with a navy ink.
   All text pairs meet WCAG 2.2 AA (most meet AAA); see notes beside tokens. */

@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 900; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #FFFFFF;
  --wash: #EEF5FA;        /* pale tint of the mark */
  --ink: #0B2A4A;         /* 14.5:1 on paper */
  --ink-soft: #4A6074;    /* 6.5:1 on paper, 5.9:1 on wash */
  --blue: #0070BA;        /* links: 5.2:1 on paper, 4.7:1 on wash */
  --blue-deep: #0B4F86;
  --rule: #BFDDEF;        /* decorative rules only */
  --branch: #5F93BE;      /* dendrogram lines, decorative */
  --card-line: #B3261E;   /* index-card header line, 6.5:1 on paper */
  --focus: #B3261E;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;

  --measure: 36rem;
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Modular scale, ratio 1.25 from 1.125rem body */
  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.75rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.2rem, 5vw, 3.4rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1A26;
    --wash: #16263A;
    --ink: #E6EEF5;       /* 15:1 */
    --ink-soft: #A9BCCD;  /* 9:1 */
    --blue: #7CC0F0;      /* 8.9:1 on paper, 7.8:1 on wash */
    --blue-deep: #A8D6F7;
    --rule: #2A4460;
    --branch: #5D86AC;
    --card-line: #E8746A;
    --focus: #F2A39B;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

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

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
a:hover { color: var(--blue-deep); text-decoration-thickness: 0.12em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 1.8em 0 0.5em;
}
h1 { font-size: var(--step-3); margin-top: 0; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p, ul, ol, dl, blockquote, figure, table { margin: 0 0 1em; }
li + li { margin-top: 0.3em; }
blockquote { border-left: 3px solid var(--rule); padding-left: 1em; margin-left: 0; color: var(--ink-soft); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
small, .small { font-size: var(--step--1); }

/* Skip link */
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.6rem 1rem; background: var(--paper); color: var(--blue);
  font-family: var(--sans); font-weight: 700;
}
.skip:focus { top: 1rem; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead__inner {
  max-width: var(--wide); margin: 0 auto; padding: 1rem var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.brand img { display: block; }
.sitenav { margin-left: auto; }
.sitenav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.sitenav li + li { margin-top: 0; }
.sitenav a {
  display: inline-block; padding: 0.35rem 0; font-family: var(--sans); font-size: 1rem;
  color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent;
}
.sitenav a:hover { color: var(--blue); border-bottom-color: var(--rule); }
.sitenav a[aria-current] { border-bottom-color: var(--blue); font-weight: 700; }
@media (max-width: 40rem) { .sitenav { margin-left: 0; } }

/* Page body */
main { display: block; padding: 2.5rem var(--gutter) 4rem; }
.prose { max-width: var(--measure); margin: 0 auto; }
.wide { max-width: var(--wide); margin: 0 auto; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); }
.prose img.right { float: right; margin: 0.3em 0 1em 1.5em; max-width: 45%; }
.prose img.left { float: left; margin: 0.3em 1.5em 1em 0; max-width: 45%; }
.prose figure img { display: block; }
/* Phone screenshots: tall and narrow, so cap the width rather than use a share of the column. */
.prose img.phone { max-width: min(13rem, 40%); border: 1px solid var(--rule); border-radius: 6px; }
.clear { clear: both; }
.prose ul.twocol { columns: 2 12rem; column-gap: 2rem; }
.prose ul.twocol li { break-inside: avoid; }
.prose .attrib { font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); margin-top: -0.5em; }
.prose .attrib::before { content: "\2013\00a0"; }
.prose figcaption { font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.4em; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); font-family: var(--sans); display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 0.4em 0.6em; text-align: left; vertical-align: top; }
.prose th { background: var(--wash); }
.prose caption { text-align: left; font-weight: 700; padding-bottom: 0.3rem; }
.prose table.pairs { width: auto; }
.prose table.pairs th, .prose table.ranked tbody th { font-weight: 400; }
.prose table.ranked td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.prose table.ranked th[scope="col"]:nth-child(n+3) { text-align: right; }
.prose table.pairs td, .prose table.crosstab td { text-align: right; font-variant-numeric: tabular-nums; }
.prose thead td, .prose table.crosstab td:empty { border: 0; background: none; }
.prose dl.years { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 0.15rem 1rem; }
.prose dl.years dt { grid-column: 1; font-weight: 700; font-family: var(--sans); }
.prose dl.years dd { grid-column: 2; margin: 0; }
.prose dl.years dt:not(:first-child), .prose dl.years dt:not(:first-child) + dd { margin-top: 0.5rem; }
.prose::after { content: ""; display: block; clear: both; }

/* Article furniture */
.byline { font-family: var(--sans); color: var(--ink-soft); font-size: 1rem; margin-top: -0.2em; }
.crumbs { font-family: var(--sans); font-size: var(--step--1); margin-bottom: 1.5rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3em; }
.crumbs li + li { margin-top: 0; }
.crumbs li + li::before { content: "/"; color: var(--ink-soft); margin-right: 0.3em; }
.provenance {
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft);
}
.provenance h2 { font-size: var(--step-0); margin-top: 0; color: var(--ink); }

/* Index card: the one structural device on the site.
   A red header line and pale ruled lines, as on a real card used in card sorting. */
.card {
  background: var(--paper);
  border: 1px solid var(--rule); border-top: 3px solid var(--card-line);
  padding: 1.1rem 1.25rem 1.25rem;
}
.card > :last-child { margin-bottom: 0; }
/* Buttons always have the same space around them: a paragraph that holds only a
   button gets a fixed margin, and a card followed by anything keeps that gap too. */
p:has(> .button:only-child) { margin-block: 1.5rem; }
.card { margin-bottom: 1.5rem; }
.card h2, .card h3 { margin-top: 0; }

/* Home: dendrogram of the site */
.hero { max-width: var(--wide); margin: 0 auto 3.5rem; display: grid; gap: 2rem 3rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 52rem) { .hero { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.hero h1 { font-size: var(--step-4); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 0.6rem; }
.hero p { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 28rem; margin: 0; }

.dendro { --row: 3.25rem; display: grid; grid-template-columns: minmax(0, auto) minmax(6rem, 1fr); align-items: stretch; font-family: var(--sans); }
.dendro ul { list-style: none; margin: 0; padding: 0; }
.dendro li { height: var(--row); margin: 0; display: flex; align-items: center; }
.dendro li a {
  display: block; width: 100%; padding: 0.55rem 0.9rem; text-decoration: none; color: var(--ink); font-weight: 600;
  border: 1px solid var(--rule); border-top: 2px solid var(--card-line); background: var(--paper); line-height: 1.2; white-space: nowrap;
}
.dendro li a span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); white-space: normal; }
.dendro li a:hover { border-color: var(--blue); border-top-color: var(--card-line); color: var(--blue); }
.dendro svg { width: 100%; height: calc(var(--row) * 6); display: block; overflow: visible; }
.dendro svg path { fill: none; stroke: var(--branch); stroke-width: 2; vector-effect: non-scaling-stroke; }
@media (max-width: 30rem) { .dendro li a { white-space: normal; } .dendro { --row: 4rem; grid-template-columns: minmax(0, 1fr) 3.5rem; } }

/* Home: project panels */
.projects { max-width: var(--wide); margin: 0 auto; display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project h2 { margin-top: 0; font-size: var(--step-3); }
.project__intro { color: var(--ink-soft); }
.newslist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.newslist li + li { margin-top: 1rem; }
.newslist time { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); }
.newslist h3, .newslist h4 { font-size: var(--step-0); margin: 0.1rem 0 0.3rem; }
.card > h3 { font-size: var(--step-1); margin-bottom: 0.75rem; }
.newslist p { margin: 0; }

/* Forms */
form { font-family: var(--sans); }
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
input[type="email"], input[type="text"], textarea {
  width: 100%; max-width: 32rem; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink-soft); border-radius: 3px; padding: 0.55rem 0.7rem;
}
textarea { min-height: 10rem; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline-offset: 1px; }
.button {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1.3; cursor: pointer;
  color: #FFFFFF; background: #0070BA; border: 2px solid #0070BA; border-radius: 3px; padding: 0.55rem 1.1rem; text-decoration: none;
}
.button:hover { background: #0B4F86; border-color: #0B4F86; color: #FFFFFF; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.inline-form .field { margin: 0; flex: 1 1 14rem; }
.status { font-family: var(--sans); margin-top: 0.75rem; }
.status[data-state="error"] { color: var(--card-line); font-weight: 700; }
.visually-hidden, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Lists of articles */
.article-list { list-style: none; padding: 0; }
.article-list li { margin: 0 0 1.1rem; }
.article-list a { font-family: var(--sans); font-weight: 700; }
.article-list .meta { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); }

/* Footer */
.sitefoot { border-top: 1px solid var(--rule); background: var(--wash); font-family: var(--sans); font-size: var(--step--1); color: var(--ink-soft); }
.sitefoot__inner { max-width: var(--wide); margin: 0 auto; padding: 1.5rem var(--gutter); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.sitefoot p { margin: 0; }
.sitefoot__company { flex: 1 1 100%; }
.sitefoot__company p + p { margin-top: 0.25rem; }
.sitefoot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.sitefoot li + li { margin-top: 0; }

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

@media print {
  .masthead, .sitefoot, .skip, .sitenav { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; }
}

/* KLM calculator */
.klm { background: var(--wash); border-top: 3px solid var(--card-line); padding: 1.25rem; margin-bottom: 2.5rem; }
.klm input[type="text"] { max-width: 20rem; font-size: 1.25rem; letter-spacing: 0.08em; }
.klm #klm-r { max-width: 8rem; letter-spacing: 0; font-size: 1rem; }
.klm__result { font-size: var(--step-1); font-weight: 700; margin: 0.5rem 0 1rem; }
.klm__table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.klm__table caption { text-align: left; font-weight: 700; padding-bottom: 0.3rem; }
.klm__table th, .klm__table td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--rule); }
.klm__table td:nth-child(n+2), .klm__table th:nth-child(n+2) { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
kbd { font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; background: var(--wash); border: 1px solid var(--rule); border-radius: 3px; padding: 0.1em 0.4em; }

/* Embedded videos */
figure[data-video] { margin: 0 0 1.25em; }
figure[data-video] iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.compare th[scope="row"] { white-space: nowrap; }

/* Download lists */
.downloads { list-style: none; padding: 0; margin: 0 0 2.5rem; font-family: var(--sans); }
.downloads li + li { margin-top: 0.5rem; }
.downloads a { font-weight: 700; }
.downloads .meta { color: var(--ink-soft); font-size: var(--step--1); }
.dl-icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.4em; }
