/* Nau Labs — shared layout and typography.
   Colors come from the palette file (theme-a.css, theme-b.css or theme-c.css).
   Layout: dark hero band with a pipeline "run log", then light content bands in a 1120px column. */

:root {
  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --max: 1120px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink-strong); }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: 1.15rem; }
p { margin: 0; }
.mono { font-family: var(--font-mono); }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eyebrow);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.6rem 1.2rem;
  border-radius: 8px; border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--hero-ink); border-color: var(--hero-line); }
.btn-ghost:hover { border-color: var(--hero-ink); }
.btn-small { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.9rem; background: var(--accent); color: var(--on-accent); }
.btn-small:hover { background: var(--accent-hover); }
.btn-block { width: 100%; margin-top: 1.25rem; }

/* Header */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--hero-bg);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--hero-bg); color: var(--hero-ink);
  border-bottom: 1px solid var(--hero-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--hero-ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--hero-soft); }
.brand-mark .node { fill: var(--hero-ink); }
.brand-mark .node-accent { fill: var(--accent); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a:not(.btn) { color: var(--hero-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:not(.btn):hover { color: var(--hero-ink); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* Hero */
.hero { background: var(--hero-bg); color: var(--hero-ink); }
.hero-grid {
  display: grid; gap: 2.5rem; align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4rem; } }
.hero-copy { display: grid; gap: 1.25rem; min-width: 0; }
.hero h1 { color: var(--hero-ink); }
.hero .eyebrow { color: var(--hero-eyebrow); }
.lede { font-size: 1.15rem; line-height: 1.6; max-width: 36em; }
.hero .lede { color: var(--hero-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* Run log card */
.runlog {
  margin: 0; min-width: 0;
  background: var(--hero-panel);
  border: 1px solid var(--hero-line);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.runlog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 0.9rem; border-bottom: 1px dashed var(--hero-line); color: var(--hero-soft); }
.status { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--accent); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.runlog-steps { list-style: none; margin: 0; padding: 0.9rem 0; display: grid; gap: 0.7rem; }
.runlog-steps li { display: grid; grid-template-columns: 1.4rem 6.5rem minmax(0, 1fr); align-items: baseline; color: var(--hero-muted); }
.runlog-steps .step { color: var(--hero-ink); }
.runlog-steps .detail { color: var(--hero-muted); overflow-wrap: anywhere; }
.runlog-steps .is-done .mark { color: var(--ok); }
.runlog-steps .is-active .mark, .runlog-steps .is-active .step { color: var(--accent); }
.runlog-steps li:not(.is-done):not(.is-active) .step { color: var(--hero-muted); }
.runlog-bar { height: 6px; border-radius: 3px; background: var(--hero-line); overflow: hidden; }
.runlog-bar span { display: block; height: 100%; width: 62%; background: var(--accent); border-radius: 3px; }
.runlog figcaption { margin-top: 0.75rem; color: var(--hero-muted); font-size: 0.8rem; }
@media (max-width: 420px) { .runlog-steps li { grid-template-columns: 1.4rem 5.5rem minmax(0, 1fr); font-size: 0.82rem; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Audience strip */
.audience { background: var(--surface); border-bottom: 1px solid var(--line); }
.audience-grid { display: grid; gap: 0.75rem; padding-block: 1.25rem; align-items: center; }
@media (min-width: 900px) { .audience-grid { grid-template-columns: auto 1fr; gap: 2rem; } }
.audience-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.audience ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.audience li { position: relative; padding-left: 1rem; color: var(--ink-strong); font-weight: 500; }
.audience li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 0.75rem; max-width: 46rem; margin-bottom: 2.5rem; }

.service-group + .service-group { margin-top: 3rem; }
.group-title {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand);
  margin-bottom: 1.25rem;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cards { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 720px) and (max-width: 979px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards-3 > :last-child { grid-column: 1 / -1; } }
@media (min-width: 980px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  display: flex; flex-direction: column; gap: 0.75rem; min-width: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
}
.card p { color: var(--ink-soft); }
.card ul { margin: 0.25rem 0 0; padding: 0.9rem 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: 0.45rem; }
.card li { position: relative; padding-left: 1.1rem; font-size: 0.95rem; color: var(--ink); }
.card li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 7px; height: 2px; background: var(--brand); }
.tag { font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--brand) !important; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; counter-reset: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { display: grid; gap: 0.5rem; align-content: start; padding-top: 1rem; border-top: 2px solid var(--brand); }
.steps li p:last-child { color: var(--ink-soft); }
.step-num { font-size: 0.85rem; color: var(--brand); }

/* Engagements */
.engage .card-feature { background: var(--feature-bg); border-color: var(--feature-bg); }
.engage .card-feature h3 { color: var(--feature-ink); }
.engage .card-feature p { color: var(--feature-soft); }
.engage .card-feature .engage-meta { color: var(--accent) !important; }
.engage-meta { font-size: 0.82rem; color: var(--brand) !important; }

/* About */
.about-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4rem; } }
.about-copy { display: grid; gap: 1rem; max-width: 40rem; color: var(--ink); }
.facts { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.facts li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; padding-block: 0.6rem; border-top: 1px solid var(--line); }
.facts .mono { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); padding-top: 0.15rem; }

/* Contact */
.contact-grid { display: grid; gap: 2rem; align-items: center; }
.contact-grid > div:first-child { display: grid; gap: 1rem; }
.contact .lede { color: var(--ink-soft); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 4rem; } }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; min-width: 0; }
.contact-label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.contact-value { font-size: 1.3rem; font-weight: 600; margin: 0.15rem 0 1rem; overflow-wrap: anywhere; }
.contact-value a { color: var(--ink-strong); text-decoration: none; border-bottom: 2px solid var(--accent); }

/* Footer */
.site-footer { background: var(--hero-bg); color: var(--hero-muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.75rem; }

/* Track record */
.record {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 640px) { .record { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .record { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.record li { background: var(--card); padding: 1.5rem; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.record .fig { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 600; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.record p:last-child { color: var(--ink-soft); font-size: 0.97rem; }

/* Track record: five items fill 3 + 2 on wide screens, 2 + 2 + 1 on tablets */
@media (min-width: 640px) and (max-width: 979px) { .record li:last-child { grid-column: 1 / -1; } }
@media (min-width: 980px) {
  .record { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .record li { grid-column: span 2; }
  .record li:nth-child(n+4) { grid-column: span 3; }
}
