/* Hallmark · genre: editorial · macrostructure: Map / Diagram
 * H9 hero knobs: method=Tier-A pure-CSS grid, animation=one-shot assemble, scale=dominant
 * nav: N9 edge-aligned · section heads: S2 hanging · work: F3 tabular · CTA: C1 outlined · footer: Ft4 dense
 * theme: custom · vibe: "certification dashboard, cool paper, one signal"
 * paper: oklch(94.7% 0.007 116) · accent: oklch(50.1% 0.209 270)
 * display: Archivo Expanded · body: Public Sans · axes: light / geometric-sans / cool
 * enrichment: Tier A (pure CSS, no assets) · studied: no · context: user-provided
 * pre-emit critique: P5 H5 E4 S5 R4 V4
 * contrast: pass (40-41) · nav: N9 · footer: Ft4 · slop: pass (42-45)
 * honest: pass (46) · chrome: pass (47) · tokens: pass (48) · icons: pass (30)
 * responsive: pass (34, 49, 50-57) - verified 320/375/414/768/1024/1920, no overflow
 * lighthouse: 100 perf / 100 a11y / 100 best-practices / 100 seo (CLS 0, TBT 0ms)
 * print: stylesheet present - form dropped, hrefs spelled out, matrix outlined
 */

/* ---------- Fonts · self-hosted, latin subset, variable ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600 700;
  font-stretch: 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-expanded-600-700-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/public-sans-400-600-latin.woff2") format("woff2");
}

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

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-style: normal;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

p, ul, dl { margin: 0; }
a { color: var(--color-accent); }

.tnum { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Placeholder marker. Every one of these is a slot waiting on a real value. */
.ph {
  color: var(--color-muted);
  background: var(--color-paper-2);
  padding: 0 var(--space-2xs);
  border-bottom: var(--rule-hairline) dashed var(--color-border);
}

/* ---------- Focus · instant, never animated ---------- */
:focus-visible {
  outline: var(--rule-heavy) solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: calc(var(--space-md) * -4);
  z-index: var(--z-sticky);
  background: var(--color-paper);
  color: var(--color-accent);
  padding: var(--space-sm) var(--space-md);
  border: var(--rule-hairline) solid var(--color-accent);
}
.skip-link:focus { top: var(--space-md); }

/* ---------- Layout shell ---------- */
.masthead,
.hero,
.tracks,
.work,
.call,
.contact,
.colophon {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------- N9 · Edge-aligned masthead ---------- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-lg);
  padding-block: var(--space-xl) var(--space-2xl);
}
.wordmark {
  color: var(--color-ink);          /* the wordmark is a link on doc pages;
                                       indigo is reserved for real actions */
  text-decoration: none;
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}
.wordmark:hover { text-decoration: underline; }

.availability {
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero { padding-bottom: var(--space-3xl); }

.hero__title {
  font-weight: 700;
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: -0.022em;
  max-width: 16ch;
  overflow-wrap: anywhere;
}

.hero__lede {
  margin-top: var(--space-lg);
  max-width: 60ch;
  font-size: var(--text-md);
  color: var(--color-ink);
}

/* ---------- The port matrix · the page's one bold element ----------
 * Hairlines are drawn by the panel background showing through a 1px grid
 * gap — no per-cell borders, so no doubled rules at the seams. */
.matrix-figure { margin: var(--space-2xl) 0 0; }

.matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--rule-hairline);
  list-style: none;
  margin: 0;
  padding: var(--rule-hairline);
  background: var(--color-hairline);
  border: var(--rule-hairline) solid var(--color-hairline);
}

.matrix__cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-paper-2);
  padding: var(--space-lg) var(--space-lg);
  min-width: 0;

}

/* Row index lives here, not in a style attribute — inline styles are blocked
 * by the CSP, which silently flattened the stagger to zero. */
.matrix__cell:nth-child(-n + 3)               { --row: 0; }
.matrix__cell:nth-child(n + 4):nth-child(-n + 6) { --row: 1; }
.matrix__cell:nth-child(n + 7)                { --row: 2; }

@media (prefers-reduced-motion: no-preference) {
  .matrix__cell {
    opacity: 0;
    transform: translateY(6px);
    animation: cell-in var(--dur-long) var(--ease-out) calc(var(--row, 0) * 90ms) both;
  }
}

.matrix__name {
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* Three states. Shape carries the distinction — fill, outline, dash —
 * so the teal is reinforcement, never the only signal. */
.matrix__mark {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  display: inline-block;
}
.matrix__mark[data-state="shipped"]     { background: var(--color-shipped); }
.matrix__mark[data-state="integrated"]  { border: var(--rule-heavy) solid var(--color-shipped); }
.matrix__mark[data-state="unconfirmed"] { border: var(--rule-hairline) dashed var(--color-border); }

@keyframes cell-in { to { opacity: 1; transform: none; } }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* C3 · typographic link. The hero's only action; the chip CTA stays below. */
.hero__action { margin-top: var(--space-xl); }
.link-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-accent);
  text-decoration-thickness: var(--rule-hairline);
  text-underline-offset: 0.22em;
  white-space: nowrap;
}
.link-cta:hover { text-decoration-thickness: var(--rule-heavy); }

/* ---------- S2 · Hanging section heads ---------- */
.head-hang { padding-block: 0 var(--space-lg); }
.head-hang h2 {
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.note {
  color: var(--color-muted);
  font-size: var(--text-sm);
  max-width: var(--measure);
}

/* ---------- Two tracks · 62 / 38 ----------
 * The imbalance is the message. */
.tracks {
  display: grid;
  grid-template-columns: 62fr 38fr;
  gap: var(--space-4xl);
  padding-block: var(--space-3xl) var(--space-4xl);
  border-top: var(--rule-hairline) solid var(--color-hairline);
}

.plain-list {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
}
.plain-list li { padding-block: var(--space-2xs); }

.packages { margin-top: var(--space-md); }
.packages__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem;
  grid-template-areas:
    "name price"
    "desc price";
  column-gap: var(--space-lg);
  row-gap: var(--space-2xs);
  padding-block: var(--space-md);
  border-top: var(--rule-hairline) solid var(--color-hairline);
}
.packages__row dt { grid-area: name; }
.packages__row dd:not(.packages__price) { grid-area: desc; max-width: 52ch; }
.packages__price { grid-area: price; white-space: nowrap; }
.packages__row dt {
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
}
.packages__row dd { margin: 0; color: var(--color-muted); }
.packages__price { text-align: right; }

.day-rate {
  margin-top: var(--space-md);
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
  font-size: var(--text-md);
}

/* ---------- F3 · Selected work, tabular ---------- */
.work { padding-bottom: var(--space-4xl); }

.work__item {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr) minmax(0, 12rem);
  grid-template-areas:
    "title detail metric"
    "role  detail metric"
    "plat  detail metric";
  align-items: start;
  column-gap: var(--space-xl);
  row-gap: var(--space-2xs);
  padding-block: var(--space-xl);
  border-top: var(--rule-hairline) solid var(--color-hairline);
}
.work__title     { grid-area: title; }
.work__role      { grid-area: role; }
.work__platforms { grid-area: plat; }
.work__detail    { grid-area: detail; }
.work__metric    { grid-area: metric; }
.work__item:last-child { border-bottom: var(--rule-hairline) solid var(--color-hairline); }

.work__title {
  font-weight: 600;
  font-size: var(--text-md);
  margin: 0 0 var(--space-xs);
}
.work__role,
.work__platforms { font-size: var(--text-sm); color: var(--color-muted); }
.work__detail { max-width: var(--measure); }
.work__metric { text-align: right; color: var(--color-muted); }

/* ---------- Call CTA ---------- */
.call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  padding-block: var(--space-2xl);
  border-top: var(--rule-hairline) solid var(--color-hairline);
  border-bottom: var(--rule-hairline) solid var(--color-hairline);
}
.call__line {
  font-family: var(--font-display);
  font-stretch: var(--font-display-width);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

/* ---------- C1 · Outlined chip ---------- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
  border: var(--rule-hairline) solid var(--color-accent);
  border-radius: var(--radius-control);
  color: var(--color-accent);
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out);
}
.cta:hover { background: var(--color-accent); color: var(--color-accent-ink); }
.cta:active { transform: translateY(1px); }

.cta:disabled,
.cta[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  background: transparent;
  color: var(--color-muted);
  border-color: var(--color-border);
}

.cta--filled {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.cta--filled:hover {
  background: var(--color-ink);
  border-color: var(--color-ink);
}

/* ---------- Contact form ---------- */
.contact { padding-block: var(--space-3xl) var(--space-4xl); }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-xl);
  margin-top: var(--space-xl);
  max-width: 54rem;
}
.field { display: flex; flex-direction: column; gap: var(--space-2xs); }
.field--wide { grid-column: 1 / -1; }

.field label {
  font-size: var(--text-sm);
  font-weight: 600;
}
.field__optional { font-weight: 400; color: var(--color-muted); }
.field__help {
  margin: 0;
  min-height: 1lh;          /* reserved, so an error at milestone 5 shifts nothing */
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-paper-2);
  border: var(--rule-hairline) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: var(--space-sm);
  min-height: 44px;
  outline: var(--rule-heavy) solid transparent;   /* held at rest — no shift on focus */
  outline-offset: 1px;
  transition: border-color var(--dur-micro) var(--ease-out);
}
.field textarea { resize: vertical; line-height: var(--leading-body); }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--color-ink); }

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-paper);
  color: var(--color-muted);
  border-color: var(--color-hairline);
}

/* Error + status states.
 * No new hue: the palette's five values each carry one meaning, and none of
 * them is "error". The signal is border weight, ink-weight text and the
 * message itself — never colour alone, which wouldn't have been enough anyway. */
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--color-ink);
  background: var(--color-paper);
}
.field__help--error {
  color: var(--color-ink);
  font-weight: 600;
}

.form__status {
  margin: 0;
  min-height: 1lh;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.form__status--error,
.form__status--ok {
  color: var(--color-ink);
  font-weight: 600;
  max-width: var(--measure);
}

.form__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

/* .form is display:grid, which would beat the UA stylesheet's [hidden] rule —
 * without this the form stays visible after a successful send. */
.form[hidden] { display: none; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Document pages · legal, privacy, 404 ----------
 * Same tokens, single column, prose measure. No matrix, no tracks. */
.doc {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  padding-block: var(--space-xl) var(--space-4xl);
}
.doc h1 {
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.doc h2 {
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
  border-top: var(--rule-hairline) solid var(--color-hairline);
}
.doc__lede {
  margin-top: var(--space-md);
  max-width: 60ch;
  font-size: var(--text-md);
  color: var(--color-muted);
}
.doc p { max-width: var(--measure); margin-top: var(--space-sm); }

.doc__dl {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  column-gap: var(--space-xl);
  row-gap: var(--space-sm);
  margin-top: var(--space-md);
  max-width: 62rem;
}
.doc__dl dt { font-weight: 600; }
.doc__dl dd { margin: 0; color: var(--color-muted); max-width: var(--measure); }

@media (max-width: 40rem) {
  .doc__dl {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-2xs);
  }
  .doc__dl dd { margin-bottom: var(--space-sm); }
}

/* ---------- Ft4 · Dense colophon ---------- */
.colophon {
  padding-block: var(--space-xl) var(--space-3xl);
  border-top: var(--rule-hairline) solid var(--color-hairline);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.colophon__body { max-width: 74ch; }
.colophon__links { margin-top: var(--space-sm); }
.colophon__links a { text-decoration-thickness: var(--rule-hairline); }
.colophon__links a:hover { text-decoration-thickness: var(--rule-heavy); }

/* ---------- Responsive ----------
 * 60rem is the layout breakpoint (columns collapse); 40rem is the typography
 * breakpoint (the page is a phone — space is a luxury). Porting leads the
 * stack on every width; the imbalance becomes an order instead of a ratio. */

@media (max-width: 60rem) {
  .tracks {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3xl);
    padding-block: var(--space-2xl) var(--space-3xl);
  }

  .matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .work__item {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "role" "plat" "detail" "metric";
    row-gap: var(--space-xs);
    padding-block: var(--space-lg);
  }
  .work__metric { text-align: left; margin-top: var(--space-2xs); }

  .form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2xs);
    padding-block: var(--space-lg) var(--space-xl);
  }

  .matrix { grid-template-columns: minmax(0, 1fr); }
  .matrix__cell { padding: var(--space-md); }

  .legend { gap: var(--space-sm) var(--space-md); }

  .packages__row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "price" "desc";
    row-gap: var(--space-2xs);
  }
  .packages__price { text-align: left; }

  .hero { padding-bottom: var(--space-2xl); }
  .matrix-figure { margin-top: var(--space-xl); }
  .head-hang h2 { font-size: var(--text-md); }
  .contact { padding-block: var(--space-2xl) var(--space-3xl); }
  .colophon { padding-block: var(--space-lg) var(--space-2xl); }
}

/* ---------- Print ----------
 * Producers forward and print these. Drop the form (nothing to submit on
 * paper), keep the matrix, and spell out every href the reader can't click. */
@media print {
  @page { margin: 16mm; }

  html, body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  .skip-link,
  .contact,
  .hero__action { display: none; }

  .call .cta {
    border: none;
    padding: 0;
    min-height: 0;
    font-weight: 600;
  }
  .call .cta::after { content: " — " attr(href); font-weight: 400; font-size: 9pt; }

  .masthead,
  .hero,
  .tracks,
  .work,
  .call,
  .colophon { max-width: none; padding-inline: 0; }

  .tracks {
    grid-template-columns: 62fr 38fr;
    gap: 10mm;
    padding-block: 6mm;
  }

  .hero__title { font-size: 26pt; }
  .head-hang h2 { font-size: 15pt; }

  .matrix {
    background: none;
    border: none;
    gap: 0;
  }
  .matrix__cell {
    background: none;
    border: 0.5pt solid #000;
    padding: 3mm;
    opacity: 1;
    transform: none;
    animation: none;
  }
  /* Fills don't survive a mono printer — every state becomes an outline,
   * and the shape still separates them. */
  .matrix__mark[data-state="shipped"] { background: #000; border: none; }
  .matrix__mark[data-state="integrated"] { border: 1pt solid #000; background: none; }
  .matrix__mark[data-state="unconfirmed"] { border: 0.5pt dashed #000; background: none; }

  .ph { background: none; border-bottom: 0.5pt dashed #000; }

  a { color: #000; text-decoration: underline; }
  .colophon__links a::after,
  .call__line + * a::after { content: " (" attr(href) ")"; font-size: 8pt; }

  .work__item,
  .packages__row { break-inside: avoid; }

  .tracks, .work, .call, .colophon { border-color: #000; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-delay: 0ms !important;
    transition-duration: 150ms !important;
  }
}
