/* Service and case-study subpages (built by scripts/build-pages.mjs). Same tokens as index.html. */
:root {
  --bg: #F5F5F2; --bg-2: #EFEFEA; --bg-3: #E5E5DE;
  --line: #D6D6CE; --line-soft: #E2E2DA;
  --fg: #1E1E1E; --muted: #5A5A56; --dim: #6F6F69;
  --accent: #3A5F7D; --accent-d: #2C4A62;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-d); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

.eyebrow { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .14em; color: var(--dim); margin: 0 0 14px; text-transform: uppercase; }
h1, h2, h3 { font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.02em; line-height: 1.15; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 600; max-width: 18ch; }
h2 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 600; margin-bottom: 16px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
p { margin: 0 0 14px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-family: 'IBM Plex Sans', sans-serif; font-size: 15px; font-weight: 600; }
.brand small { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .14em; color: var(--fg); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.lang:hover { border-color: var(--fg); color: var(--fg); }
.btn { display: inline-block; background: var(--fg); color: var(--bg); text-decoration: none; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s; }
.btn:hover { background: var(--accent); color: #fff; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-light { background: var(--bg); color: var(--fg); }
.btn-light:hover { background: #fff; color: var(--fg); }
@media (max-width: 480px) { .brand small { display: none; } .top .btn { padding: 9px 14px; font-size: 13px; } }

/* Hero */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--dim); padding-top: 28px; }
.crumbs a { color: var(--dim); }
.hero { padding: 48px 0 32px; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 62ch; margin-top: 20px; }
.hero-cta { margin-top: 28px; }
.client-logo { display: block; height: 44px; width: auto; margin-bottom: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 40px; }
.stats div { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--bg-2); }
.stats dt { font-family: 'IBM Plex Sans', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.stats dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }

/* Hero with a visual: text left, visual right on wide screens; visual under the text on phones */
.hero-split { display: grid; gap: 40px; }
.hero-visual { margin: 0; min-width: 0; }
.hero-visual figcaption, .fig figcaption { font-size: 13px; color: var(--dim); margin-top: 10px; line-height: 1.45; }
@media (min-width: 960px) {
  .hero-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
  .hero-split h1 { font-size: clamp(36px, 4.2vw, 50px); }
  .hero-split .lead { font-size: 19px; }
}
.frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(30,30,30,.18); }
.frame img { display: block; width: 100%; height: auto; }
.fig { margin: 24px 0 0; }
.fig img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line-soft); }

/* Shared diagram styles */
.viz { --warn: #A4472F; background: #FBFBF9; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(30,30,30,.18); font-size: 14px; line-height: 1.4; }
.viz-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px; }
.viz ul { list-style: none; margin: 0; padding: 0; }

/* Flow: sources → system → outputs */
.flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 11px; font-size: 13px; white-space: nowrap; }
.flow-core { background: var(--fg); color: var(--bg); border-radius: 10px; padding: 16px; }
.flow-core .viz-lbl { color: #A9A9A3; }
.flow-core strong { display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.flow-core li { font-size: 13px; color: #D8D8D2; padding-left: 14px; position: relative; }
.flow-core li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: #8FB3CF; }
.outs { display: grid; gap: 6px; }
.outs li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 12px; font-weight: 500; font-size: 13.5px; }
.outs li::before { content: "✓"; display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in oklab, var(--accent) 14%, #fff); color: var(--accent); font-size: 11px; font-weight: 700; }
.flow-arrow { position: relative; height: 22px; }
.flow-arrow span { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 8px); }
.flow-arrow span::after { content: ""; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
.flow-foot { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; }
@media (min-width: 520px) {
  .flow { padding: 24px; }
  .flow-core ul { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .outs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outs li { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .flow-arrow span { background-size: 100% 16px; animation: flowv 1.2s linear infinite; }
}
@keyframes flowv { to { background-position: 0 8px; } }

/* Panel mock (AI assistant, dashboard) */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 13.5px; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .12em; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; white-space: nowrap; font-weight: 400; }
.panel-body { padding: 16px; display: grid; gap: 12px; }
.msg-q { justify-self: end; max-width: 85%; margin: 0; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.msg-a { display: grid; grid-template-columns: 28px 1fr; gap: 10px; background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; }
.msg-a p { margin: 0 0 10px; }
.ai-tag { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: color-mix(in oklab, var(--accent) 14%, #fff); color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; }
.action { margin: 12px 0 0 !important; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.ask { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; color: var(--dim); background: #fff; }
.send { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 26px; align-items: center; gap: 8px; font-size: 12.5px; }
.hbar-l { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 8px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.hbar-t span { display: block; height: 100%; border-radius: 4px; background: color-mix(in oklab, var(--accent) 70%, #fff); }
.hbar-v { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; text-align: right; color: var(--muted); }
.hbar.is-low .hbar-t span { background: var(--warn); }
.hbar.is-low .hbar-l, .hbar.is-low .hbar-v { color: var(--warn); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; min-width: 0; }
.kpi .viz-lbl { margin-bottom: 6px; font-size: 9.5px; }
.kpi strong { display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.delta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--dim); }
.delta.up { color: #3F6B45; }
.delta.down { color: var(--warn); }
.dash-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) { .dash-row { grid-template-columns: 1.1fr 1fr; } }
.tile { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; min-width: 0; }
.spark { display: block; width: 100%; height: 96px; }
.alert { margin: 0; display: flex; align-items: center; gap: 10px; background: color-mix(in oklab, var(--warn) 9%, #fff); border: 1px solid color-mix(in oklab, var(--warn) 25%, #fff); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; }
.alert span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 12px; flex: none; }
@media (max-width: 420px) { .kpi strong { font-size: 16px; } .kpis { gap: 6px; } .kpi { padding: 10px; } }

/* Step flow inside a section (e.g. BrukHub) */
.hflow { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; counter-reset: none; }
.hflow li { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-weight: 500; font-size: 15px; position: relative; }
.hflow .n { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--accent); }
@media (min-width: 720px) {
  .hflow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .hflow li { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; }
  .hflow li:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 14px; }
}

/* Content */
.content { max-width: 760px; }
.content section { padding: 28px 0; border-top: 1px solid var(--line-soft); }
.list { margin: 0; padding-left: 20px; }
.list li { margin-bottom: 10px; }
.list li::marker { color: var(--accent); }
a.ext { font-weight: 500; }

.quote { margin: 12px 0 8px; padding: 24px 28px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 8px 8px 0; }
.quote blockquote { margin: 0 0 12px; font-family: 'IBM Plex Sans', sans-serif; font-size: 20px; line-height: 1.4; }
.quote figcaption { font-size: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 20px; color: var(--fg); text-decoration: none; background: var(--bg); transition: border-color .2s; }
.card:hover { border-color: var(--accent); color: var(--fg); }
.card .eyebrow { margin: 0; font-size: 11px; }
.card-title { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.3; }
.card-fact { color: var(--muted); font-size: 15px; }
.card-more { color: var(--accent); font-size: 14px; font-weight: 500; margin-top: auto; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; }
.steps .n { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent); padding-top: 3px; }
.steps p { color: var(--muted); margin: 0; }

.faq details { border-bottom: 1px solid var(--line-soft); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { font-weight: 500; text-decoration: none; }

/* CTA band */
.cta { background: var(--fg); color: var(--bg); padding: 64px 0; margin-top: 40px; }
.cta h2 { font-size: clamp(26px, 4vw, 40px); max-width: 20ch; }
.cta p { color: #C9C9C3; max-width: 60ch; margin: 16px 0 28px; }
.cta .facts { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .1em; margin: 20px 0 0; color: #A9A9A3; }

/* Footer */
.foot { padding: 48px 0 32px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-brand p { color: var(--muted); font-size: 14px; max-width: 42ch; margin-top: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.foot ul a { color: var(--muted); text-decoration: none; }
.foot ul a:hover, .foot ul a[aria-current] { color: var(--fg); }
.social a { color: var(--muted); }
.foot-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--dim); }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
