:root {
  --bg: #f4f4f1;
  --ink: #17191d;
  --slate: #5d626a;
  --accent: #741f2b;
  --signal: #087a72;
  --tech: #2457d6;
  --border: rgba(23, 25, 29, 0.14);
  --border-strong: rgba(23, 25, 29, 0.32);
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-strong: cubic-bezier(0.77, 0, 0.175, 1);
  --motion-press: 140ms;
  --motion-ui: 220ms;
  --motion-section: 480ms;
  --fa-family: "Mohammad Persian", Geist, Tahoma, sans-serif;
  --en-family: "Geist", "IBM Plex Sans", Arial, sans-serif;
  --mono-family: "Geist Mono", "Roboto Mono", monospace;
}

body {
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] .wordmark,
[dir="rtl"] .section-marker,
[dir="rtl"] .hero-name,
[dir="rtl"] .category-strip p,
[dir="rtl"] .metric-label,
[dir="rtl"] .pattern blockquote,
[dir="rtl"] .thinking > p:not(.section-marker),
[dir="rtl"] .longform section > p:last-child {
  font-family: var(--fa-family);
}

[dir="ltr"] body {
  font-family: var(--en-family);
}

[dir="ltr"] .system,
[dir="ltr"] .section-marker,
[dir="ltr"] .row-index,
[dir="ltr"] .credibility h2 {
  font-family: var(--mono-family);
}

h1,
h2,
h3 {
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.site-header {
  background: rgba(244, 244, 241, 0.9);
  transition: background-color var(--motion-ui) ease, border-color var(--motion-ui) ease;
}

.primary-nav a,
.header-cta,
.text-cta,
.primary-cta,
.depth-gateway a,
footer a {
  transition:
    color var(--motion-ui) ease,
    border-color var(--motion-ui) ease,
    background-color var(--motion-ui) ease,
    transform var(--motion-press) var(--ease-out-strong);
}

.header-cta:active,
.text-cta:active,
.primary-cta:active,
.depth-gateway a:active {
  transform: scale(0.98);
}

.section-marker {
  margin-bottom: 26px;
  opacity: 0.88;
}

.section-shell {
  padding-block: 104px 118px;
}

.hero {
  min-height: calc(100dvh - 76px);
}

.hero-portrait {
  background: #10141a;
}

.hero-portrait img {
  filter: saturate(0.9) contrast(1.04);
  transition: transform 260ms var(--ease-out-strong);
}

.hero-deck {
  max-width: 61ch;
}

.pattern {
  position: relative;
  overflow: hidden;
}

.commercial-system {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-block: 12px 46px;
  padding-top: 34px;
  isolation: isolate;
}

.commercial-system::before,
.commercial-system::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 11px;
  height: 1px;
  transform-origin: left center;
}

[dir="rtl"] .commercial-system::before,
[dir="rtl"] .commercial-system::after {
  transform-origin: right center;
}

.commercial-system::before {
  background: var(--border-strong);
}

.commercial-system::after {
  background: linear-gradient(90deg, var(--accent), var(--tech), var(--signal));
  transform: scaleX(0);
  transition: transform 900ms var(--ease-in-out-strong);
  z-index: 0;
}

.commercial-system.is-visible::after {
  transform: scaleX(1);
}

.commercial-stage {
  position: relative;
  min-height: 144px;
  padding-inline: 0 26px;
  opacity: 0.42;
  transform: translate3d(0, 6px, 0);
  transition:
    opacity 360ms var(--ease-out-strong),
    transform 360ms var(--ease-out-strong);
  transition-delay: calc(var(--stage-index) * 55ms + 160ms);
}

.commercial-system.is-visible .commercial-stage {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.commercial-stage::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: -29px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  background: var(--stage-color, var(--accent));
  box-shadow: 0 0 0 1px var(--stage-color, var(--accent));
}

.commercial-stage:nth-child(2) { --stage-color: #8b3c35; }
.commercial-stage:nth-child(3) { --stage-color: var(--tech); }
.commercial-stage:nth-child(4) { --stage-color: #176fa2; }
.commercial-stage:nth-child(5) { --stage-color: var(--signal); }

.commercial-stage span {
  display: block;
  margin-bottom: 22px;
  color: var(--stage-color, var(--accent));
  font-family: var(--mono-family);
  font-size: 10px;
}

[dir="rtl"] .commercial-stage span {
  font-family: var(--fa-family);
}

.commercial-stage strong {
  display: block;
  max-width: 13ch;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
}

.pattern blockquote {
  max-width: 850px;
  margin-inline-start: auto;
  font-size: 28px;
  line-height: 1.5;
}

.ledger-row {
  transition: background-color var(--motion-ui) ease;
}

.form-status[aria-live] {
  min-height: 1.6em;
}

.motion-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity var(--motion-section) var(--ease-out-strong),
    transform var(--motion-section) var(--ease-out-strong);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (hover: hover) and (pointer: fine) {
  .hero-portrait:hover img {
    transform: scale(1.008);
  }

  .ledger-row:hover {
    background: rgba(36, 87, 214, 0.035);
  }

  .depth-gateway a:hover {
    transform: translate3d(4px, 0, 0);
  }

  [dir="rtl"] .depth-gateway a:hover {
    transform: translate3d(-4px, 0, 0);
  }
}

@media (max-width: 980px) {
  .section-shell {
    padding-block: 84px 96px;
  }
}

@media (max-width: 640px) {
  .hero {
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 0;
    padding-block: 46px 58px;
  }

  .hero-content {
    display: contents;
  }

  .hero-content .section-marker,
  .hero-content .hero-name,
  .hero-content h1,
  .hero-content .hero-deck,
  .hero-content .text-cta,
  .hero-proof,
  .hero-portrait {
    grid-column: 1;
  }

  .hero-content .section-marker { grid-row: 1; margin-bottom: 24px; }
  .hero-content .hero-name { grid-row: 2; margin-bottom: 10px; }
  .hero-content h1 { grid-row: 3; margin-bottom: 28px; }
  .hero-portrait { grid-row: 4; margin: 0 0 32px; min-height: 332px; }
  .hero-content .hero-deck { grid-row: 5; margin-bottom: 24px; }
  .hero-content .text-cta { grid-row: 6; margin-bottom: 34px; }
  .hero-proof { grid-row: 7; }

  .hero-portrait img {
    min-height: 332px;
    object-position: center 16%;
  }

  .section-shell {
    padding-block: 52px 60px;
  }

  .commercial-system {
    grid-template-columns: 1fr;
    gap: 0;
    margin-block: 10px 34px;
    padding: 0;
  }

  .commercial-system::before,
  .commercial-system::after {
    inset-inline-start: 4px;
    inset-inline-end: auto;
    top: 4px;
    width: 1px;
    height: calc(100% - 28px);
    transform-origin: center top;
  }

  [dir="rtl"] .commercial-system::before,
  [dir="rtl"] .commercial-system::after {
    inset-inline-start: auto;
    inset-inline-end: 4px;
    transform-origin: center top;
  }

  .commercial-system::after {
    background: var(--tech);
    transform: scaleY(0);
  }

  .commercial-system.is-visible::after {
    transform: scaleY(1);
  }

  .commercial-stage {
    min-height: 0;
    padding: 0 28px 20px;
  }

  .commercial-stage::before {
    inset-inline-start: 0;
    top: 4px;
  }

  .commercial-stage span {
    margin-bottom: 6px;
  }

  .commercial-stage strong {
    max-width: none;
    font-size: 17px;
  }

  .pattern blockquote {
    margin-inline-start: 0;
    padding-inline-start: 22px;
    font-size: 22px;
  }

  .contact-layout form .primary-cta {
    width: 100%;
    min-height: 54px;
    justify-self: stretch;
  }

  footer a,
  .depth-gateway a {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready [data-reveal],
  .motion-ready [data-reveal].is-visible,
  .commercial-stage,
  .commercial-system.is-visible .commercial-stage {
    opacity: 1;
    transform: none;
    transition: opacity 160ms ease;
  }

  .commercial-system::after,
  .commercial-system.is-visible::after {
    transform: none;
    transition: none;
  }

  .hero-portrait img,
  .primary-nav a,
  .header-cta,
  .text-cta,
  .primary-cta,
  .depth-gateway a,
  footer a {
    transition-duration: 0.01ms;
  }
}
