/*
  Havihi Digital: the one stylesheet for havihi.digital.

  There are no inline styles anywhere on the site, so the Content-Security-Policy
  can stay at style-src 'self'. Keep it that way: add classes here instead.

  Colour rules
  - --brand (#D46613) is for the logo, large display type (24px and up) and
    decoration only. It is 3.68:1 on white, so it must never carry small text.
  - --accent carries links and accent text: #A84F0E on the light theme
    (5.54:1 on white) and #E8843A on the dark theme (6.91:1 on #16120F).
  - --tint is the warm panel used by the foundation figure and the example
    boxes. Ink, muted and accent text all pass on it in both themes.
  - Run `python3 ~/Havihi/presence/site-tools/contrast.py` after changing any colour token.

  Themes follow the device setting (prefers-color-scheme). There's no toggle,
  because a toggle would need JavaScript and the site runs none.

  When you change this file, bump the ?v= number in every page's stylesheet link
  and in ~/Havihi/presence/site-tools/article-template.html, then rebuild the
  articles, because site.css is cached for a year.
*/

:root {
  color-scheme: light dark;

  --bg: #FCFAF7;
  --surface: #F4EEE6;
  --tint: #F7E6D6;
  --ink: #1D1814;
  --muted: #574E47;
  --line: #DDD1C3;
  --line-strong: #C9B8A5;
  --accent: #A84F0E;
  --accent-strong: #8A400B;
  --brand: #D46613;
  --on-accent: #FFFFFF;
  --focus: #A84F0E;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wide: 72rem;
  --measure: 40rem;
  --gutter: 1rem;
  --space-section: clamp(3rem, 2rem + 5vw, 6.5rem);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120F;
    --surface: #211A15;
    --tint: #33241A;
    --ink: #F3EDE6;
    --muted: #C0B5AA;
    --line: #3D332B;
    --line-strong: #5A4A3D;
    --accent: #E8843A;
    --accent-strong: #F29A55;
    --brand: #D46613;
    --on-accent: #16120F;
    --focus: #E8843A;
  }
}

@media (min-width: 40em) {
  :root { --gutter: 1.5rem; }
}

@media (min-width: 64em) {
  :root { --gutter: 2rem; }
}

/* Base */

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

@media (min-width: 48em) {
  body { font-size: 1.125rem; }
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.3;
}

p,
li,
dd {
  text-wrap: pretty;
}

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

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

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

main:focus {
  outline: none;
}

/* Leave room for the focus outline when the browser scrolls a focused link into view */
a,
button,
summary,
[tabindex] {
  scroll-margin-block: 1.5rem;
}

strong {
  font-weight: 650;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 3px;
  padding: 0.1em 0.3em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Skip link */

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: var(--bg);
}

/* Header
   Wide screens show the full navigation in a row. Narrow screens show a Menu
   button built from <details>, so it opens and closes without JavaScript and
   pushes the page down (it never covers content, so focus is never hidden). */

.site-header {
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.brand img {
  display: block;
  width: auto;
  height: 2.25rem;
}

@media (min-width: 48em) {
  .header-inner { padding-block: 1.125rem; }
  .brand img { height: 2.625rem; }
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.125rem;
  margin: 0 -0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.5rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.nav-list a[aria-current] {
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--brand);
  text-underline-offset: 0.35em;
}

.nav-wide {
  display: none;
}

.nav-menu {
  flex-basis: 100%;
}

.nav-menu > summary {
  position: absolute;
  top: calc(0.75rem + 2px);
  right: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu > summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.nav-menu[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.nav-menu > summary:hover {
  border-color: var(--accent);
}

.nav-menu .nav-list {
  display: block;
  margin: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--line);
  font-size: 1.0625rem;
}

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

.nav-menu .nav-list a {
  display: flex;
  min-height: 48px;
  padding: 0.5rem 0;
}

@media (min-width: 48em) {
  .nav-menu > summary { top: calc(1.125rem + 4px); }
}

@media (min-width: 72em) {
  .nav-wide { display: block; }
  .nav-menu { display: none; }
}

/* Shared type pieces */

.eyebrow,
.kicker {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
}

.kicker {
  color: var(--muted);
}

.lead {
  max-width: 38rem;
  margin: 0 0 1rem;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9375rem;
}

/* Page heads and sections */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2.75rem, 2rem + 5vw, 6rem) clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: center;
}

@media (min-width: 60em) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.hero h1,
.page-head h1 {
  max-width: 20ch;
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4rem);
  line-height: 1.08;
}

.hero h1 {
  max-width: 17ch;
}

.hero h1 .year {
  color: var(--brand);
}

.page-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.page-head::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 2rem;
  right: -5rem;
  width: 22rem;
  height: 19.2rem;
  background: url("/assets/mark.svg") no-repeat center / contain;
  opacity: 0.06;
  display: none;
}

@media (min-width: 64em) {
  .page-head::after { display: block; }
}

.page-head h1 {
  max-width: 24ch;
}

.section {
  padding-block: var(--space-section);
}

.section + .section,
.page-head + .section {
  border-top: 1px solid var(--line);
}

.section h2,
.prose h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.375rem);
}

/* Small uppercase labels that are headings (kept as h2 for the outline) */
.section h2.kicker,
.prose h2.kicker,
.toc h2.kicker {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.section-intro {
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}

.section-intro p {
  margin: 0 0 1rem;
}

.split {
  display: grid;
  gap: 2rem 4rem;
}

@media (min-width: 60em) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

/* Buttons and link rows */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin: 2rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  background-color: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

.button:hover {
  background-color: var(--accent-strong);
  color: var(--on-accent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
}

.link-list {
  display: grid;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  padding-block: 0.25rem;
}

.link-list a {
  display: inline-block;
  padding-block: 0.3rem;
  font-weight: 650;
}

.link-note {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
}

.after-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

/* Home: the foundation figure.
   The list is written from the ground up (rules first, agents last), which is
   the order a screen reader hears. column-reverse draws it the other way up. */

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 1.25rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (min-width: 40em) {
  .stack { padding: 1.75rem; }
}

.stack-horizon {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed var(--line-strong);
  color: var(--muted);
  font-size: 0.9375rem;
}

.stack-year {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
}

.stack-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list li {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0.9rem;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 3px;
}

.stack-list li:nth-child(2) { margin-inline-end: 4%; }
.stack-list li:nth-child(3) { margin-inline-end: 8%; }
.stack-list li:nth-child(4) { margin-inline-end: 12%; }
.stack-list li:nth-child(5) { margin-inline-end: 16%; }

.stack-list li.stack-base {
  margin-top: 0.35rem;
  background-color: var(--tint);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--brand);
}

.stack-name {
  font-weight: 650;
  line-height: 1.3;
}

.stack-note {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.stack figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Short statements with a brand rule on top (home "what lasts", about) */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 36em) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pillars.pillars-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pillars > li {
  padding-top: 1rem;
  border-top: 2px solid var(--brand);
}

.pillars h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.pillars p {
  margin: 0;
  color: var(--muted);
}

/* Ledger: a numbered, ruled list of what we do */

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

.ledger > li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.35rem 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  counter-increment: ledger;
}

.ledger > li::before {
  content: counter(ledger, decimal-leading-zero);
  content: counter(ledger, decimal-leading-zero) / "";
  grid-row: span 2;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.15;
}

.ledger h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  font-weight: 400;
  line-height: 1.2;
}

.ledger h3 a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.ledger h3 a:hover {
  color: var(--accent-strong);
}

.ledger p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 52em) {
  .ledger > li {
    grid-template-columns: 4rem minmax(0, 17rem) minmax(0, 1fr);
    gap: 0 2rem;
    align-items: baseline;
  }
  .ledger > li::before { grid-row: auto; }
}

/* Numbered steps (how we work) */

.steps {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0 1rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  content: counter(step) / "";
  grid-row: span 2;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
}

.steps h3 {
  margin: 0.2rem 0 0.4rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* Rail: the four stages of a forward deployed engagement */

.rail {
  display: grid;
  gap: 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.rail > li {
  position: relative;
  padding-left: 2.25rem;
}

.rail > li::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 0;
  width: 0.9rem;
  height: 0.9rem;
  background-color: var(--brand);
  border-radius: 50%;
}

.rail > li::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: -1.5rem;
  left: calc(0.45rem - 1px);
  width: 2px;
  background-color: var(--line-strong);
}

.rail > li:last-child::after {
  display: none;
}

.rail-step {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.rail p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 52em) {
  .rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }
  .rail > li {
    padding-top: 2rem;
    padding-left: 0;
  }
  .rail > li::before { top: 0; }
  .rail > li::after {
    top: calc(0.45rem - 1px);
    bottom: auto;
    left: 1.5rem;
    right: -1.5rem;
    width: auto;
    height: 2px;
  }
}

/* Offer cards (for short grids) */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.5rem;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
}

.card h3 {
  margin: 0 0 0.5rem;
}

.card h3 a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.card h3 a:hover {
  color: var(--accent-strong);
}

.card p {
  margin: 0;
  color: var(--muted);
}

/* Feature band */

.feature {
  background-color: var(--surface);
}

.section.feature + .section {
  border-top: 0;
}

.feature .card {
  background-color: var(--bg);
}

/* Product fact card */

.product-card {
  margin: 0;
  padding: 1.5rem;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
}

.product-card-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.1;
}

.product-card-sub {
  margin: 0 0 1rem;
  color: var(--muted);
}

.product-card dl {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.product-card dl > div {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.product-card dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-card dd {
  margin: 0;
}

/* Closing call */

.close-block > * {
  max-width: 44rem;
}

.close-block p {
  margin: 0 0 1rem;
}

.email-big {
  display: inline-block;
  margin-top: 0.5rem;
  padding-block: 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.1rem + 2.4vw, 2.75rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Long-form pages */

.prose {
  max-width: var(--measure);
}

.prose > :first-child {
  margin-top: 0;
}

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

.prose h3 {
  margin: 2rem 0 0.5rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--muted);
}

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--brand);
  font-family: var(--font-display);
  font-size: 1.1875rem;
}

.prose figure {
  margin: 2rem 0;
}

.updated {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* A numbered chapter label above an h2 in long pages (approach) */

.chapter-num {
  display: block;
  margin: 3.5rem 0 0.4rem;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.prose .chapter-num + h2 {
  margin-top: 0;
}

.prose > .chapter-num:first-child {
  margin-top: 0;
}

/* Worked example: a rule and the test it becomes */

.example {
  max-width: var(--measure);
  padding: 1.25rem 1.5rem;
  background-color: var(--tint);
  border-radius: var(--radius);
}

.prose .example {
  margin: 2rem 0;
}

.example figcaption {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.example dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.example dl > div {
  display: grid;
  gap: 0.2rem;
}

@media (min-width: 40em) {
  .example dl > div {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
  }
}

.example dt {
  font-weight: 650;
}

.example dd {
  margin: 0;
}

/* On-this-page navigation */

.toc {
  margin: 0 0 1rem;
  padding: 1.25rem 1.5rem;
  background-color: var(--surface);
  border-radius: var(--radius);
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li {
  padding-block: 0.2rem;
}

.toc a {
  display: inline-block;
  padding-block: 0.15rem;
  vertical-align: top;
}

@media (min-width: 48em) {
  .toc ol { columns: 2; column-gap: 3rem; }
  .toc li { break-inside: avoid; }
}

/* Services: one block per offer */

.offer {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.offer:first-of-type {
  border-top: 0;
}

.offer h2 {
  max-width: 28ch;
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem);
}

.offer-summary {
  max-width: var(--measure);
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
}

.facts {
  display: grid;
  gap: 1.5rem;
  max-width: 52rem;
  margin: 0;
}

.facts > div {
  display: grid;
  gap: 0.35rem;
}

@media (min-width: 48em) {
  .facts > div {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}

.facts dt {
  padding-top: 0.2rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
}

.facts dd p {
  margin: 0 0 0.75rem;
}

.facts dd p:last-child,
.facts dd ul:last-child {
  margin-bottom: 0;
}

.facts ul {
  margin: 0;
  padding-left: 1.25rem;
}

.facts li {
  margin-bottom: 0.4rem;
}

.note {
  max-width: var(--measure);
  padding: 1.25rem 1.5rem;
  background-color: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note p {
  margin: 0 0 0.75rem;
}

.note p:last-child {
  margin: 0;
}

.note h2 {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
}

.prose .note {
  margin-top: 3rem;
}

/* Industries: one ruled block per pattern */

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

.pattern {
  display: grid;
  gap: 1rem 3rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

@media (min-width: 56em) {
  .pattern { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

.pattern h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

.pattern-intro {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.pattern .facts > div {
  gap: 0.25rem 1.5rem;
}

@media (min-width: 48em) {
  .pattern .facts > div { grid-template-columns: 9rem minmax(0, 1fr); }
}

/* Insights index */

.note-list {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-item {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
}

.note-item h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
}

.note-item p {
  margin: 0;
  color: var(--muted);
}

.note-item .note-kind {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Articles (see ~/Havihi/presence/site-tools/article-template.html) */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.breadcrumb li + li::before {
  content: "/";
  content: "/" / "";
  margin-right: 0.5rem;
  color: var(--muted);
}

.breadcrumb a {
  display: inline-block;
  padding-block: 0.2rem;
}

.article-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.summary {
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  background-color: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.summary h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-family: var(--font-body);
  font-weight: 650;
}

.summary ol {
  padding-left: 1.25rem;
}

.summary li {
  margin-bottom: 0.35rem;
}

/* Links that fill a list item get enough height to be an easy target (WCAG 2.5.8) */
.summary li > a:only-child,
.prose li > a:only-child {
  display: inline-block;
  padding-block: 0.2rem;
  vertical-align: top;
}

.summary p:last-child,
.summary ul:last-child,
.summary ol:last-child {
  margin-bottom: 0;
}

.checklist {
  padding-left: 0;
  list-style: none;
}

.checklist > li {
  position: relative;
  padding-left: 2rem;
}

.checklist > li::before {
  content: "";
  position: absolute;
  top: 0.3em;
  left: 0;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--muted);
  border-radius: 3px;
}

.table-wrap {
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-weight: 650;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  background-color: var(--surface);
  border-radius: var(--radius);
}

.prose pre code {
  padding: 0;
  background: none;
}

.article-close {
  max-width: var(--measure);
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.article-close h2 {
  margin-top: 0;
}

/* Footer */

.site-footer {
  padding-block: 3rem 2rem;
  background-color: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

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

@media (min-width: 36em) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (min-width: 60em) {
  .footer-grid { grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: auto; }
}

.footer-brand p {
  max-width: 26rem;
  margin: 0 0 0.75rem;
}

.footer-brand a {
  display: inline-block;
  padding-block: 0.3rem;
}

.footer-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list a {
  display: inline-block;
  padding-block: 0.3rem;
}

.legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.legal p {
  margin: 0 0 0.35rem;
}

/* Motion: the site has almost none, and only when people haven't asked for less */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  a,
  .button,
  .nav-menu > summary {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, text-decoration-color 0.15s ease;
  }
}

/* Windows High Contrast and other forced-colour modes */

@media (forced-colors: active) {
  .button,
  .nav-menu > summary { border: 2px solid ButtonText; }
  .card,
  .note-item,
  .product-card,
  .stack,
  .stack-list li,
  .pillars > li { border-color: CanvasText; }
  .rail > li::before,
  .rail > li::after { background-color: CanvasText; }
  .page-head::after { display: none; }
}

/* Print: show where links go, drop the navigation */

@media print {
  .skip-link,
  .site-header nav,
  .nav-menu,
  .page-head::after { display: none; }

  body { background: #FFFFFF; color: #000000; }

  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  .feature,
  .site-footer,
  .toc,
  .note,
  .summary,
  .stack,
  .example { background: none; }
}

/* Spacing when an on-this-page list sits directly above a ruled list */

.toc + .patterns,
.toc + .ledger {
  margin-top: 2.5rem;
}

/* Long page with its on-this-page list beside the text on wide screens.
   The list stays first in the source, so it's also first for keyboard and screen-reader users. */

.with-aside > .toc {
  margin-bottom: 2.5rem;
}

@media (min-width: 64em) {
  .with-aside {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(0, 17rem);
    justify-content: space-between;
    align-items: start;
    gap: 0 4rem;
  }
  .with-aside > .toc {
    position: sticky;
    top: 1.5rem;
    grid-column: 2;
    grid-row: 1;
  }
  .with-aside > .toc ol { columns: 1; }
  .with-aside > .prose {
    grid-column: 1;
    grid-row: 1;
  }
}
