/* ==========================================================================
   Tessaract Systems
   --------------------------------------------------------------------------
   Typography note: "Traceform" is the logotype face. It has no crossbar on the
   capital A, so it is deliberately restricted to two roles only — the wordmark
   and the large chapter numerals. All reading text, including every heading,
   is set in Instrument Sans so that words like "AI" render correctly.
   ========================================================================== */

@font-face {
  font-family: "Traceform";
  src: url("../assets/fonts/Traceform-Regular.woff2") format("woff2"),
       url("../assets/fonts/Traceform-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --paper: #FAFAFA;
  --surface: #FFFFFF;
  --mist: #E3F2FD;
  --mist-line: #C9DFF2;
  --signal: #DB5461;
  --signal-deep: #C33F4C;
  --graphite: #686963;
  --slate: #394951;
  --slate-deep: #2A373D;
  --ink: #1E292E;

  --rule: rgba(57, 73, 81, .14);
  --rule-strong: rgba(57, 73, 81, .24);
  --rule-invert: rgba(250, 250, 250, .18);

  /* Type */
  --font-logo: "Traceform", "Eurostile", "Arial Narrow", sans-serif;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-pad: clamp(76px, 9vw, 128px);
  --header-h: 76px;

  --shadow-sm: 0 1px 2px rgba(30, 41, 46, .04), 0 4px 16px rgba(30, 41, 46, .05);
  --shadow-md: 0 2px 4px rgba(30, 41, 46, .05), 0 12px 32px rgba(30, 41, 46, .07);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 4.4vw, 4.05rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.032em;
}

h2 {
  font-size: clamp(1.9rem, 3.1vw, 2.85rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.027em;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -.014em;
}

p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 100;
  padding: 11px 18px;
  border-radius: 4px;
  background: var(--slate-deep);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* --------------------------------------------------------------------------
   Shared pieces
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--graphite);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--signal);
}
.eyebrow-invert { color: rgba(250, 250, 250, .66); }

.section { padding: var(--section-pad) 0; }

.section-head { max-width: 46rem; }
.section-head p {
  margin-top: 20px;
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  color: var(--graphite);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 1.5px solid var(--slate-deep);
  border-radius: 4px;
  background: var(--slate-deep);
  color: var(--paper);
  font: 600 1rem/1 var(--font);
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: none; }

.btn-ghost { background: transparent; color: var(--slate-deep); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--slate-deep); color: var(--ink); }

.btn-light { background: var(--paper); border-color: var(--paper); color: var(--slate-deep); }
.btn-light:hover { background: var(--mist); border-color: var(--mist); color: var(--ink); }

.btn-small { min-height: 44px; padding: 0 20px; font-size: .9375rem; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(250, 250, 250, .86);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--rule);
  background: rgba(250, 250, 250, .94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--slate-deep);
  stroke-width: 34;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* The wordmark is the one place the logotype face belongs. */
.brand-word {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  font-family: var(--font-logo);
  line-height: 1;
  text-transform: uppercase;
  color: var(--slate-deep);
}

/* Trailing letter-spacing is cancelled so each line centres optically. */
.brand-name {
  margin-right: -.14em;
  font-size: 1.15rem;
  letter-spacing: .14em;
}

.brand-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: .5rem;
}
.brand-sub::before,
.brand-sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: .65;
}
.brand-sub span {
  margin-right: -.5em;
  letter-spacing: .5em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);
}
.site-nav a:not(.btn) {
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--slate);
  background: linear-gradient(var(--signal), var(--signal)) no-repeat 0 100% / 0 1.5px;
  padding-bottom: 3px;
  transition: background-size .25s, color .2s;
}
.site-nav a:not(.btn):hover { background-size: 100% 1.5px; color: var(--ink); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--slate-deep);
  transition: transform .25s, opacity .25s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Journey: hero and chapters scroll on the left, the stack builds on the right
   -------------------------------------------------------------------------- */

/* `clip` (not `hidden`) contains the scaled diagram without creating a scroll
   container, so the sticky figure inside still works. */
.journey { overflow: clip; }

.journey-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  column-gap: clamp(40px, 5vw, 80px);
}

.hero-copy {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--header-h));
  padding: 40px 0 88px;
}

.hero-copy h1 { max-width: 15ch; }

.lede {
  /* 31em rather than 34: at the common desktop widths it leaves a full last
     line instead of stranding one word. */
  max-width: 31em;
  margin-top: 26px;
  text-wrap: pretty;
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  color: var(--graphite);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(16px, 1.8vw, 26px);
  margin: 36px 0 0;
  padding-inline-start: 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: .9063rem;
  font-weight: 500;
  color: var(--graphite);
}
.hero-proof li {
  position: relative;
  padding-left: 18px;
  list-style: none;
}
.hero-proof li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 7px;
  height: 7px;
  background: var(--signal);
  transform: rotate(45deg) scaleY(.68);
}

.journey-figure {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.figure-sticky {
  position: sticky;
  top: var(--header-h);
  display: flex;
  align-items: center;
  height: calc(100svh - var(--header-h));
  padding: 24px 0;
}

.chapters { grid-column: 1; grid-row: 2; }

.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92svh;
  padding: 72px 0;
}

.chapter-num {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  /* The second — and last — home of the logotype face. Numerals only. */
  font-family: var(--font-logo);
  font-size: 3.25rem;
  line-height: 1;
  color: var(--slate-deep);
}
.chapter-num::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.chapter h2 { max-width: 18ch; }

.chapter-story {
  max-width: 36em;
  margin-top: 20px;
}

.chapter-work {
  display: grid;
  gap: 11px;
  max-width: 36em;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.chapter-work li {
  position: relative;
  padding-left: 24px;
  font-size: .9688rem;
  color: var(--graphite);
}
.chapter-work li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--slate);
  transform: rotate(45deg) scaleY(.7);
}

.agent-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  max-width: 40em;
  margin: 28px 0 0;
}
.agent-list > div {
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.agent-list dt { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.agent-list dd {
  margin: 4px 0 0;
  font-size: .9375rem;
  color: var(--graphite);
}

.chapter-result {
  max-width: 34em;
  margin-top: 30px;
  padding-left: 18px;
  border-left: 2px solid var(--signal);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

/* Small layer indicator shown beside each chapter on narrow screens */
.chapter-glyph { display: none; }

/* --------------------------------------------------------------------------
   Stack diagram
   -------------------------------------------------------------------------- */

.stack {
  width: 100%;
  height: auto;
  max-height: 100%;
  overflow: visible;
  /* The folded stack's ink sits left of centre in the viewBox, so the origin
     is set on the ink's own centre rather than the box's. */
  transform-origin: 26.3% 50%;
  transition: transform 1s cubic-bezier(.16, .8, .2, 1);
}

/* Folded, the stack is enlarged and centred so it carries the hero on its own.
   The box overflow this creates is contained by `.journey { overflow: clip }`. */
.stack[data-state="0"] { transform: translateX(23.7%) scale(1.5); }

.stack .layer {
  cursor: pointer;
  outline: none;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.layer-shell { transition: transform 1s cubic-bezier(.16, .8, .2, 1); }

.plane-halo {
  fill: var(--paper);
  stroke: var(--paper);
  stroke-width: 16;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill .4s;
}

.plane-fill { fill: transparent; transition: fill .4s; }

.plane {
  fill: none;
  stroke: var(--slate);
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke .4s, opacity .4s;
}

.motif,
.node,
.motif-dot { transition: opacity .5s, fill .4s; }

.motif {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .5;
  vector-effect: non-scaling-stroke;
}
.motif-strong { stroke: var(--slate); stroke-width: 1.6; opacity: .75; }
.motif-dash { stroke-dasharray: 5 5; }
.motif-dot { fill: var(--signal); }

.node {
  fill: var(--paper);
  stroke: var(--slate);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.node-core { fill: var(--slate); }
.node-agent { fill: var(--signal); stroke: var(--signal); }

.label { transition: opacity .5s, transform .5s cubic-bezier(.2, .7, .2, 1); }
.label line { stroke: var(--graphite); stroke-width: 1; transition: stroke .4s; }
.label-name {
  font-family: var(--font);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.5px;
  fill: var(--ink);
}
.label-sub {
  font-family: var(--font);
  font-size: 16px;
  fill: var(--graphite);
}

/* State 0: the four planes sit folded together, like the logo. */
.stack[data-state="0"] .layer-shell { transform: translateY(calc(var(--i) * 106px - 159px)); }
.stack[data-state="0"] .label { opacity: 0; }

/* Layers not reached yet are outlines of what is coming. */
.is-ghost .plane { stroke: var(--graphite); stroke-dasharray: 6 7; opacity: .5; }
.is-ghost .motif,
.is-ghost .node,
.is-ghost .motif-dot { opacity: 0; }
.is-ghost .label { opacity: .38; }

.is-active .plane { stroke: var(--signal); }
.is-active .plane-fill { fill: var(--mist); }
.is-active .layer { transform: translateY(-10px); }
.is-active .label { transform: translateX(8px); }
.is-active .label line { stroke: var(--signal); }

.layer:hover .plane { stroke: var(--signal); }
.layer:hover .label { transform: translateX(8px); }

/* --------------------------------------------------------------------------
   One team (problem / solution)
   -------------------------------------------------------------------------- */

.e2e {
  background: var(--mist);
  border-top: 1px solid var(--mist-line);
  border-bottom: 1px solid var(--mist-line);
}

.e2e-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.e2e h2 { max-width: 15ch; }
.e2e-copy {
  display: grid;
  gap: 20px;
  max-width: 36em;
  font-size: 1.0625rem;
}
.e2e-copy strong { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   Track record
   -------------------------------------------------------------------------- */

.record-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
.record-stats li {
  padding-top: 24px;
  border-top: 2px solid var(--slate-deep);
}
.record-stats b {
  display: block;
  font-size: clamp(2.1rem, 3.2vw, 2.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
}
.record-stats span {
  display: block;
  margin-top: 12px;
  font-size: .9375rem;
  color: var(--graphite);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}
.capability {
  padding: 28px 28px 30px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.capability h3 { margin-bottom: 10px; }
.capability p { font-size: .9688rem; color: var(--graphite); }

/* --------------------------------------------------------------------------
   Where to start
   -------------------------------------------------------------------------- */

.start-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px clamp(24px, 3vw, 40px);
  margin: 60px 0 0;
  padding: 0;
  list-style: none;
}
.start-list li {
  padding-top: 26px;
  border-top: 1px solid var(--rule-strong);
}
.start-list h3 { margin-top: 20px; font-size: 1.0625rem; }
.start-list p {
  margin-top: 10px;
  font-size: .9375rem;
  color: var(--graphite);
}
.start-list .start-link {
  display: inline-block;
  margin-top: 14px;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--signal);
  padding-bottom: 1px;
}
.start-list .start-link:hover { color: var(--signal-deep); }

.service-glyph {
  width: 30px;
  height: 45px;
  overflow: visible;
}
.service-glyph path {
  fill: var(--paper);
  stroke: var(--graphite);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.service-glyph[data-active="0"] path:nth-child(1),
.service-glyph[data-active="1"] path:nth-child(2),
.service-glyph[data-active="2"] path:nth-child(3),
.service-glyph[data-active="3"] path:nth-child(4) {
  fill: var(--signal);
  stroke: var(--signal);
}

/* --------------------------------------------------------------------------
   How we engage
   -------------------------------------------------------------------------- */

.engage {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.engage-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
  margin: 60px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.engage-step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 30px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
}
.engage-step.is-entry {
  border-color: var(--signal);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.engage-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--mist);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--slate-deep);
}
.engage-step.is-entry .engage-tag { background: var(--signal); color: #fff; }
.engage-step h3 { margin-bottom: 10px; }
.engage-step > p {
  font-size: .9375rem;
  color: var(--graphite);
}
.engage-meta {
  margin: 20px 0 0;
  margin-top: auto;      /* pins the rule to the card bottom so all four align */
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
}
.engage-meta span {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  color: var(--graphite);
}

.engage-note {
  max-width: 44em;
  margin-top: 40px;
  font-size: .9688rem;
  color: var(--graphite);
}

/* --------------------------------------------------------------------------
   Portfolio carousel
   -------------------------------------------------------------------------- */

.portfolio {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.portfolio-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.carousel-count {
  font-variant-numeric: tabular-nums;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--graphite);
}
.carousel-count [data-carousel-current] { color: var(--ink); }

.carousel-buttons { display: flex; gap: 10px; }

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.carousel-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.carousel-btn:hover:not(:disabled) {
  background: var(--slate-deep);
  border-color: var(--slate-deep);
  color: var(--paper);
}
.carousel-btn:disabled { opacity: .3; cursor: default; }

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 44px;
}

.work-filter {
  padding: 9px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--slate);
  font: 500 .875rem/1 var(--font);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.work-filter:hover { border-color: var(--slate-deep); color: var(--ink); }
.work-filter.is-on {
  background: var(--slate-deep);
  border-color: var(--slate-deep);
  color: var(--paper);
}

.work-carousel {
  position: relative;
  margin-top: 28px;
}

.work-empty {
  padding: 48px 0;
  color: var(--graphite);
}

.work-track {
  display: flex;
  gap: clamp(16px, 1.8vw, 24px);
  margin: 0;
  /* Vertical room for the card's lift on hover. Horizontal padding must stay
     zero, or snapping leaves scrollLeft offset by it and "at start" never
     reads as true. */
  padding: 6px 0 10px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* Without this the browser re-anchors to the last visible card when the
     filter puts cards back, jumping the track instead of resetting it. */
  overflow-anchor: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;

  /* Cards that run past either edge fade out instead of being sliced
     mid-word. The two widths are driven from JS so the fade only appears on
     the side that actually has more content. */
  --fade-size: 44px;
  --fade-l: 0px;
  --fade-r: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.work-track::-webkit-scrollbar { display: none; }
.work-track:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: 10px; }

.work-card {
  /* Just over two cards in view, so the third edge signals "there is more". */
  flex: 0 0 clamp(272px, 40%, 460px);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  padding: 30px 30px 32px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
/* `display: flex` above would otherwise beat the UA's [hidden] rule. */
.work-card[hidden] { display: none; }

.work-card:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* The agent builds carry a little more weight. */
.work-card.is-featured {
  border-color: var(--mist-line);
  background: linear-gradient(180deg, var(--mist) 0%, var(--surface) 62%);
}
.work-card.is-featured:hover { border-color: var(--signal); }

.work-stat {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.work-stat b {
  display: block;
  font-size: clamp(2.25rem, 3vw, 2.75rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--ink);
}
.work-stat span {
  display: block;
  margin-top: 8px;
  font-size: .875rem;
  color: var(--graphite);
}
.work-card.is-featured .work-stat b { color: var(--signal-deep); }

.work-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--graphite);
}

.work-layer {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--slate-deep);
  font-size: .6875rem;
  letter-spacing: .08em;
  color: var(--paper);
  white-space: nowrap;
}
.work-card.is-featured .work-layer { background: var(--signal); }

.work-card h3 {
  font-size: 1.1875rem;
  letter-spacing: -.018em;
}

.work-body {
  margin-top: 12px;
  font-size: .9375rem;
  color: var(--graphite);
}

.work-result {
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--signal);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
}

.work-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  margin-top: auto;      /* keeps the chip row on the card's baseline */
  padding: 20px 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.work-stack li {
  padding: 5px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--slate);
  background: var(--surface);
  white-space: nowrap;
}
.work-card.is-featured .work-stack li { background: rgba(255, 255, 255, .72); }

.carousel-progress {
  position: relative;
  height: 2px;
  margin-top: 28px;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
}
.carousel-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 20%;
  border-radius: 2px;
  background: var(--signal);
  transition: width .25s ease, transform .25s ease;
}

.work-note {
  max-width: 44em;
  margin-top: 32px;
  font-size: .9375rem;
  color: var(--graphite);
}

/* --------------------------------------------------------------------------
   Your stack
   -------------------------------------------------------------------------- */

.stack-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}

.tool-list { margin: 0; }
.tool-list > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.tool-list > div:last-child { border-bottom: 1px solid var(--rule); }
.tool-list dt { font-weight: 600; color: var(--ink); }
.tool-list dd { margin: 0; color: var(--graphite); }

/* --------------------------------------------------------------------------
   Principles
   -------------------------------------------------------------------------- */

.principles {
  background: var(--slate);
  color: var(--paper);
}
.principles h2 { color: var(--paper); max-width: 14ch; }
.principles .section-head p { color: rgba(250, 250, 250, .72); }

.principles-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(28px, 4vw, 56px);
  margin: 0;
}
.principle-list > div {
  padding-top: 22px;
  border-top: 1px solid var(--rule-invert);
}
.principle-list dt {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--paper);
}
.principle-list dd {
  margin: 10px 0 0;
  color: rgba(250, 250, 250, .76);
  font-size: .9375rem;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  padding: var(--section-pad) 0;
  background: var(--slate-deep);
  color: var(--paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}

.contact h2 {
  max-width: 16ch;
  color: var(--paper);
  font-size: clamp(2rem, 3.4vw, 3rem);
}
.contact-copy > p {
  max-width: 32em;
  margin-top: 22px;
  color: rgba(250, 250, 250, .78);
}

.contact-list {
  display: grid;
  gap: 14px;
  max-width: 32em;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: .9688rem;
  color: rgba(250, 250, 250, .82);
}
.contact-list li { position: relative; padding-left: 24px; }
.contact-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .6em;
  width: 8px;
  height: 8px;
  background: var(--signal);
  transform: rotate(45deg) scaleY(.7);
}

.contact-direct {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-invert);
  font-size: .9688rem;
  color: rgba(250, 250, 250, .72);
}
.contact-direct a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.contact-panel {
  padding: clamp(28px, 3vw, 40px);
  border: 1px solid var(--rule-invert);
  border-radius: 10px;
  background: rgba(250, 250, 250, .04);
}
.contact-panel h3 { color: var(--paper); font-size: 1.25rem; }
.contact-panel > p {
  margin-top: 8px;
  font-size: .9375rem;
  color: rgba(250, 250, 250, .66);
}

.panel-cta { margin-top: 24px; }

.panel-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, .48);
}
.panel-divider::before,
.panel-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-invert);
}

.contact-form {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(250, 250, 250, .76);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(250, 250, 250, .32);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  resize: vertical;
  transition: border-color .2s;
}
.field select { padding-left: 0; }
.field select option { color: #1E292E; }
.field input::placeholder,
.field textarea::placeholder { color: rgba(250, 250, 250, .34); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-bottom-color: var(--paper);
  box-shadow: 0 1px 0 0 var(--paper);
}
.field [aria-invalid="true"] { border-bottom-color: #F0A0A8; }

.form-status {
  min-height: 1.4em;
  font-size: .9375rem;
  color: #F6C3C8;
}
.form-status.is-ok { color: var(--mist); }

.contact-form .btn { justify-self: start; }
.form-small {
  font-size: .8125rem;
  color: rgba(250, 250, 250, .5);
}

/* Honeypot */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 56px 0 44px;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}

.footer-logo { width: 108px; height: auto; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
}
.footer-nav a {
  font-size: .9375rem;
  text-decoration: none;
  color: var(--graphite);
}
.footer-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); }

.footer-legal { font-size: .875rem; color: var(--graphite); text-align: right; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engage-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .start-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-list { grid-template-columns: 1fr; }
  .record-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --header-h: 68px; }

  .nav-toggle { display: block; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .2s, transform .2s;
  }
  .site-nav a:not(.btn) {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    background: none;
  }
  .site-nav .btn { margin-top: 20px; }

  .journey-grid,
  .e2e-grid,
  .principles-grid,
  .stack-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .portfolio-head { flex-direction: column; align-items: stretch; gap: 28px; }
  .carousel-nav { justify-content: space-between; padding-bottom: 0; }

  .hero-copy,
  .journey-figure,
  .chapters { grid-column: 1; grid-row: auto; }

  .hero-copy { min-height: 0; padding: 48px 0 40px; }

  .figure-sticky {
    position: static;
    height: auto;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 0 0 8px;
  }
  .stack[data-state="0"] { transform: none; }

  .chapter { min-height: 0; padding: 48px 0; border-top: 1px solid var(--rule); }
  .chapter-num { font-size: 2.25rem; margin-bottom: 18px; }
  .chapter-num::after { display: none; }

  /* Each chapter carries its own layer indicator once the big diagram stops
     following the scroll. */
  .chapter-glyph {
    display: block;
    width: 26px;
    height: 39px;
    margin-left: auto;
  }
  .chapter-num { gap: 16px; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }

  .label-name { font-size: 27px; }
  .label-sub { font-size: 20px; }

  .start-list,
  .principle-list,
  .capability-grid,
  .engage-steps,
  .record-stats { grid-template-columns: 1fr; }

  .work-track { --fade-size: 18px; }
  .work-card { flex-basis: 85%; padding: 26px 24px 28px; }
  .carousel-btn { width: 44px; height: 44px; }

  .tool-list > div { grid-template-columns: 1fr; gap: 4px; }

  .hero-actions .btn { flex: 1 1 100%; }
  .hero-proof { gap: 10px; flex-direction: column; }

  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-nav { justify-content: flex-start; }
  .footer-legal { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
