/* METAVO site styles. Colours: West wind palette, light and dark. */
/* Layout: left-aligned single column with an asymmetric hero (thesis left, live checkout trace right); services grouped Build / Advise / Measure. */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --sunken: #e2e8f1;
  --fg: #101b2d;
  --muted: #55627a;
  --line: #ccd5e3;
  --accent: #2348c8;
  --accent-ink: #ffffff;
  --accent-soft: #dbe3fa;
  --hot: #d4582c;
  --hot-soft: #fbe2d7;
  --ok: #1d7a43;
  --err: #b3261e;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 3.2vw, 2.25rem);
  --step-4: clamp(2.25rem, 5.4vw, 3.75rem);
  --radius: 10px;
  --wrap: 1140px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2d; --sunken: #172238; --fg: #e3e9f4; --muted: #93a1bb; --line: #26324a; --accent: #7e9bff; --accent-ink: #0a1330; --accent-soft: #1d2a52; --hot: #f08a5d; --hot-soft: #3e2418; --ok: #5fcf8b; --err: #f28b82; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b1220; --surface: #121b2d; --sunken: #172238; --fg: #e3e9f4; --muted: #93a1bb; --line: #26324a; --accent: #7e9bff; --accent-ink: #0a1330; --accent-soft: #1d2a52; --hot: #f08a5d; --hot-soft: #3e2418; --ok: #5fcf8b; --err: #f28b82; color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.eyebrow { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-width: 0; }
.brand strong { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; white-space: nowrap; }
.brand span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--fg); text-decoration: none; font-size: 0.9375rem; }
.nav a:hover { color: var(--accent); }
@media (max-width: 820px) { .nav { display: none; } .brand span { display: none; } }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-block: 72px 80px; }
.hero h1 { font-size: var(--step-4); line-height: 1.04; font-weight: 700; margin-top: 14px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: 22px; font-size: var(--step-1); color: var(--muted); max-width: 34em; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 0.9375rem/1 var(--font-body); padding: 14px 20px; border-radius: 8px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--fg); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 48px 56px; } }

/* Trace */
.trace { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -24px rgba(16, 27, 45, 0.30); overflow: hidden; min-width: 0; }
.trace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.8125rem; }
.trace-head .verb { color: var(--accent); font-weight: 500; }
.trace-head .route { color: var(--fg); overflow-wrap: anywhere; min-width: 0; flex: 1 1 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { font: 500 0.75rem/1 var(--font-mono); border: 0; padding: 7px 10px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); }
.trace-body { padding: 14px 16px 8px; }
.span-row { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 12px; align-items: center; padding-block: 5px; font-family: var(--font-mono); font-size: 0.75rem; }
.span-name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.span-track { position: relative; height: 18px; background: repeating-linear-gradient(90deg, var(--sunken) 0 1px, transparent 1px 25%); border-radius: 3px; }
.span-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: var(--accent); opacity: 0.85; transition: left 600ms cubic-bezier(.2,.7,.2,1), width 600ms cubic-bezier(.2,.7,.2,1), background-color 300ms; }
.span-bar.hot { background: var(--hot); opacity: 1; }
.span-ms { position: absolute; top: 50%; transform: translateY(-50%); font-size: 0.6875rem; color: var(--fg); white-space: nowrap; transition: left 600ms cubic-bezier(.2,.7,.2,1); }
.trace-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.trace-foot b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.trace-foot .p95 { font-size: 0.9375rem; }
@media (max-width: 480px) { .span-row { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); } }

/* Sections */
section.block { border-top: 1px solid var(--line); }
section.block > .wrap { padding-block: 80px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px 56px; align-items: end; margin-bottom: 48px; }
.section-head h2 { font-size: var(--step-3); line-height: 1.12; font-weight: 700; margin-top: 10px; }
.section-head p { color: var(--muted); max-width: 38em; }
@media (max-width: 820px) { .section-head { grid-template-columns: minmax(0, 1fr); } section.block > .wrap { padding-block: 56px; } }

/* Services */
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.group { padding: 28px 26px 30px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.group + .group { border-left: 1px solid var(--line); }
.group-tag { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.group-tag h3 { font-size: var(--step-2); font-weight: 700; }
.group-tag span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.svc h4 { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 600; font-family: var(--font-body); }
.svc p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 900px) { .groups { grid-template-columns: minmax(0, 1fr); } .group + .group { border-left: 0; border-top: 1px solid var(--line); } }

/* Why work with me */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 36px; }
.reasons li { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); min-width: 0; }
.reasons .area { align-self: flex-start; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--fg); }
.reasons h3 { font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
.reasons p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 900px) { .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .reasons { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* Approach */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 2px solid var(--fg); min-width: 0; }
.steps li::before { content: "0" counter(step); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.steps h3 { font-size: var(--step-1); font-weight: 700; }
.steps p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Experience */
.exp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.exp-copy { display: flex; flex-direction: column; gap: 16px; max-width: 36em; }
.exp-copy p { color: var(--fg); }
.exp-copy p + p { color: var(--muted); }
.worked { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.worked li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding-block: 13px; border-bottom: 1px solid var(--line); }
.worked li span:last-child { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); align-self: center; text-align: right; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.stack span { font-family: var(--font-mono); font-size: 0.75rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); background: var(--surface); }
@media (max-width: 820px) { .exp { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Certifications */
.hero-certs { display: flex; align-items: center; gap: 14px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 34em; }
.hero-certs img { width: 52px; height: 52px; flex: none; }
.hero-certs p { font-size: 0.875rem; color: var(--muted); line-height: 1.45; min-width: 0; }
.hero-certs strong { color: var(--fg); font-weight: 600; }
.certs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.cert { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: start; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cert img { width: 96px; height: 96px; }
.cert .eyebrow { font-size: 0.6875rem; }
.cert h3 { font-size: var(--step-1); font-weight: 700; margin-top: 4px; }
.cert-track { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin-top: 2px; }
.cert-desc { color: var(--muted); font-size: 0.9375rem; margin-top: 10px; }
@media (max-width: 640px) { .certs { grid-template-columns: minmax(0, 1fr); } .cert { grid-template-columns: 72px minmax(0, 1fr); } .cert img { width: 72px; height: 72px; } }

/* Contact */
.contact { background: var(--sunken); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; }
.contact-side { display: flex; flex-direction: column; gap: 18px; }
.contact-side h2 { font-size: var(--step-3); line-height: 1.12; }
.contact-side p { color: var(--muted); max-width: 30em; }
.expect { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.9375rem; }
.expect li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 8px; }
.expect li::before { content: "→"; color: var(--accent); font-family: var(--font-mono); }
form.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label, legend { font-size: 0.875rem; font-weight: 500; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="url"], select, textarea { font: inherit; font-size: 0.9375rem; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 11px 12px; width: 100%; min-width: 0; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8125rem; background: var(--bg); cursor: pointer; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.875rem; color: var(--muted); font-weight: 400; }
.consent input { margin-top: 4px; accent-color: var(--accent); }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.status { font-size: 0.875rem; min-height: 1.4em; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }
.success { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding-block: 24px; }
.success h3 { font-size: var(--step-2); }
.success p { color: var(--muted); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
@media (max-width: 560px) { form.card { grid-template-columns: minmax(0, 1fr); padding: 20px; } }

footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }
footer .mono { font-family: var(--font-mono); }

/* Form feedback (server-side validation) */
.field-error { color: var(--err); font-size: 0.8125rem; }
.form-status { color: var(--err); font-size: 0.875rem; }
/* Highlight a field with an error: red border plus a soft red ring, on every control type. */
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 18%, transparent); }
fieldset[aria-invalid="true"] .chip span { border-color: var(--err); }
.consent input[aria-invalid="true"] { outline: 2px solid var(--err); outline-offset: 2px; }
.field:has([aria-invalid="true"]) > label, fieldset[aria-invalid="true"] > legend { color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.success-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-width: 0; }
