:root {
  --turquoise: #04CFBE;
  --turquoise-50: #E6FBF9;
  --turquoise-100: #C9F7F2;
  --turquoise-600: #03B9AA;
  --turquoise-800: #017E74;
  --turquoise-950: #003333;
  --charcoal: #18181B;
  --grey: #F4F4F5;
  --white: #FFFFFF;
  --ink: var(--charcoal);
  --ink-soft: #3F3F46;
  --muted: #71717A;
  --rule: rgba(24, 24, 27, 0.1);
  --rule-strong: rgba(24, 24, 27, 0.16);
  --display: "Inter Tight", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 64px;
  --max: 1120px;
  --radius: 10px;
  --radius-sm: 8px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
  --ease: 160ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

html,
body {
  margin: 0;
  background: var(--grey);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--turquoise-800);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--charcoal);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 80;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--white) 84%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}

.nav-mark {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--charcoal);
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  color: var(--ink-soft);
  border-radius: var(--pill);
  transition: color var(--ease), background var(--ease);
}

.nav-links a:hover {
  color: var(--charcoal);
  background: var(--turquoise-50);
}

.nav-links a[aria-current="true"] {
  color: var(--turquoise-800);
  background: var(--turquoise-50);
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 88px) clamp(16px, 4vw, 40px) 96px;
  min-height: calc(100svh - var(--nav-h));
}

.portrait {
  position: relative;
  margin: 0;
  max-width: 440px;
  justify-self: start;
}

.portrait::before,
.portrait::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--turquoise);
  z-index: 1;
  pointer-events: none;
}

.portrait::before {
  top: -8px;
  left: -8px;
  border-right: 0;
  border-bottom: 0;
}

.portrait::after {
  right: -8px;
  bottom: -8px;
  border-left: 0;
  border-top: 0;
}

.portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 62% 40%;
  border-radius: var(--radius);
  max-height: calc(100svh - var(--nav-h) - 120px);
}

.portrait figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--white);
  background: color-mix(in srgb, var(--charcoal) 72%, transparent);
  padding: 5px 9px;
  border-radius: 6px;
}

.kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--turquoise-800);
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(64px, 10vw, 112px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0 0 18px;
  color: var(--charcoal);
}

.role {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 28em;
}

.lede {
  max-width: 38em;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  margin-bottom: 28px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--rule-strong);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.2;
  background: var(--white);
  color: var(--charcoal);
  cursor: pointer;
  border-radius: var(--pill);
  box-shadow: var(--shadow);
  transition:
    background var(--ease),
    border-color var(--ease),
    color var(--ease),
    transform var(--ease);
}

.btn:hover,
.chip:hover {
  background: var(--turquoise-50);
  border-color: var(--turquoise);
}

.btn:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: var(--charcoal);
}

.btn-primary:hover {
  background: var(--turquoise-600);
  border-color: var(--turquoise-600);
}

.chip.is-active,
.chip:active {
  background: var(--turquoise);
  color: var(--charcoal);
  border-color: var(--turquoise);
}

span.chip {
  cursor: default;
}

span.chip:hover {
  background: var(--white);
  border-color: var(--rule-strong);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* CHAPTER SHARED */
.chapter {
  position: relative;
  padding: clamp(72px, 11vw, 128px) clamp(16px, 4vw, 40px);
}

.chapter-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.ch-index {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--turquoise-800);
}

.ch-company {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 80px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}

.ch-role {
  margin: 0 0 36px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.ch-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.facts p {
  margin: 0 0 16px;
  color: inherit;
}

.facts h3 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--turquoise-800);
}

.achievements {
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievements li {
  padding: 12px 0 12px 16px;
  border-top: 1px solid var(--rule);
  position: relative;
}

.achievements li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 7px;
  height: 7px;
  background: var(--turquoise);
  border-radius: 2px;
}

.achievements li:last-child {
  border-bottom: 1px solid var(--rule);
}

.tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.tech span {
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--rule-strong);
  padding: 4px 8px;
  border-radius: var(--pill);
  color: var(--ink-soft);
  background: var(--white);
}

/* 01 SAI — pale turquoise founder chapter */
.ch-sai {
  background:
    radial-gradient(circle at 88% 12%, var(--turquoise-100), transparent 28%),
    var(--turquoise-50);
  color: var(--charcoal);
}

.ch-sai .ch-role,
.ch-sai .facts p {
  color: var(--ink-soft);
}

.ch-sai .achievements li {
  border-color: color-mix(in srgb, var(--turquoise-800) 16%, transparent);
}

.sai-brand {
  display: inline-flex;
  padding: 20px;
  margin: 0 0 28px -20px;
}

.sai-logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.visual {
  display: grid;
  gap: 28px;
}

.iso {
  justify-self: end;
}

.iso-svg {
  display: block;
  width: 168px;
  height: 96px;
}

.topology {
  display: grid;
  gap: 12px;
  font-size: 13px;
}

.topo-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.topo-node {
  background: var(--white);
  border: 1px solid var(--turquoise-100);
  border-radius: var(--radius);
  padding: 16px 14px;
  min-height: 86px;
  box-shadow: var(--shadow);
}

.topo-node strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--charcoal);
}

.topo-node span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.arrow {
  color: var(--turquoise);
  font-weight: 500;
}

.topo-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--turquoise-800);
}

/* 02 Aghanim — white / light grey, turquoise flow */
.ch-pay {
  background: var(--white);
  color: var(--charcoal);
}

.ch-pay .ch-grid {
  grid-template-columns: 1fr 1fr;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 4px 0 36px;
}

.metric {
  background: var(--grey);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
}

.metric b {
  display: block;
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--charcoal);
}

.metric span {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  max-width: 16em;
}

.rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
}

.rail div {
  position: relative;
  padding: 16px 12px 14px;
  background: var(--grey);
  border-radius: var(--radius-sm);
  min-height: 92px;
  color: var(--charcoal);
}

.rail div::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--turquoise);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.rail em {
  display: block;
  font-style: normal;
  color: var(--turquoise-800);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 03 daGama — charcoal, white type, turquoise architecture */
.ch-chain {
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--turquoise) 16%, transparent), transparent 34%),
    var(--charcoal);
  color: var(--white);
}

.ch-chain .ch-index {
  color: var(--turquoise);
}

.ch-chain .ch-role,
.ch-chain .facts p {
  color: #D4D4D8;
}

.ch-chain .facts h3 {
  color: var(--turquoise);
}

.ch-chain .achievements li {
  border-color: rgba(255, 255, 255, 0.12);
}

.ch-chain .achievements li::before {
  background: var(--turquoise);
}

.ch-chain .tech span {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #E4E4E7;
}

.flow {
  font-size: 13px;
  background: var(--turquoise-950);
  border: 1px solid color-mix(in srgb, var(--turquoise) 28%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
}

.flow-h {
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--turquoise) 22%, transparent);
  color: var(--turquoise);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.flow ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.flow b {
  color: var(--turquoise);
  font-weight: 600;
}

/* 04 SilentNotary — light grey, pale turquoise cards */
.ch-product {
  background: var(--grey);
  color: var(--charcoal);
}

.ch-product .ch-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.layers {
  position: relative;
  min-height: 280px;
  padding-top: 8px;
}

.ui-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.ui-card + .ui-card {
  margin-top: -20px;
  margin-left: 28px;
  background: var(--turquoise-50);
}

.ui-card:last-child {
  background: var(--turquoise-100);
}

.ui-card header {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--turquoise-800);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-card p {
  margin: 0;
  color: var(--ink-soft);
}

.bar {
  height: 6px;
  background: rgba(24, 24, 27, 0.08);
  margin: 12px 0 0;
  border-radius: var(--pill);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--turquoise);
  width: var(--w, 40%);
  border-radius: inherit;
}

/* earlier — alternating surfaces, varied proportions */
.earlier {
  background: var(--grey);
  padding: clamp(64px, 9vw, 112px) clamp(16px, 4vw, 40px);
}

.earlier h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.03em;
  margin: 0 0 32px;
}

.jobs {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.job {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  padding: 24px 24px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--grey);
}

.job:nth-child(1) {
  grid-column: 1 / -1;
  background: var(--white);
}

.job:nth-child(2) {
  background: var(--turquoise-50);
  border-color: var(--turquoise-100);
}

.job:nth-child(3) {
  background: var(--white);
}

.job:nth-child(4) {
  grid-column: 1 / -1;
  grid-template-columns: 148px 1fr;
  background: var(--white);
}

.job time {
  font-size: 12px;
  font-weight: 500;
  color: var(--turquoise-800);
}

.job h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.job p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* LAB */
.lab {
  background: var(--charcoal);
  color: var(--white);
  padding: clamp(72px, 11vw, 120px) clamp(16px, 4vw, 40px);
}

.lab h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 68px);
  letter-spacing: -0.035em;
  margin: 0 0 14px;
}

.lab-lead {
  max-width: 40em;
  color: #D4D4D8;
  margin: 0 0 36px;
}

.lab-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tabs button {
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #D4D4D8;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--pill);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.tabs button:hover {
  background: color-mix(in srgb, var(--turquoise) 12%, transparent);
  border-color: color-mix(in srgb, var(--turquoise) 40%, transparent);
  color: var(--white);
}

.tabs button[aria-selected="true"],
.tabs button.is-active {
  color: var(--charcoal);
  background: var(--turquoise);
  border-color: var(--turquoise);
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  min-height: 620px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #121214;
  overflow: hidden;
}

.panel-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-head div {
  padding: 18px 20px;
}

.panel-head div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-head h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--turquoise);
}

.panel-head p {
  margin: 0;
  font-size: 14px;
  color: #E4E4E7;
}

.codewrap {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--charcoal);
}

.code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: #A1A1AA;
}

.code-bar button {
  background: var(--turquoise);
  color: var(--charcoal);
  border: 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: var(--pill);
}

.code-bar button:hover {
  background: var(--turquoise-600);
}

pre {
  margin: 0;
  padding: 0 20px 20px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--white);
}

.kw {
  color: var(--turquoise);
}

.fn {
  color: var(--turquoise-100);
}

.cm {
  color: #A1A1AA;
}

.st {
  color: var(--turquoise-600);
}

.diagram {
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: #D4D4D8;
  background: var(--turquoise-950);
}

.why {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #D4D4D8;
  font-size: 14px;
}

.why strong {
  color: var(--white);
}

.form-demo {
  display: grid;
  gap: 10px;
  max-width: 320px;
}

.form-demo label {
  font-size: 12px;
  font-weight: 500;
}

.form-demo input {
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--white);
  padding: 9px 11px;
  font: inherit;
  border-radius: var(--radius-sm);
}

.form-demo button {
  justify-self: start;
  background: var(--turquoise);
  color: var(--charcoal);
  border: 0;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--pill);
}

.form-demo button:hover {
  background: var(--turquoise-600);
}

.form-demo .err {
  color: #FCA5A5;
  font-size: 12px;
}

.form-demo .ok {
  color: var(--turquoise);
  font-size: 12px;
}

.more {
  display: none;
}

.more.is-open {
  display: block;
}

.expand {
  margin: 0 20px 18px;
  background: transparent;
  color: var(--turquoise);
  border: 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* CONTACT */
.contact {
  background: var(--grey);
  padding: clamp(80px, 12vw, 148px) clamp(16px, 4vw, 40px) 48px;
  text-align: left;
  max-width: var(--max);
  margin: 0 auto;
}

.contact h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0 0 20px;
  max-width: 12em;
  color: var(--charcoal);
}

.contact > p {
  max-width: 36em;
  color: var(--ink-soft);
}

.contact-links {
  margin-top: 28px;
}

.ed {
  margin-top: 56px;
  font-size: 13px;
  color: var(--muted);
}

.ed p {
  margin: 0 0 8px;
  max-width: 46em;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero,
  .ch-grid,
  .ch-pay .ch-grid,
  .ch-product .ch-grid,
  .lab-shell,
  .job,
  .job:nth-child(4),
  .panel-head,
  .metrics,
  .topo-row,
  .rail,
  .jobs {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: unset;
    padding-bottom: 64px;
  }

  .portrait {
    max-width: 360px;
  }

  .portrait img {
    max-height: 58vh;
  }

  .iso {
    justify-self: start;
  }

  .job:nth-child(1),
  .job:nth-child(4) {
    grid-column: auto;
  }

  .tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tabs button {
    white-space: nowrap;
  }

  .panel {
    min-height: 0;
  }

  .ui-card + .ui-card {
    margin-left: 14px;
  }

  .nav-links a {
    padding: 8px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .nav-mark {
    white-space: nowrap;
  }

  .nav-wide {
    display: none;
  }

  .nav {
    gap: 8px;
  }

  .sai-brand {
    margin-left: -8px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
