/* vdev site. One variable layer: primitives, then semantic tokens, then rules.
   Base styles are the phone layout; wider screens are layered on with min-width. */

/* ds-allow-hardcode:start  primitive palette and scales, the only literal values in this file */
:root {
  --c-paper-50: #F6F4EF;
  --c-paper-100: #EEEBE3;
  --c-paper-200: #DCD8CF;
  --c-ink-900: #16181D;
  --c-ink-850: #1C1F25;
  --c-ink-800: #2A2E36;
  --c-ink-600: #4A4F59;
  --c-ink-400: #A3A8B1;
  --c-ink-300: #C4C8CF;
  --c-ink-950: #121418;
  --c-signal-400: #3DDC84;
  --c-signal-300: #6BE5A1;
  --c-signal-700: #0A7340;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --size-100: 0.8125rem;
  --size-200: 0.9375rem;
  --size-300: 1.0625rem;
  --size-400: 1.25rem;
  --size-500: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --size-600: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --size-700: clamp(2rem, 1.2rem + 3.4vw, 3.75rem);
  --size-800: clamp(2.65rem, 1.5rem + 5vw, 5.25rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --hairline: 1px;
  --focus-width: 3px;
  --measure: 62ch;
  --wrap: 74rem;
  --target: 2.75rem;
  --duration: 140ms;
}
/* ds-allow-hardcode:end */

/* Semantic tokens, light theme */
:root {
  color-scheme: light;
  --bg: var(--c-paper-50);
  --bg-raised: var(--c-paper-100);
  --text: var(--c-ink-900);
  --text-muted: var(--c-ink-600);
  --rule: var(--c-paper-200);
  --section-bg: var(--c-paper-100);
  --accent-fill: var(--c-signal-400);
  --accent-text: var(--c-signal-700);
  --focus: var(--c-signal-700);

  --mark-tile: var(--c-ink-900);
  --mark-line: var(--c-paper-50);

  --btn-bg: var(--c-ink-900);
  --btn-bg-hover: var(--c-ink-800);
  --btn-text: var(--c-paper-50);
  --btn-quiet-hover: var(--c-paper-100);

  --band-bg: var(--c-ink-900);
  --band-text: var(--c-paper-50);
  --band-muted: var(--c-ink-300);
  --band-focus: var(--c-signal-400);
  --invert-bg: var(--c-signal-400);
  --invert-bg-hover: var(--c-signal-300);
  --invert-text: var(--c-ink-900);
}

/* Dark theme: follows the OS unless a light theme is forced, and can be forced on */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--c-ink-950);
    --bg-raised: var(--c-ink-850);
    --text: var(--c-paper-50);
    --text-muted: var(--c-ink-400);
    --rule: var(--c-ink-800);
    --accent-text: var(--c-signal-400);
    --focus: var(--c-signal-400);
    --mark-tile: var(--c-paper-50);
    --mark-line: var(--c-ink-900);
    --btn-bg: var(--c-paper-50);
    --btn-bg-hover: var(--c-ink-300);
    --btn-text: var(--c-ink-900);
    --btn-quiet-hover: var(--c-ink-850);
    --section-bg: var(--c-ink-850);
    --band-bg: var(--c-ink-800);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--c-ink-950);
  --bg-raised: var(--c-ink-850);
  --text: var(--c-paper-50);
  --text-muted: var(--c-ink-400);
  --rule: var(--c-ink-800);
  --accent-text: var(--c-signal-400);
  --focus: var(--c-signal-400);
  --mark-tile: var(--c-paper-50);
  --mark-line: var(--c-ink-900);
  --btn-bg: var(--c-paper-50);
  --btn-bg-hover: var(--c-ink-300);
  --btn-text: var(--c-ink-900);
  --btn-quiet-hover: var(--c-ink-850);
  --section-bg: var(--c-ink-850);
  --band-bg: var(--c-ink-800);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--space-5); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--size-300);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 650; text-wrap: balance; }
p { max-width: var(--measure); text-wrap: pretty; }
svg { display: block; }
a { color: inherit; }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-width); border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-4); }

.skip-link {
  position: absolute; left: var(--space-4); top: calc(-1 * var(--space-9));
  background: var(--btn-bg); color: var(--btn-text);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); z-index: 10;
}
.skip-link:focus { top: var(--space-4); }

.icon { width: var(--space-5); height: var(--space-5); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Logo, drawn inline so it follows the theme */
.brand-mark { width: var(--space-6); height: var(--space-6); flex: none; }
.brand-mark-sm { width: var(--space-5); height: var(--space-5); }
.m-tile { fill: var(--mark-tile); }
.m-link { fill: none; stroke: var(--mark-line); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.m-ring { fill: var(--mark-tile); stroke: var(--mark-line); stroke-width: 4; }
.m-node { fill: var(--accent-fill); }
.brand-word { height: var(--space-5); width: auto; aspect-ratio: 150 / 62; }
.brand-word g { fill: none; stroke: var(--text); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons and links: default, hover, focus, active. Nothing here is disabled, async or selectable. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--target); padding: var(--space-3) var(--space-5);
  border: var(--hairline) solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: var(--size-200); line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-small { min-height: var(--target); padding: var(--space-2) var(--space-4); }
.btn-primary, .btn-small { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover, .btn-small:hover { background: var(--btn-bg-hover); }
.btn-quiet { color: var(--text); border-color: var(--rule); }
.btn-quiet:hover { background: var(--btn-quiet-hover); }
.btn-invert { background: var(--invert-bg); color: var(--invert-text); overflow-wrap: anywhere; }
.btn-invert:hover { background: var(--invert-bg-hover); }
.btn-invert:focus-visible { outline-color: var(--band-focus); }
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav-link, .footer-link { transition: background-color var(--duration) ease, color var(--duration) ease, text-decoration-color var(--duration) ease; }
}
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

/* Header */
.site-header { border-bottom: var(--hairline) solid var(--rule); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); min-height: var(--space-8); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; padding-block: var(--space-2); }
.nav-list { display: flex; align-items: center; gap: var(--space-5); list-style: none; padding: 0; }
.nav-extra { display: none; }
.nav-link {
  display: inline-flex; align-items: center; min-height: var(--target);
  font-size: var(--size-200); color: var(--text-muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.3em;
}
.nav-link:hover { color: var(--text); text-decoration-color: currentColor; }
.nav-link:active { color: var(--accent-text); }

/* Hero */
.hero { padding-block: var(--space-8) var(--space-9); }
.hero-grid { display: grid; gap: var(--space-8); }
.eyebrow { font-family: var(--font-mono); font-size: var(--size-100); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); margin-bottom: var(--space-5); }
.hero h1 { font-size: var(--size-800); line-height: 1.02; letter-spacing: -0.035em; max-width: 15ch; }
.lede { margin-top: var(--space-6); font-size: var(--size-400); line-height: 1.55; color: var(--text-muted); max-width: 52ch; }
.hero-actions { margin-top: var(--space-7); display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero-actions .btn { flex: 1 1 auto; }

.stack-figure { max-width: 18rem; }
.stack-svg { width: 100%; height: auto; }
.layer rect { fill: var(--bg-raised); stroke: var(--rule); stroke-width: 1.5; }
.layer-label { font-family: var(--font-mono); font-size: 22px; font-weight: 600; fill: var(--text); } /* ds-allow-hardcode SVG user units, scaled with the viewBox */
.layer-sub { font-family: var(--font-mono); font-size: 15px; fill: var(--text-muted); } /* ds-allow-hardcode SVG user units */
.trace { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.trace-ring { fill: var(--bg-raised); stroke: var(--text); stroke-width: 3; }
.trace-node { fill: var(--accent-fill); stroke: var(--text); stroke-width: 3; }
.stack-caption { margin-top: var(--space-4); font-size: var(--size-200); color: var(--text-muted); }

/* Services */
.section-title { font-size: var(--size-700); letter-spacing: -0.03em; max-width: 18ch; }
.services { padding-block: var(--space-9); border-top: var(--hairline) solid var(--rule); }
.services .section-title { margin-bottom: var(--space-7); }
.service { display: grid; gap: var(--space-4); align-content: start; }
.service-head { display: flex; align-items: center; gap: var(--space-3); color: var(--accent-text); }
.service-head h3 { color: var(--text); font-size: var(--size-400); }
.service-claim { font-size: var(--size-500); line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; max-width: 30ch; text-wrap: balance; }
.service p:not(.service-claim) { color: var(--text-muted); }
.service-lead { padding-bottom: var(--space-8); border-bottom: var(--hairline) solid var(--rule); }
.service-intro, .service-lead .service-body { display: grid; gap: var(--space-4); align-content: start; }
.service-lead .service-claim { font-size: var(--size-600); line-height: 1.12; letter-spacing: -0.025em; max-width: 22ch; }
.service-pair { display: grid; }
.service-pair .service { padding-block: var(--space-7); }
.service-pair .service + .service { border-top: var(--hairline) solid var(--rule); }

.ticks { list-style: none; padding: 0; display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.ticks li { display: flex; align-items: baseline; gap: var(--space-3); font-size: var(--size-200); }
.ticks li::before {
  content: ""; flex: none; width: var(--space-2); height: var(--space-2); border-radius: 50%;
  background: var(--accent-fill); box-shadow: 0 0 0 var(--hairline) var(--text); transform: translateY(-0.1em);
}

/* Approach */
.approach { background: var(--section-bg); border-top: var(--hairline) solid var(--rule); padding-block: var(--space-9); }
.approach-grid { display: grid; gap: var(--space-7); }
.pull { margin-top: var(--space-5); font-size: var(--size-400); line-height: 1.5; max-width: 40ch; }
.principles { list-style: none; padding: 0; counter-reset: step; display: grid; }
.principles li { counter-increment: step; display: grid; grid-template-columns: var(--space-6) 1fr; column-gap: var(--space-3); row-gap: var(--space-2); padding-block: var(--space-5); border-top: var(--hairline) solid var(--rule); }
.principles li:last-child { border-bottom: var(--hairline) solid var(--rule); }
.principles li::before {
  content: counter(step, decimal-leading-zero); grid-row: span 2;
  font-family: var(--font-mono); font-size: var(--size-200); color: var(--accent-text); padding-top: var(--space-1);
}
.principles h3 { font-size: var(--size-400); }
.principles p { color: var(--text-muted); }

/* Contact band */
.contact { background: var(--band-bg); color: var(--band-text); padding-block: var(--space-9); --focus: var(--band-focus); }
.contact-grid { display: grid; gap: var(--space-6); }
.contact h2 { font-size: var(--size-700); letter-spacing: -0.03em; max-width: 16ch; }
.contact-body { display: grid; gap: var(--space-6); justify-items: start; align-content: start; }
.contact-body p { color: var(--band-muted); font-size: var(--size-400); max-width: 40ch; }
.contact-details { display: grid; gap: var(--space-2); font-size: var(--size-200); color: var(--band-muted); }
.contact-details a { color: var(--band-text); }

/* Footer */
.site-footer { padding-block: var(--space-7); }
.footer-row { display: grid; gap: var(--space-4); font-size: var(--size-200); color: var(--text-muted); }
.footer-brand { display: flex; align-items: center; gap: var(--space-3); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.footer-link { display: inline-flex; align-items: center; min-height: var(--target); color: var(--text); text-underline-offset: 0.3em; overflow-wrap: anywhere; }
.footer-link:hover { color: var(--accent-text); }
.footer-link:active { color: var(--text-muted); }

/* Wider screens */
@media (min-width: 40rem) {
  .nav-extra { display: list-item; }
  .hero-actions .btn { flex: 0 0 auto; }
}
@media (min-width: 48rem) {
  .wrap { padding-inline: var(--space-6); }
  .hero { padding-block: var(--space-9) var(--space-10); }
  .stack-figure { max-width: 24rem; }
  .service-lead { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .service-lead .service-body { padding-top: var(--space-7); }
  .service-pair { grid-template-columns: 1fr 1fr; }
  .principles li { grid-template-columns: var(--space-7) 1fr; column-gap: var(--space-4); }
  .service-pair .service { padding-block: var(--space-7) var(--space-2); }
  .service-pair .service:first-child { padding-right: var(--space-6); }
  .service-pair .service + .service { border-top: 0; border-left: var(--hairline) solid var(--rule); padding-left: var(--space-6); }
  .contact-grid { grid-template-columns: 7fr 5fr; gap: var(--space-7); align-items: end; }
  .footer-row { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 64rem) {
  .hero-grid { grid-template-columns: 7fr 5fr; align-items: center; gap: var(--space-9); }
  .stack-figure { justify-self: end; }
  .approach-grid { grid-template-columns: 5fr 7fr; gap: var(--space-9); }
  .approach-intro { position: sticky; top: var(--space-6); align-self: start; }
}