/* ==========================================================================
   Ragioneer design system — shared by the homepage and product pages.
   Plan and rationale: docs/enterprise-redesign-plan.md

   Type      Newsreader (display serif), Geist (text and UI), Geist Mono
             (labels and numbers).
   Geometry  2px corners, 1px hairlines, one 1600px grid with 80/40/20px
             gutters, so every left edge lines up.
   Motion    Quiet reveals from the shared observer in
             js/utils/animations.js. main.css switches motion off for
             prefers-reduced-motion.
   ========================================================================== */

/* ---------- Tokens ---------- */

.ds {
  --paper: #F6F4EE;
  --paper-2: #EDEAE2;
  --white: #FFFFFF;
  --ink: #15130F;
  --ink-2: #4F4B43;
  --ink-3: #6E685D;
  --line: rgba(21, 19, 15, 0.12);
  --line-2: rgba(21, 19, 15, 0.22);
  --night: #13120F;
  --night-2: #1C1A16;
  --night-3: #26231D;
  --on-night: #EEE9DF;
  --on-night-2: #B5AEA2;
  --line-night: rgba(238, 233, 223, 0.13);
  --line-night-2: rgba(238, 233, 223, 0.26);
  --bronze: #8E5220;
  --tan: #E2C29A;
  --ember: #D9894A;
  --signal: #C2621F;   /* lines, dots, marks and large text only */
  --sage-light: #9DB79F;

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Geist', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --max: 1600px;
  --gutter: 80px;
  --section-y: 160px;
  --head-gap: 80px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");

  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

.ds ::selection {
  background: var(--tan);
  color: var(--ink);
}

/* ---------- Base ---------- */

.ds :focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

.ds .hero :focus-visible,
.ds .section--night :focus-visible,
.ds .cta :focus-visible,
.ds .footer-x :focus-visible,
.ds .industry :focus-visible {
  outline-color: var(--tan);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}

.skip-link:focus {
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footnote references, e.g. [2] */
.ds .ref {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
}

.ds .ref a {
  font-family: var(--mono);
  color: var(--bronze);
}

.ds .section--night .ref a {
  color: var(--tan);
}

.ds .ref a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Reveal — only when JS runs (html.js), so content never stays hidden */
.js .ds [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
}

.js .ds [data-reveal].visible {
  opacity: 1;
  transform: none;
}

/* ---------- Layout ---------- */

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

.section {
  position: relative;
  padding: var(--section-y) 0;
}

.section--tint {
  background: var(--paper-2);
}

.section--night {
  background: var(--night);
  color: var(--on-night);
}

.section--rule {
  border-top: 1px solid var(--line);
}

/* ---------- Type ---------- */

.display {
  font-family: var(--serif);
  font-size: clamp(38px, 4.5vw, 64px);
  font-weight: 300;
  font-variation-settings: 'opsz' 72;
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

/* Second clause of a headline in a quieter tone */
.display .tone {
  color: var(--ink-3);
}

.section--night .display .tone {
  color: var(--on-night-2);
}

.display-m {
  font-family: var(--serif);
  font-size: clamp(25px, 2.3vw, 33px);
  font-weight: 400;
  font-variation-settings: 'opsz' 48;
  line-height: 1.17;
  letter-spacing: -0.016em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(19px, 1.55vw, 22px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -0.006em;
  color: var(--ink);
}

.section--night .lead {
  color: var(--on-night);
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label--night,
.section--night .label {
  color: var(--on-night-2);
}

.label-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Section marker — boxed number, then an uppercase label */
.marker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.marker-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.section--night .marker {
  color: var(--on-night-2);
}

.section--night .marker-num {
  border-color: var(--line-night-2);
  color: var(--on-night);
}

/* Section header — headline on the left, lead on the right, bottoms aligned */
.section-head {
  margin-bottom: var(--head-gap);
}

.section-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: 64px;
  align-items: end;
}

.section-head-grid .display {
  max-width: 760px;
}

.section-lead {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
  padding-bottom: 6px;
}

.section-lead p:not(.lead) {
  font-size: 16px;
  color: var(--ink-2);
}

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

.section-head--row .display {
  max-width: 760px;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 54px;
  padding: 0 20px 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn svg {
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn--dark {
  background: var(--ink);
  color: var(--paper);
}

.btn--dark:hover {
  background: #2C2922;
}

.btn--light {
  background: var(--on-night);
  color: var(--ink);
}

.btn--light:hover {
  background: var(--white);
}

.btn--outline-light {
  border-color: var(--line-night-2);
  color: var(--on-night);
}

.btn--outline-light:hover {
  border-color: var(--on-night);
  background: rgba(238, 233, 223, 0.06);
}

/* Text link — label, arrow and a hairline underline */
.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 7px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

.link:hover::after {
  transform: scaleX(0.35);
}

.link svg {
  transition: transform 0.3s var(--ease);
}

.link:hover svg {
  transform: translate(2px, -2px);
}

.link--light {
  color: var(--on-night);
}

/* Square icon button */
.square-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.square-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Panels, tags and index lists ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
}

.panel--tint {
  border-color: transparent;
  background: var(--paper-2);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 7px 10px;
  border: 1px solid var(--line-night-2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--on-night);
}

.tags--light li {
  border-color: var(--line-2);
  color: var(--ink-2);
}

/* Index — hairline rows: mono number, serif name, arrow. Used as tabs. */
.index {
  list-style: none;
  border-top: 1px solid var(--line);
}

.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 28px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  text-align: left;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.3s ease;
}

.index-row::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s var(--ease);
}

.index-row:hover {
  color: var(--ink-2);
}

.index-row[aria-selected="true"] {
  color: var(--ink);
}

.index-row[aria-selected="true"]::after {
  transform: scaleX(1);
}

.index-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.index-name {
  font-family: var(--serif);
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.016em;
  transition: transform 0.5s var(--ease);
}

.index-row[aria-selected="true"] .index-name {
  transform: translateX(6px);
}

/* Arrow points up-right until its row is selected */
.index-arrow {
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  opacity: 0.55;
  transform: rotate(-45deg);
  transition: transform 0.5s var(--ease), opacity 0.3s ease;
}

.index-row[aria-selected="true"] .index-arrow {
  opacity: 1;
  transform: none;
}

/* Product-style UI panel, used on dark sections */
.ui {
  overflow: hidden;
  border: 1px solid var(--line-night);
  border-radius: 2px;
  background: var(--night-2);
  color: var(--on-night);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.32);
}

.ui-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-night);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--on-night-2);
}

.ui-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ui-body {
  padding: 22px 20px 24px;
}

/* ==========================================================================
   Hero — graded landscape behind the opening statement
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--night);
  color: var(--on-night);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

/* The brand landscape, graded down to a warm dusk */
.hero-image {
  position: absolute;
  inset: 0;
  background: url('/Assets/images/branding/image.webp') center 65% / cover no-repeat;
  filter: brightness(0.46) saturate(0.72) sepia(0.18) contrast(1.06);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(19, 18, 15, 0.94) 0%, rgba(19, 18, 15, 0.74) 36%, rgba(19, 18, 15, 0.22) 72%, rgba(19, 18, 15, 0.3) 100%),
    linear-gradient(180deg, rgba(19, 18, 15, 0.6) 0%, rgba(19, 18, 15, 0) 22%, rgba(19, 18, 15, 0) 68%, rgba(19, 18, 15, 0.82) 100%);
}

.hero-inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 168px;
  padding-bottom: 96px;
}

.hero-eyebrow {
  margin-bottom: 36px;
  color: var(--on-night);
}

.hero-title {
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(50px, 7.4vw, 112px);
  font-weight: 300;
  font-variation-settings: 'opsz' 72;
  line-height: 0.98;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--tan);
}

.hero-lead {
  max-width: 500px;
  margin-top: 36px;
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(238, 233, 223, 0.84);
}

.hero-sub {
  max-width: 520px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--on-night-2);
}

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

/* Bottom strip — hairline across the content width only */
.hero-foot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 76px;
  background: linear-gradient(var(--line-night), var(--line-night)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

.hero-foot .mono,
.motion-toggle {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

.hero-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  transition: color 0.25s ease;
}

.hero-next:hover {
  color: var(--on-night);
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-night-2);
  border-radius: 2px;
  background: none;
  font-family: var(--mono);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.motion-toggle[hidden] {
  display: none;
}

.motion-toggle:hover {
  border-color: var(--on-night);
  color: var(--on-night);
}

/* Pause glyph; becomes a play triangle while paused */
.motion-toggle-icon {
  width: 8px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.hero.is-paused .motion-toggle-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  border-right: none;
}

/* Hero entrance — staggered rise on load */
.js .hero-inner > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 1.1s var(--ease) forwards;
}

.js .hero-inner > :nth-child(2) { animation-delay: 0.08s; }
.js .hero-inner > :nth-child(3) { animation-delay: 0.2s; }
.js .hero-inner > :nth-child(4) { animation-delay: 0.26s; }
.js .hero-inner > :nth-child(5) { animation-delay: 0.34s; }

@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

@keyframes heroFade {
  to { opacity: 1; }
}

/* ==========================================================================
   02 The foundation
   ========================================================================== */

.steps-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-night);
  border-radius: 2px 2px 0 0;
}

.steps-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 72px;
  padding: 0 24px;
  border: none;
  border-right: 1px solid var(--line-night);
  background: none;
  font: inherit;
  font-size: 16px;
  text-align: left;
  color: var(--on-night-2);
  cursor: pointer;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.steps-tab:last-child {
  border-right: none;
}

.steps-tab:hover {
  color: var(--on-night);
}

.steps-tab[aria-selected="true"] {
  background: var(--night-3);
  color: var(--on-night);
}

/* Up-right arrow at the end of each tab */
.steps-tab::after {
  content: '';
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  opacity: 0.6;
  transform: rotate(-45deg);
}

/* Selected underline in tan */
.steps-tab::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--tan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease);
}

.steps-tab[aria-selected="true"]::before {
  transform: scaleX(1);
}

.steps-tab-num {
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0.85;
}

.steps-panel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 72px;
  padding: 72px 56px;
  border: 1px solid var(--line-night);
  border-top: none;
  border-radius: 0 0 2px 2px;
}

.steps-panel[hidden] {
  display: none;
}

.steps-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 460px;
}

.steps-copy .label {
  color: var(--tan);
}

.steps-copy p:not(.label) {
  color: var(--on-night-2);
}

.js .steps-copy > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
}

.steps-copy > :nth-child(2) { transition-delay: 0.06s; }
.steps-copy > :nth-child(3) { transition-delay: 0.12s; }

.js .steps-panel.is-active .steps-copy > * {
  opacity: 1;
  transform: none;
}

/* Rows inside step illustrations stagger in when the panel activates */
.ui-rows {
  list-style: none;
}

.ui-rows li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-night);
  font-size: 14px;
  line-height: 1.35;
  color: var(--on-night);
}

.js .ui-rows li {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(0.15s + var(--k) * 0.09s);
}

.ui-rows li:last-child {
  border-bottom: none;
}

.js .steps-panel.is-active .ui-rows li {
  opacity: 1;
  transform: none;
}

.ui-sys,
.ui-colh {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

.ui-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--on-night-2);
}

/* Step 1 — four records resolve into one */
.ui-connect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 172px;
  align-items: center;
}

.ui-merge {
  position: relative;
  align-self: stretch;
}

.ui-merge::before {
  content: '';
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 0;
  width: 16px;
  border: 1px solid var(--line-night-2);
  border-left: none;
}

.ui-merge-line {
  position: absolute;
  top: 50%;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--tan);
  transform-origin: left center;
}

.js .ui-merge-line {
  transform: scaleX(0);
  transition: transform 0.6s var(--ease) 0.6s;
}

.ui-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--tan);
  border-radius: 2px;
  background: rgba(226, 194, 154, 0.06);
}

.js .ui-result {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.6s var(--ease) 0.85s, transform 0.7s var(--ease) 0.85s;
}

.js .steps-panel.is-active .ui-merge-line {
  transform: scaleX(1);
}

.js .steps-panel.is-active .ui-result {
  opacity: 1;
  transform: none;
}

.ui-result-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tan);
}

.ui-result strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.ui-result-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--on-night-2);
}

/* Step 2 — record → business meaning */
.ui-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-night);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

.ui-rows--map li {
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 0;
  padding: 18px 0;
}

.ui-arrow {
  height: 14px;
  background: var(--tan);
  -webkit-mask: var(--arrow) left center / 16px no-repeat;
  mask: var(--arrow) left center / 16px no-repeat;
}

.ui-def {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--on-night);
}

.ui-foot {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--on-night-2);
}

/* Step 3 — changes feed, with one unresolved conflict */
.ui-rows--feed li {
  grid-template-columns: 96px minmax(0, 1fr) auto;
}

.ui-state {
  padding: 4px 8px;
  border: 1px solid var(--line-night-2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

.ui-rows--feed li.is-flag {
  padding-left: 12px;
  box-shadow: inset 2px 0 0 var(--ember);
}

.is-flag .ui-sys,
.is-flag .ui-state {
  color: var(--ember);
}

.is-flag .ui-state {
  border-color: var(--ember);
}

/* Step 4 — access matrix */
.ui-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  font-size: 14px;
}

.ui-grid > span {
  padding: 14px 10px 14px 0;
  border-bottom: 1px solid var(--line-night);
}

.ui-grid > span:nth-last-child(-n + 4) {
  border-bottom: none;
}

.js .ui-rowh,
.js .ui-yes,
.js .ui-no,
.js .ui-req {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  transition-delay: calc(0.2s + var(--k) * 0.12s);
}

.js .steps-panel.is-active .ui-grid > span {
  opacity: 1;
}

.ui-rowh {
  color: var(--on-night);
}

.ui-yes,
.ui-req {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ui-yes::before,
.ui-req::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.ui-yes {
  color: var(--on-night);
}

.ui-yes::before {
  background: var(--sage-light);
}

.ui-req {
  color: var(--ember);
}

.ui-req::before {
  border: 1px solid var(--ember);
}

.ui-no {
  color: var(--on-night-2);
}

.steps-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
}

.steps-foot .mono {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

/* ==========================================================================
   Statistic — a large serif figure with its source note
   ========================================================================== */

.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding-left: 64px;
  border-left: 1px solid var(--line-2);
}

.stat-figure {
  margin: 4px 0 2px;
  display: flex;
  align-items: baseline;
  font-family: var(--serif);
  font-size: clamp(96px, 11vw, 168px);
  font-weight: 300;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.stat-unit {
  margin-left: 6px;
  font-size: 0.42em;
  color: var(--bronze);
}

.stat-desc {
  max-width: 380px;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.45;
}

.stat-note {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* ==========================================================================
   07 Decision Intelligence
   ========================================================================== */

.di {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 80px;
}

.di-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.di-copy .marker {
  margin-bottom: 8px;
}

.di-copy p:not(.lead):not(.marker) {
  color: var(--on-night-2);
}

.di-copy .btn {
  align-self: flex-start;
  margin-top: 14px;
}

.di-plot {
  padding: 28px 24px 12px;
}

.di-plot svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 300;
  overflow: visible;
}

.di-grid line {
  stroke: var(--line-night);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.di-band {
  fill: rgba(226, 194, 154, 0.08);
}

.di-expected {
  fill: none;
  stroke: var(--on-night-2);
  stroke-opacity: 0.55;
  stroke-width: 1;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}

.di-line {
  fill: none;
  stroke: var(--tan);
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.di-dot {
  fill: var(--ember);
}

/* The observed line draws left to right, then the outlier lights up */
.js .di-reveal-rect {
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: left center;
  transition: transform 2.2s cubic-bezier(0.45, 0, 0.2, 1) 0.3s;
}

.js .di-dot {
  opacity: 0;
  transition: opacity 0.5s ease 2.4s;
}

.js .di-chart.visible .di-reveal-rect {
  transform: none;
}

.js .di-chart.visible .di-dot {
  opacity: 1;
}

.ui-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-night);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

.ui-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ui-legend span::before {
  content: '';
  flex-shrink: 0;
}

.ui-legend-band::before {
  width: 14px;
  height: 10px;
  background: rgba(226, 194, 154, 0.2);
}

.ui-legend-line::before {
  width: 16px;
  height: 2px;
  background: var(--tan);
}

.ui-legend-flag::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
}

/* ==========================================================================
   09 How an engagement runs — a timeline that fills as it scrolls
   ========================================================================== */

.eng {
  position: relative;
}

.eng-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-2);
}

.eng-track-fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

.eng-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 40px;
}

.eng-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 36px;
}

.eng-step::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.eng-num {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
}

.eng-name {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.eng-step p {
  font-size: 15.5px;
  color: var(--ink-2);
}

/* ==========================================================================
   Final call to action — the landscape returns
   ========================================================================== */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 184px 0 160px;
  background: var(--night);
  color: var(--on-night);
}

.cta-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.cta-media .hero-image {
  background-position: center 85%;
}

.cta-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(19, 18, 15, 0.97) 0%, rgba(19, 18, 15, 0.62) 55%, rgba(19, 18, 15, 0.42) 100%);
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.cta-title {
  max-width: 1000px;
  font-family: var(--sans);
  font-size: clamp(44px, 5.6vw, 84px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.cta-title em {
  font-style: normal;
  color: var(--tan);
}

.cta-text {
  max-width: 560px;
  font-size: 18px;
  font-weight: 300;
  color: rgba(238, 233, 223, 0.84);
}

.cta .hero-actions {
  justify-content: center;
  margin-top: 12px;
}

.cta-mission {
  margin-top: 48px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-night-2);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer-x {
  padding: 96px 0 40px;
  border-top: 1px solid var(--line-night);
  background: var(--night);
  color: var(--on-night);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line-night);
}

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

.footer-brand p {
  max-width: 300px;
  margin-top: 22px;
  font-size: 15px;
  color: var(--on-night-2);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.footer-cols h2 {
  margin-bottom: 18px;
}

.footer-cols ul,
.footer-bottom ul {
  list-style: none;
}

.footer-cols ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-cols a,
.footer-bottom a {
  font-size: 15px;
  color: var(--on-night);
  transition: color 0.25s ease;
}

.footer-cols a:hover,
.footer-bottom a:hover {
  color: var(--tan);
}

.footer-sources {
  padding: 40px 0;
  border-bottom: 1px solid var(--line-night);
}

.footer-sources ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 920px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--on-night-2);
}

.footer-sources li {
  padding: 2px 0;
  scroll-margin-top: 120px;
}

.footer-sources li:target {
  outline: 1px solid var(--tan);
  outline-offset: 6px;
}

.footer-sources a {
  color: var(--on-night);
  text-decoration: underline;
  text-decoration-color: rgba(238, 233, 223, 0.3);
  text-underline-offset: 3px;
}

.footer-sources .source-back {
  margin-right: 6px;
  font-family: var(--mono);
  color: var(--tan);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  font-size: 13px;
  color: var(--on-night-2);
}

.footer-bottom ul {
  display: flex;
  gap: 28px;
}

.footer-bottom a {
  font-size: 13px;
}

.footer-bottom .mono {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .ds {
    --gutter: 56px;
  }

  .steps-panel {
    padding: 56px 40px;
    gap: 48px;
  }
}

@media (max-width: 1024px) {
  .ds {
    --gutter: 40px;
    --section-y: 120px;
    --head-gap: 56px;
  }

  .section-head-grid {
    grid-template-columns: 1fr;
    row-gap: 28px;
  }


  .steps-panel,
  .di {
    grid-template-columns: 1fr;
  }

  .steps-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps-tab:nth-child(2) {
    border-right: none;
  }

  .steps-tab:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-night);
  }

  .stat {
    margin-top: 56px;
    padding: 48px 0 0;
    border-left: none;
    border-top: 1px solid var(--line-2);
  }

  .eng-track {
    display: none;
  }

  .eng-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 48px;
  }

  .eng-step {
    padding-top: 28px;
    border-top: 1px solid var(--line-2);
  }

  .eng-step::before {
    display: none;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .ds {
    --gutter: 20px;
    --section-y: 88px;
    --head-gap: 44px;
    font-size: 16px;
  }

  .marker {
    margin-bottom: 28px;
  }

  .hero-inner {
    padding-top: 128px;
    padding-bottom: 64px;
  }

  .hero-lead {
    margin-top: 28px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 36px;
  }

  .hero-foot {
    grid-template-columns: 1fr auto;
  }

  .hero-next {
    display: none;
  }

  .index-row {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    padding: 22px 0;
  }

  .steps-tab {
    height: 56px;
    padding: 0 14px;
    font-size: 14px;
  }

  .steps-panel {
    gap: 32px;
    padding: 32px 18px;
  }

  .ui-rows li,
  .ui-rows--feed li {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 4px;
  }

  .ui-rows li .ui-sys {
    grid-column: 1 / -1;
  }

  .ui-rows--map li {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  }

  .ui-connect {
    grid-template-columns: 1fr;
  }

  .ui-merge {
    display: none;
  }

  .ui-result {
    margin-top: 16px;
  }

  .ui-grid {
    font-size: 12.5px;
  }

  .steps-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-figure {
    font-size: 104px;
  }

  .eng-steps {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }

  .cta {
    padding: 112px 0 96px;
  }

  .cta .hero-actions {
    align-self: stretch;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
