/* ─────────────────────────────────────────────────────────────
   Berryman Data Systems, LLC
   Palette derives from the subject: DPD reagent rose (the colour a
   free-chlorine field test turns) as the single accent, on the cool
   off-white of an engineering report.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper:    #F0F3F2;
  --paper-2:  #E1E9E7;
  --ink:      #101F1E;
  --slate:    #566664;
  --rule:     #CCD6D3;
  --reagent:  #A8325E;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 36rem;
  --rail: 8rem;
  --page: 61rem;

  /* Full-bleed backgrounds, centred content. */
  --pad-x: max(var(--gutter), (100% - var(--page)) / 2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #0C1817;
    --paper-2: #162726;
    --ink:     #E4EBE9;
    --slate:   #8DA09D;
    --rule:    #223533;
    --reagent: #EC7BA5;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  z-index: 10;
}
.skip:focus { left: 0; }

:where(a, button):focus-visible {
  outline: 2px solid var(--reagent);
  outline-offset: 3px;
}

/* ── Top bar ──────────────────────────────────────────────── */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem var(--pad-x);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topbar__mark {
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}
.topbar__mark:hover { color: var(--reagent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.6rem;
}

.nav a {
  color: var(--slate);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--reagent); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--reagent);
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  padding: clamp(3.5rem, 11vw, 8rem) var(--pad-x) clamp(2.5rem, 7vw, 5rem);
}

.hero__inner { max-width: 62rem; }

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(2.35rem, 6.6vw, 5.1rem);
  line-height: 1.02;
  letter-spacing: -.028em;
  text-wrap: balance;
}

/* Below 36rem the authored breaks orphan a word — let it wrap naturally. */
.hero__title span { display: inline; }

@media (min-width: 36rem) {
  .hero__title span { display: block; }
}

.hero__lede {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  max-width: 36rem;
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.55;
  color: var(--slate);
}

/* metadata strip under the hero */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2.5rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}

.strip__cell dt {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--reagent);
}

.strip__cell dd {
  margin: .5rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  letter-spacing: -.005em;
}

/* ── Bands (rail + body) ──────────────────────────────────── */

.band {
  display: grid;
  gap: 1rem 2.5rem;
  padding: clamp(3rem, 7vw, 5.5rem) var(--pad-x);
  border-top: 1px solid var(--rule);
}

.band--accent { background: var(--paper-2); }

/* The record band is always dark. Built on literals, not --ink/--paper,
   which invert under prefers-color-scheme and would flip it light. */
.band--record {
  background: #101F1E;
  color: #F0F3F2;
}
.band--record .lead-head { color: #F0F3F2; }
.band--record .lead-text { color: #A9BAB7; }

/* --reagent at 2.7:1 on this ground fails; the lighter tint gives 6.4:1. */
.band--record .eyebrow,
.band--record .record__row dt { color: #EC7BA5; }

@media (prefers-color-scheme: dark) {
  /* Lift it off the page rather than matching it. */
  .band--record { background: #172A28; }
}

@media (min-width: 62rem) {
  .band {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: 0 3rem;
  }
  .band__rail { grid-column: 1; }
  .band__body { grid-column: 2; max-width: 50rem; }
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--reagent);
}

/* ── Capability list ──────────────────────────────────────── */

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

.defs__item {
  padding: 1.7rem 0;
  border-top: 1px solid var(--rule);
}
.defs__item:first-child { border-top: 0; padding-top: 0; }
.defs__item:last-child { padding-bottom: 0; }

.defs__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 105%;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -.012em;
}

.defs__text {
  margin: .55rem 0 0;
  max-width: var(--measure);
  color: var(--slate);
}

.defs__meta {
  margin: .85rem 0 0;
  font-family: var(--font-mono);
  font-size: .74rem;
  line-height: 1.6;
  letter-spacing: .01em;
  color: var(--ink);
  opacity: .62;
}

/* ── Lead copy ────────────────────────────────────────────── */

.lead-head {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 108%;
  font-size: clamp(1.6rem, 3.1vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -.022em;
}

.lead-text {
  margin: 0 0 1.1rem;
  max-width: var(--measure);
  color: var(--slate);
}


/* ── Sub-page hero ────────────────────────────────────────── */

.hero--sub { padding-bottom: clamp(1.75rem, 4vw, 3rem); }

.hero__kicker {
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--reagent);
}

.hero__title--sub {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  max-width: 20ch;
}

/* ── Cross-page link ──────────────────────────────────────── */

.more { margin: 2rem 0 0; }

.more__link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--reagent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.more__link::after {
  content: " \2192";
  /* the arrow should not pick up the underline */
  border-bottom: 0;
}
.more__link:hover { color: var(--ink); }

.band--record .more__link { color: #EC7BA5; }
.band--record .more__link:hover { color: #F0F3F2; }

/* ── Tag list ─────────────────────────────────────────────── */

.sub-head {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -.008em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-family: var(--font-mono);
  font-size: .74rem;
  line-height: 1.4;
  padding: .4rem .7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--slate);
}

/* ── Schema list (domain depth) ───────────────────────────── */

.schema {
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
  border-top: 2px solid var(--ink);
}

.schema__row {
  display: grid;
  gap: .3rem 2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.schema__row:last-child { border-bottom: 0; }

@media (min-width: 40rem) {
  .schema__row { grid-template-columns: 11.5rem minmax(0, 1fr); }
}

.schema__row dt {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.5;
  padding-top: .18rem;
  color: var(--ink);
}

.schema__row dd {
  margin: 0;
  color: var(--slate);
  font-size: 1rem;
}

/* ── Record block (signature) ─────────────────────────────── */

.record {
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.7;
}

.record__row {
  display: grid;
  gap: 0 2rem;
  padding: .62rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.record__row:last-child { border-bottom: 0; }

@media (min-width: 40rem) {
  .record__row { grid-template-columns: 8.5rem minmax(0, 1fr); }
}

.record__row dt {
  color: var(--reagent);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .68rem;
  padding-top: .2rem;
}

.record__row dd { margin: 0; }

.record__row a { text-decoration-color: var(--reagent); text-underline-offset: 3px; }
.record__row a:hover { color: var(--reagent); }

.cta { margin: 2.5rem 0 0; }

.cta__link {
  display: inline-block;
  padding: .8rem 1.6rem;
  background: var(--reagent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform .16s ease, filter .16s ease;
}
.cta__link:hover { filter: brightness(1.12); transform: translateY(-1px); }

@media (prefers-color-scheme: dark) {
  /* --reagent lightens in dark mode; white on it fails contrast. */
  .cta__link { color: #0C1817; }
}

/* ── Footer ───────────────────────────────────────────────── */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 2rem;
  justify-content: space-between;
  padding: 1.75rem var(--pad-x);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--slate);
}

.foot p { margin: 0; }

/* ── Motion ───────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(.5rem);
  animation: rise .45s cubic-bezier(.2, .7, .3, 1) forwards;
}
.reveal--1 { animation-delay: .02s; }
.reveal--2 { animation-delay: .07s; }
.reveal--3 { animation-delay: .12s; }
.reveal--4 { animation-delay: .19s; }
.reveal--5 { animation-delay: .25s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .cta__link { transition: none; }
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .band--record { background: #fff; color: #000; }
  .band--record .lead-text, .record__row dd { color: #000; }
  .record__row { border-bottom: 1px solid #bbb; }
  .record__row dt { color: #000; }
  .cta, .skip { display: none; }
  .reveal { opacity: 1; transform: none; animation: none; }
}
