:root {
  --ink: #111111; --paper: #ffffff; --gray: #EAEAEA; --muted: #5C5C5C;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow-border: 0 0 0 1px oklch(0 0 0 / .06), 0 1px 2px -1px oklch(0 0 0 / .06), 0 2px 4px 0 oklch(0 0 0 / .04);
  --shadow-border-hover: 0 0 0 1px oklch(0 0 0 / .08), 0 1px 2px -1px oklch(0 0 0 / .08), 0 2px 4px 0 oklch(0 0 0 / .06);
  --ease: cubic-bezier(.2, 0, 0, 1);
  --gutter: clamp(20px, 5.5vw, 80px);
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
section { scroll-margin-top: 88px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 22px; border-radius: 10px; border: 0; font: inherit; font-size: 16px; text-decoration: none; cursor: pointer;
  transition-property: scale, background-color, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out; }
.btn:active { scale: .96; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background-color: #2A2A2A; }
.btn-soft { background: #fff; color: var(--ink); box-shadow: var(--shadow-border); }
.btn-soft:hover { box-shadow: var(--shadow-border-hover); }
.btn.icon-r { padding: 0 20px 0 22px; }
.btn .arr { transition: translate 150ms ease-out; }
.btn:hover .arr { translate: 3px 0; }
.btn-sm { height: 44px; padding: 0 20px; font-size: 15px; }

/* Header */
header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--gray); }
.bar { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.logo img { width: 180px; height: auto; display: block; }
.menu-toggle { display: none; }
nav { display: flex; align-items: center; gap: 8px; }
.navlink { height: 44px; padding: 0 16px; display: flex; align-items: center; font-size: 15px; text-decoration: none; color: var(--muted); transition: color 120ms ease-out; }
.navlink:hover { color: var(--ink); }
nav .btn { margin-left: 16px; }

/* Hero */
.hero { position: relative; min-height: 812px; display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 2; max-width: 640px; }
.hero h1 { margin: 28px 0 0; font-size: clamp(56px, 8vw, 116px); line-height: .93; letter-spacing: -.048em; font-weight: 700; }
.hero h1 span { display: inline-block; }
.hero .lede { margin: 32px 0 44px; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.3; letter-spacing: -.01em; color: var(--muted); max-width: 520px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.art { position: absolute; left: 50%; top: 50%; width: 640px; height: 560px; translate: 0 -50%; }
.art svg { position: absolute; inset: 0; overflow: visible; }
.art.motion-paused .drift, .art.motion-paused .dot { animation-play-state: paused; }
/* Dot layer in the SVG's own 640×560 space, scaled to the rendered graphic (--art-scale set by site.js) */
.art-dots { position: absolute; left: 0; top: 0; width: 640px; height: 560px; transform-origin: 0 0; transform: scale(var(--art-scale, 1)); pointer-events: none; }

/* Motion */
@keyframes enter { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
/* "backwards" (not "both"): once the entrance ends, no filter/transform stays applied.
   A lingering blur(0) makes Safari rasterise the element, which softens the hero graphic. */
.enter { animation: enter 600ms var(--ease) backwards; }
@keyframes drift { from { transform: translateY(-14px) translateX(-4px); } to { transform: translateY(14px) translateX(4px); } }
.drift { animation: drift 9s ease-in-out infinite alternate; }
.drift.b { animation-duration: 12s; animation-delay: -4s; }
.drift.c { animation-duration: 8s; animation-delay: -7s; }
.drift.d { animation-duration: 14s; animation-delay: -2s; }
@keyframes flow { 0% { offset-distance: 0%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
.dot { position: absolute; left: 0; top: 0; width: 6px; height: 6px; border-radius: 3px; background: var(--ink); animation: flow 5s linear infinite; offset-rotate: 0deg; }
@keyframes cycle-progress { from { width: 0; } to { width: 100%; } }

/* Solutions */
.solutions { border-top: 1px solid var(--ink); padding: 112px 0; }
.sol-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-bottom: 48px; flex-wrap: wrap; }
.sol-head h2 { margin: 16px 0 0; font-size: clamp(38px, 4.2vw, 60px); line-height: 1; letter-spacing: -.04em; font-weight: 700; max-width: 760px; }
.sol-head p { margin: 0; max-width: 380px; font-size: 17px; line-height: 1.55; color: var(--muted); }

/* Working-model board: intentionally square "blueprint" style (from Concept 04) */
.board { border: 1px solid var(--ink); background: var(--gray); display: flex; flex-direction: column; }
.board.motion-paused .dot { animation-play-state: paused; }
/* Tabs stretch to the full bar height so the selected tab meets the frame edges */
.board-bar { display: flex; justify-content: space-between; align-items: stretch; flex-wrap: wrap; min-height: 44px; background: #fff; border-bottom: 1px solid var(--ink); }
.tabs { display: flex; align-items: stretch; }
.tab { position: relative; overflow: hidden; min-height: 56px; padding: 0 22px; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; border: 0; border-right: 1px solid var(--ink); border-radius: 0; font: inherit; font-size: 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); background: transparent;
  transition-property: background-color, color, scale; transition-duration: 120ms; transition-timing-function: ease-out; }
.tab:hover { color: var(--ink); background-color: rgba(17,17,17,.04); }
.tab:active { scale: .96; }
.tab[aria-selected="true"] { background-color: var(--ink); color: #fff; }
.tab .k { font-family: var(--mono); font-size: 11px; opacity: .6; }
.tab .prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #fff; }
.ctrl { display: flex; align-items: center; gap: 14px; padding: 8px 16px; }
.flow-label, .motion-note { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toggle { position: relative; height: 44px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); font-family: var(--mono); font-size: 13px; text-transform: uppercase; cursor: pointer;
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; transition: background-color 120ms ease-out, color 120ms ease-out; }
.toggle:hover { background-color: var(--ink); color: #fff; }
.stage { position: relative; height: 430px; overflow: hidden; background-color: var(--gray);
  background-image: linear-gradient(#E4E4E4 1px, transparent 1px), linear-gradient(90deg, #E4E4E4 1px, transparent 1px); background-size: 40px 40px; background-position: -1px -1px; }
.stage-inner { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
/* Switching flows is a repeated interaction, so it is an opacity-only cross-fade (≤150ms, no
   movement or blur): boxes stay put and only their labels change. Wires fade out, are redrawn
   for the new flow, then fade back in with it (site.js toggles .wires-out). */
.wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; transition: opacity 150ms ease-out; }
.flow-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: opacity 150ms ease-out; }
.stage-inner.wires-out .wires, .stage-inner.wires-out .flow-particles { opacity: 0; transition-duration: 100ms; }
.set { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: center; gap: 12%; padding: 32px 40px;
  opacity: 0; pointer-events: none; transition: opacity 100ms ease-out; }
.set.on { opacity: 1; pointer-events: auto; transition: opacity 150ms ease-out 50ms; }
.nodes { position: static; z-index: 2; display: flex; flex-direction: column; gap: 22px; margin: 0; padding: 0; list-style: none; }
.node { min-height: 54px; padding: 12px 14px; border: 1px solid var(--ink); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 15px; }
.node .c { font-family: var(--mono); font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.core { position: relative; z-index: 2; min-height: 170px; padding: 24px 20px; background: var(--ink); color: #fff; display: flex; flex-direction: column; gap: 8px; }
.core::before, .core::after { content: ''; position: absolute; width: 12px; height: 12px; background: #fff; border: 1px solid var(--ink); transform: rotate(45deg); top: calc(50% - 7px); }
.core::before { left: -7px; }
.core::after { right: -7px; }
.core .t { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #BDBDBD; }
.core strong { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.core span.d { font-size: 14px; line-height: 1.45; color: #CFCFCF; }
.flow-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; background: white; padding: 14px 16px; border-top: 1px solid var(--ink); font-size: 12px; text-transform: uppercase; }

/* Service cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.svc { border-radius: 16px; background: #fff; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-border); transition: box-shadow 150ms ease-out; }
.svc:hover { box-shadow: var(--shadow-border-hover); }
.svc.on { box-shadow: 0 0 0 1.5px var(--ink), 0 2px 4px 0 oklch(0 0 0 / .06); }
.svc h3 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 600; }
.svc p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.chips { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; padding: 7px 12px; border-radius: 999px; background: #F3F3F3; }
.textbtn { align-self: flex-start; margin-top: 6px; height: 44px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; cursor: pointer; transition: scale 150ms ease-out; }
.textbtn:active { scale: .96; }

/* Approach */
.approach { background: var(--gray); padding: 112px 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
.approach h2 { margin: 20px 0 0; font-size: clamp(44px, 5vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 700; }
.approach .copy { margin: 28px 0 0; font-size: 19px; line-height: 1.55; color: #333; max-width: 460px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.step { border-radius: 16px; background: #fff; padding: 28px; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; box-shadow: var(--shadow-border); }
.step .n { font-family: var(--mono); font-size: 13px; color: #555; padding-top: 5px; font-variant-numeric: tabular-nums; }
.step h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.step p { margin: 0; font-size: 16px; line-height: 1.5; color: #555; }

/* Company */
.company { padding: 112px 0; }
.company h2 { margin: 20px 0 0; font-size: clamp(34px, 3.4vw, 48px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; }
.company p { margin: 0 0 32px; font-size: 20px; line-height: 1.55; color: #333; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--gray); }
.facts div { padding: 20px 0; border-bottom: 1px solid var(--gray); }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 18px; }

/* Contact */
.contact { background: var(--ink); color: #fff; padding: 120px 0 48px; }
.contact :focus-visible { outline-color: #fff; }
.ct-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
.contact h2 { margin: 24px 0; font-size: clamp(64px, 8.4vw, 120px); line-height: .92; letter-spacing: -.05em; font-weight: 700; }
.contact .lede { margin: 0; font-size: 21px; line-height: 1.45; color: #C4C4C4; max-width: 520px; }
.pending { width: min(440px, 100%); border-radius: 16px; padding: 24px; box-shadow: 0 0 0 1px oklch(1 0 0 / .12); display: flex; flex-direction: column; gap: 10px; }
.pending .k { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #A8A8A8; }
.pending b { font-weight: 400; font-size: 20px; }
.pending small { font-size: 14px; line-height: 1.5; color: #A8A8A8; }
.email-link { color: #fff; font-size: clamp(18px, 2vw, 24px); overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.copy-email { align-self: flex-start; }
footer { margin-top: 120px; padding-top: 32px; border-top: 1px solid #2D2D2D; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; font-size: 14px; color: #A8A8A8; }
footer img { width: 180px; display: block; }

/* Tablet: hero art below copy; board stacks vertically */
@media (max-width: 1100px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 64px; padding-bottom: 48px; }
  .art { position: relative; left: auto; top: auto; translate: none; width: 100%; max-width: 560px; height: auto; aspect-ratio: 640 / 560; margin: 48px auto 0; }
  .art svg { width: 100%; height: 100%; }
  .cards, .two { grid-template-columns: 1fr; }
  .stage, .stage-inner { height: auto; }
  .stage-inner { position: relative; }
  .set { position: static; display: none; }
  .set.on { display: flex; flex-direction: column; padding: 24px; gap: 40px; }
  /* Hidden flows use display:none here, so give the fade a starting point (older browsers swap instantly) */
  @starting-style { .set.on { opacity: 0; } }
  .nodes { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .node { flex: 1 1 130px; }
  .core { width: 100%; min-height: 140px; }
  .core::before { left: calc(50% - 7px); top: -7px; }
  .core::after { left: calc(50% - 7px); right: auto; top: auto; bottom: -7px; }
  /* If a group wraps onto a second row (site.js adds .wrapped), curved wires would
     cross labels: draw one straight connector between each group and the core instead */
  .nodes { position: relative; }
  .set.on.wrapped > .nodes:first-child::after,
  .set.on.wrapped > .nodes:last-child::before { content: ''; position: absolute; left: 50%; width: 1px; height: 40px; background: var(--ink); }
  .set.on.wrapped > .nodes:first-child::after { top: 100%; }
  .set.on.wrapped > .nodes:last-child::before { bottom: 100%; }
}

/* Phone: collapsible menu, tighter spacing */
@media (max-width: 640px) {
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .bar { gap: 12px; flex-wrap: wrap; height: auto; min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
  .logo img { width: 150px; }
  #primary-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
  #primary-nav.open { display: flex; }
  #primary-nav .btn { margin-left: 0; justify-content: center; }
  section { scroll-margin-top: 72px; }
  .hero h1 { font-size: clamp(45px, 12vw, 76px); }
  .solutions, .approach, .company { padding: 80px 0; }
  .tab { min-height: 48px; padding: 0 12px; }
  /* One column of boxes, each wired to a spine on the left (drawn by site.js, 12px in from the core's edge) */
  .nodes { flex-direction: column; flex-wrap: nowrap; gap: 10px; padding-left: 32px; }
  .node { flex: none; }
  .core::before, .core::after { left: 5px; }
  .tab .k, .flow-label { display: none; }
  .ctrl { margin-left: auto; }
  .set.on { padding: 20px; }
  .flow-caption { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; transition-delay: 0ms !important; }
  .enter { animation: none; opacity: 1; transform: none; filter: none; }
  .drift, .dot { animation: none; }
  .dot { display: none; }
  .btn:active, .tab:active, .textbtn:active { scale: 1; }
}
