/* ==========================================================================
   Trinity v19: richer v18. Hero presence, service cards with live diagrams,
   agent diagram, drawn timeline, client cards, closing CTA band.
   White only; #0077ff the only accent. Loaded after v18.css.
   ========================================================================== */

/* ---------- rhythm ---------- */
.section { padding-top: clamp(64px, 6.5vw, 96px); }
.head { margin-bottom: clamp(28px, 3.4vw, 44px); }

/* ---------- reveals (initPause adds .is-in to [data-anim]) ---------- */
.reveal { transition: opacity 0.7s var(--ease) calc(var(--i, 0) * 90ms), transform 0.7s var(--ease) calc(var(--i, 0) * 90ms); }
.js .reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-bottom: clamp(28px, 3vw, 44px); }
.hero__field {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(10, 10, 10, 0.05) 0 1px, transparent 1px 30px);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 38%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 38%, #000 0%, transparent 75%);
  animation: field-drift 9s linear infinite;
}
@keyframes field-drift { to { background-position: 0 30px; } }
/* larger swoosh: break out of the container on desktop, height follows the symbol */
@media (min-width: 901px) {
  .hero__inner > .brandline { --blw: min(100vw - 32px, 1400px); width: var(--blw); max-width: none; margin-inline: calc((100% - var(--blw)) / 2); height: auto; aspect-ratio: 1350 / 300; }
}
.hero__actions { margin-top: clamp(24px, 2.6vw, 34px); }

/* data pulses running along the echo lines */
.sym-run {
  fill: none; stroke: var(--blue); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round;
  stroke-dasharray: 0.07 1.3; stroke-dashoffset: 0.07; opacity: 0;
  transform: translateY(calc(var(--hs) * -18px * var(--n, 1)));
  animation: symrun 7s cubic-bezier(0.45, 0.05, 0.55, 0.95) var(--rd, 2s) infinite;
}
@keyframes symrun {
  0% { stroke-dashoffset: 0.07; opacity: 0; }
  6% { opacity: 1; }
  55% { stroke-dashoffset: -1; opacity: 1; }
  56%, 100% { stroke-dashoffset: -1; opacity: 0; }
}

/* live agent strip */
.flowstrip {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(620px, 100%); margin: clamp(26px, 3vw, 38px) auto 0; padding: 0;
}
.flowstrip::before, .flowstrip::after {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 5px; height: 1px; background: var(--line-2);
}
.flowstrip::after { top: 4.5px; height: 2px; background: var(--blue); transform-origin: left center; transform: scaleX(0); animation: fs-bar 6s linear infinite; }
.flowstrip li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; color: #c4c8ce; }
.flowstrip i { width: 11px; height: 11px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px #fff; transition: none; }
.flowstrip span { color: var(--ink-2); font-size: 0.68rem; line-height: 1.3; text-align: center; }
.flowstrip li:nth-child(1) { animation: fs-1 6s linear infinite; }
.flowstrip li:nth-child(2) { animation: fs-2 6s linear infinite; }
.flowstrip li:nth-child(3) { animation: fs-3 6s linear infinite; }
.flowstrip li:nth-child(4) { animation: fs-4 6s linear infinite; }
@keyframes fs-bar { 0% { transform: scaleX(0); opacity: 1; } 60% { transform: scaleX(1); } 86% { transform: scaleX(1); opacity: 1; } 92%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes fs-1 { 0% { color: #c4c8ce; } 2%, 86% { color: var(--blue); } 92%, 100% { color: #c4c8ce; } }
@keyframes fs-2 { 0%, 19% { color: #c4c8ce; } 21%, 86% { color: var(--blue); } 92%, 100% { color: #c4c8ce; } }
@keyframes fs-3 { 0%, 39% { color: #c4c8ce; } 41%, 86% { color: var(--blue); } 92%, 100% { color: #c4c8ce; } }
@keyframes fs-4 { 0%, 59% { color: #c4c8ce; } 61%, 86% { color: var(--blue); } 92%, 100% { color: #c4c8ce; } }

/* client wordmarks */
.clients { display: grid; justify-items: center; gap: 12px; width: 100%; margin-top: clamp(28px, 3vw, 40px); padding-top: 22px; border-top: 1px solid var(--line); }
.clients__label { color: var(--muted); }
.clients__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 36px; }
.clients__list li { font-family: var(--display); font-weight: 400; font-size: clamp(1.15rem, 1.6vw, 1.45rem); letter-spacing: -0.02em; color: var(--muted); white-space: nowrap; }

/* ---------- services: hairline grid of live diagrams ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.svc { position: relative; display: grid; align-content: start; gap: 6px; padding: clamp(20px, 2.2vw, 30px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.svc .cap__viz { grid-column: auto; grid-row: auto; width: 100%; max-height: none; aspect-ratio: 500 / 180; margin-bottom: 14px; border: 1px solid var(--line); box-shadow: none; transition: border-color 0.3s ease, box-shadow 0.4s var(--ease); }
.svc__num { color: var(--blue); }
.svc__name { font-family: var(--display); font-weight: 350; font-size: clamp(1.5rem, 2vw, 1.9rem); letter-spacing: -0.025em; line-height: 1.05; }
.svc__copy { color: var(--muted); text-wrap: pretty; }
.svc__sweep { position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left center; transition: transform 0.6s var(--ease); pointer-events: none; }
.svc:hover .svc__sweep, .svc:active .svc__sweep { transform: scaleX(1); }
.svc:hover .cap__viz { border-color: rgba(0, 119, 255, 0.35); box-shadow: 0 14px 30px -22px rgba(0, 119, 255, 0.6); }
@media (max-width: 1100px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- agent diagram ---------- */
.agent__fig {
  position: relative; margin: 0; padding: clamp(14px, 3vw, 40px) clamp(10px, 3vw, 40px);
  border: 1px solid var(--line); border-radius: 18px;
  background: #fff radial-gradient(circle at 1px 1px, rgba(10, 10, 10, 0.09) 1px, transparent 1.4px) 0 0 / 22px 22px;
  box-shadow: var(--shadow-soft);
}
.agent__svg { display: block; width: 100%; height: auto; overflow: visible; }
.agent__svg--tall { display: none; max-width: 340px; margin-inline: auto; }
.agent__svg text { font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; fill: var(--ink-2); }
.agent__svg .col { font-size: 11px; letter-spacing: 0.1em; fill: var(--muted); }
.agent__svg .note { font-size: 10px; letter-spacing: 0.1em; fill: var(--muted); }
.agent__svg .node rect { fill: #fff; stroke: var(--line-2); stroke-width: 1; }
.agent__svg .node--out rect { stroke: var(--blue); }
.agent__svg .node--out text { fill: var(--blue-ink); }
.fl-base { fill: none; stroke: rgba(10, 10, 10, 0.16); stroke-width: 1.25; stroke-linejoin: round; }
.fl-base.fl--person { stroke-dasharray: 4 5; }
.fl-draw { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.6; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--ease) var(--d, 0s); }
.fl-draw.fl--person { opacity: 0.35; }
.agent__fig.is-in .fl-draw { stroke-dashoffset: 0; }
.fl-run { fill: none; stroke: var(--blue); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.09 1.3; stroke-dashoffset: 0.09; opacity: 0; }
.agent__fig.is-in .fl-run { animation: flrun 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) var(--rd, 1s) infinite; }
@keyframes flrun { 0% { stroke-dashoffset: 0.09; opacity: 0; } 5% { opacity: 1; } 45% { stroke-dashoffset: -1; opacity: 1; } 46%, 100% { stroke-dashoffset: -1; opacity: 0; } }
.core__ring { fill: #fff; stroke: var(--line-2); stroke-width: 1; }
.core__spin { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 0.16 0.09; transform-box: fill-box; transform-origin: center; animation: core-spin 16s linear infinite; }
.core__mark { fill: var(--blue); }
@keyframes core-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .agent__svg--wide { display: none; }
  .agent__svg--tall { display: block; }
}

/* ---------- process: drawn timeline ---------- */
.stop__name { font-size: clamp(1.9rem, 2.6vw, 2.4rem); }

/* ---------- work: typographic client cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 20px); }
.work-grid > li { display: flex; }
.wcard {
  position: relative; display: grid; align-content: start; gap: 8px; width: 100%;
  padding: clamp(22px, 2.4vw, 32px); border: 1px solid var(--line); border-radius: 16px; background: #fff;
  color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.wcard__top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.wcard .mark { width: 56px; flex: none; transition: box-shadow 0.4s var(--ease); }
.wcard .mark b { font-size: 0.95rem; left: 6px; top: 5px; }
.wcard__type { color: var(--muted); }
.wcard__name { font-family: var(--display); font-weight: 350; font-size: clamp(1.8rem, 2.6vw, 2.4rem); letter-spacing: -0.03em; line-height: 1; }
.wcard__copy { color: var(--muted); }
.wcard__link { margin-top: 8px; color: var(--blue-ink); text-transform: none; letter-spacing: 0.01em; font-size: 0.82rem; }
.wcard__arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.wcard__sweep { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; color: var(--blue); pointer-events: none; }
.wcard__sweep i { position: absolute; left: 0; right: 26px; bottom: 0; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left center; transition: transform 0.5s var(--ease); }
.wcard__sweep svg { position: absolute; right: 0; bottom: 0; width: 26px; height: 10px; clip-path: inset(0 100% 0 0); transition: clip-path 0.25s var(--ease) 0.35s; }
.wcard:hover, .wcard:focus-visible { border-color: rgba(0, 119, 255, 0.45); box-shadow: 0 20px 40px -30px rgba(0, 119, 255, 0.6); transform: translateY(-2px); }
.wcard:hover .wcard__sweep i, .wcard:focus-visible .wcard__sweep i { transform: scaleX(1); }
.wcard:hover .wcard__sweep svg, .wcard:focus-visible .wcard__sweep svg { clip-path: inset(0 0 0 0); }
.wcard:hover .wcard__arrow { transform: translate(3px, -3px); }
.wcard:hover .mark { box-shadow: 6px 6px 0 -1px #fff, 6px 6px 0 0 var(--blue); }
.wcard:active { transform: scale(0.995); border-color: var(--blue); }
.wcard:focus-visible { outline: none; box-shadow: var(--ring); }
.work__also { margin-top: 22px; text-align: center; color: var(--muted); }

/* ---------- about ---------- */
.about__principles > li { transition-property: opacity, transform; }

/* ---------- closing CTA band ---------- */
.cta { padding-bottom: clamp(64px, 7vw, 104px); }
.cta__band { display: grid; justify-items: center; text-align: center; gap: 16px; padding: clamp(8px, 2vw, 24px) 0 clamp(32px, 3.5vw, 48px); }
.cta__echoes { display: block; width: min(100%, 880px); height: auto; aspect-ratio: 1200 / 72; overflow: visible; margin-bottom: 10px; }
.cta__echo { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: square; opacity: var(--o, 0.4); stroke-dasharray: 1; stroke-dashoffset: 1; }
.cta__band.is-in .cta__echo { animation: drawline 0.8s var(--ease) var(--d, 0s) forwards; }
.cta__run { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.07 1.3; stroke-dashoffset: 0.07; opacity: 0; }
.cta__band.is-in .cta__run { animation: symrun 6s cubic-bezier(0.45, 0.05, 0.55, 0.95) 1.4s infinite; }
.cta__label { color: var(--muted); }
.cta__label span { color: var(--blue); margin-right: 10px; }
.cta__title { max-width: 13ch; }
.cta__band .lede { color: var(--muted); }
.cta__actions { justify-content: center; margin-top: 8px; }

/* ---------- footer: three columns now ---------- */
.foot__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ==========================================================================
   ≤900px: one centered column
   ========================================================================== */
@media (max-width: 900px) {
  .svc-grid { grid-template-columns: 1fr; border-left: 0; }
  .svc { justify-items: center; text-align: center; padding: 28px 0 30px; border-right: 0; }
  .svc .cap__viz { max-width: 440px; }
  .svc__copy { max-width: 22rem; }

  .agent__fig { padding: 22px 10px; }

  /* process: centered vertical timeline, connectors draw on scroll */
  .rail__stops { border-top: 0; }
  .stop { border-bottom: 0; padding: 0; gap: 6px; }
  .rail .stop::before { display: block; position: static; left: auto; top: auto; width: 12px; height: 12px; margin: 0 auto 6px; }
  .rail .stop::after {
    content: ""; display: block; width: 2px; height: 44px; margin: 18px auto 20px;
    background: linear-gradient(var(--blue), var(--blue)) center top / 100% 0% no-repeat, var(--line);
    transition: background-size 0.8s var(--ease);
  }
  .rail .stop.is-reached::after { background-size: 100% 100%, auto; }
  .rail .stop:last-child::after { display: none; }

  .work-grid { grid-template-columns: 1fr; }
  .wcard { justify-items: center; text-align: center; }
  .wcard__top { flex-direction: column; gap: 10px; }

  .foot__grid { grid-template-columns: 1fr; }
  .cta__band { padding-top: 32px; }
}

@media (max-width: 600px) {
  .section { padding-top: 56px; }
  .flowstrip span { font-size: 0.62rem; }
  .clients__list { gap: 4px 22px; }
  .clients__list li { font-size: 1.1rem; }
  .cta__actions { flex-direction: column; align-items: center; width: 100%; max-width: 360px; }
  .cta__actions .btn { width: 100%; }
  .cta__title { font-size: clamp(2.6rem, 12vw, 3.4rem); }
}

/* ---------- reduced motion: static, fully drawn ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__field, .sym-run, .fl-run, .cta__run, .core__spin, .flowstrip::after, .flowstrip li { animation: none !important; }
  .sym-run, .fl-run, .cta__run { display: none; }
  .flowstrip::after { transform: scaleX(1); opacity: 1; }
  .flowstrip li { color: var(--blue); }
  .fl-draw, .cta__echo { stroke-dashoffset: 0 !important; transition: none !important; animation: none !important; }
  .js .reveal:not(.is-in), .reveal { opacity: 1; transform: none; transition: none; }
  .rail .stop::after { background-size: 100% 100%, auto; transition: none; }
}
