/* Musimpanen Intelligence — mpintelligence.com */

:root {
  /* Neutrals: literal white day, literal black night */
  --bg: #FFFFFF;
  --tint: #F6F6F7;
  --card: #FFFFFF;
  --line: #E6E6E8;
  --text: #000000;
  --text-2: #55555C;
  --text-3: #8A8A92;
  --nav-bg: rgba(255, 255, 255, .82);

  /* The three intelligences: hot coral, electric green, electric blue */
  --human: #FF3D9A;   /* the logo pink */
  --nature: #00D68F;
  --ai: #0A5CFF;
  /* Bridge hues so gradients stay electric, never muddy */
  --coral: #FF5F2E;   /* warm lead-in of every gradient, as in the logo */
  /* text versions that pass 4.5:1 on white */
  --human-text: #E6007A;
  --nature-text: #007F55;
  --cyan: #2EC5FF;

  --cta: var(--ai);
  --cta-hover: #0047D6;
  --on-cta: #FFFFFF;

  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1200px;
  --gutter: 16px;
  --radius: 12px;
  --radius-sm: 6px;
  --nav-h: 68px;
  --section-y: clamp(80px, 10vw, 140px);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(0,0,0,.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --tint: #0B0B0C;
    --card: #121214;
    --line: #26262A;
    --text: #FFFFFF;
    --text-2: #A6A6AE;
    --text-3: #75757D;
    --nav-bg: rgba(0, 0, 0, .78);
    --ai: #3D7BFF;
    --human-text: #FF3D9A;
    --nature-text: #00D68F;
    --cta: #0A5CFF;
    --cta-hover: #2E74FF;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --tint: #0B0B0C;
  --card: #121214;
  --line: #26262A;
  --text: #FFFFFF;
  --text-2: #A6A6AE;
  --text-3: #75757D;
  --nav-bg: rgba(0, 0, 0, .78);
  --ai: #3D7BFF;
  --human-text: #FF3D9A;
  --nature-text: #00D68F;
  --cta: #0A5CFF;
    --cta-hover: #2E74FF;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

@media (min-width: 640px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a, button { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--cta); color: var(--on-cta); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--ai); outline-offset: 3px; border-radius: 4px; }

.c-human { color: var(--human-text); }
.c-nature { color: var(--nature-text); }
.c-ai { color: var(--ai); }
.stop-human { stop-color: var(--human); }
.stop-coral { stop-color: var(--coral); }
.stop-nature { stop-color: var(--nature); }
.stop-cyan { stop-color: var(--cyan); }
.stop-ai { stop-color: var(--ai); }

/* Type */
.h2 {
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.035em;
  max-width: 18ch;
}
.lede { margin-top: 18px; font-size: clamp(18px, 1.6vw, 20px); color: var(--text-2); max-width: 52ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 16px; font-weight: 500; text-decoration: none; letter-spacing: -.01em;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn .chev { width: 10px; height: 10px; transition: transform .2s cubic-bezier(.23, 1, .32, 1); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .chev, .story__link:hover .chev { transform: translateX(2px); }
}
.btn--solid { background: var(--cta); color: var(--on-cta); }
.btn--solid:hover { background: var(--cta-hover); }
.btn--outline { color: var(--ai); background: var(--bg); border-color: var(--line); }
.btn--outline:hover { border-color: var(--ai); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 17px; }

/* Nav — transparent over the ribbon, solid once scrolled */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s;
}
.nav.is-scrolled, .nav:has(.is-open) {
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 450; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.logo b { font-weight: 700; }
.logo__mark { width: 26px; height: 26px; flex: none; }
.nav__toggle {
  display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.nav__bars, .nav__bars::before, .nav__bars::after {
  display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s;
}
.nav__bars { position: relative; }
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
.nav__bars::before { top: -7px; }
.nav__bars::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

.nav__links {
  position: absolute; top: var(--nav-h); left: 0; right: 0;
  display: none; flex-direction: column; gap: 4px;
  padding: 12px var(--gutter) 24px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.nav__links.is-open { display: flex; }
.nav__links a:not(.btn) { padding: 10px 0; font-weight: 500; font-size: 17px; text-decoration: none; color: var(--text); }
.nav__links a:not(.btn):hover { color: var(--ai); }
.nav__links .nav__cta { margin-top: 8px; align-self: flex-start; }

/* Lab account button (lab page only; empty until signed in) */
.nav__acct { margin-left: auto; margin-right: 6px; }
.nav__acct:empty { display: none; }

@media (min-width: 960px) {
  .nav__toggle { display: none; }
  .nav__acct { order: 3; margin: 0 0 0 24px; }
  .nav__acct ~ .nav__links { margin-left: auto; }
  .nav__links {
    position: static; display: flex; flex-direction: row; align-items: center; gap: 30px;
    padding: 0; background: none; border: 0;
  }
  .nav__links a:not(.btn) { padding: 0; font-size: 15px; }
  .nav__links a:not(.btn):hover { color: var(--text-2); }
  .nav__links .nav__cta { margin: 0 0 0 6px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding-top: var(--nav-h); }
.hero__rivers { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__inner { position: relative; z-index: 1; padding-top: clamp(96px, 16vw, 200px); padding-bottom: clamp(72px, 10vw, 140px); }
@media (max-width: 959px) { .hero__inner { padding-top: 220px; } }
.formula {
  display: flex; flex-wrap: wrap; gap: 0 8px;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em;
}
.formula__x { color: var(--text-3); font-weight: 400; }
.hero__title {
  margin-top: 28px;
  font-size: clamp(44px, 6.4vw, 92px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.045em;
  max-width: 9em;
  text-wrap: pretty;
}
.hero__sub {
  margin-top: 24px;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.45;
  letter-spacing: -.015em;
  color: var(--text-2);
  max-width: 34em;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }


/* Sections */
.section { padding: var(--section-y) 0; }
.section--tint { background: var(--tint); }
.section__head { margin-bottom: clamp(40px, 5vw, 64px); }

/* Thesis */
.thesis__grid { display: grid; gap: 24px; }
.thesis__label { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ai); }
.thesis__body { display: grid; gap: 24px; }
.thesis__body p { font-size: clamp(18px, 1.6vw, 20px); color: var(--text-2); max-width: 62ch; }
.thesis__body .thesis__lead {
  font-size: clamp(30px, 4.2vw, 52px); font-weight: 500; line-height: 1.1; letter-spacing: -.035em;
  color: var(--text); max-width: 22ch; margin-bottom: 12px;
}
.thesis__body .thesis__close {
  margin-top: 16px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; color: var(--text);
}
@media (min-width: 960px) {
  .thesis__grid { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
  .thesis__label { padding-top: 14px; }
}

/* Three Intelligences */
.intel { position: relative; background: var(--bg); border-top: 1px solid var(--line); }
.intel__sticky { padding: var(--section-y) 0; }
.intel__grid { display: grid; gap: 40px; }
.intel__list { display: grid; gap: 22px; margin-top: 36px; }
.intel__list li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 16px; }
.intel__list h3 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.intel__list p { margin-top: 4px; color: var(--text-2); max-width: 52ch; }
.marker { width: 12px; height: 12px; margin-top: 7px; border-radius: 3px; }
.marker--human { background: var(--human); box-shadow: 0 0 12px var(--human); }
.marker--nature { background: var(--nature); box-shadow: 0 0 12px var(--nature); }
.marker--ai { background: var(--ai); box-shadow: 0 0 12px var(--ai); }
.intel__close { margin-top: 32px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; max-width: 40ch; }
.intel__art svg { width: 100%; height: auto; overflow: hidden; }
.intel__art {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%);
          mask-image: linear-gradient(90deg, transparent 0, #000 9%);
}
.strand { fill: none; stroke-linecap: round; }
.strand--human { stroke: var(--human); }
.strand--nature { stroke: var(--nature); }
.strand--ai { stroke: var(--ai); }
.streams__label { font-family: var(--font); font-weight: 700; letter-spacing: -.02em; fill: #FFFFFF; }
@media (max-width: 959px) {
  .intel__art svg { max-width: 420px; margin: 0 auto; }
  .intel__art {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%);
            mask-image: linear-gradient(180deg, transparent 0, #000 9%);
  }
}
@media (min-width: 960px) {
  .intel { height: 280vh; }
  .intel__sticky {
    position: sticky; top: var(--nav-h);
    height: calc(100vh - var(--nav-h)); min-height: 560px;
    display: flex; align-items: center; padding: 0;
  }
  .intel__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 56px; }
  .intel .h2 { font-size: clamp(34px, 3.6vw, 48px); }
  .intel__list { gap: 18px; margin-top: 28px; }
  .intel__close { margin-top: 24px; }
}
@media (min-width: 960px) and (max-height: 760px) {
  .intel .lede { display: none; }
  .intel__list { margin-top: 22px; }
}

/* The Machine — Stripe-style bento: title top-left, live mockup bleeding off the card */
.machine { background: var(--tint); }
.bento { display: grid; gap: 16px; }
.bcard {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  min-height: 400px;
  border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line);
}
.bcard::before {
  /* gradient wash, like light through silk */
  content: ""; position: absolute; inset: 0; z-index: -1;
  opacity: .9;
}
.bcard__title {
  position: relative; z-index: 2;
  padding: 26px 28px 0;
  font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em;
  max-width: 30ch;
}
.bcard__title span { display: block; font-weight: 400; color: var(--text-2); }
.bcard__art { position: relative; flex: 1; min-height: 260px; }

/* Software Factory */
.bcard--software::before {
  background:
    radial-gradient(60% 70% at 100% 0%, color-mix(in srgb, var(--human) 70%, transparent), transparent 70%),
    radial-gradient(50% 60% at 80% 100%, color-mix(in srgb, var(--ai) 45%, transparent), transparent 70%),
    radial-gradient(40% 50% at 100% 60%, color-mix(in srgb, var(--human) 55%, transparent), transparent 70%);
}
.mock-window {
  position: absolute; left: 28px; right: 28%; bottom: -24px; top: 24px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-window__bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.mock-window__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mock-pill { margin-left: 12px; padding: 3px 10px; border-radius: 99px; background: var(--tint); font-size: 11px; color: var(--text-3); }
.pipeline { display: grid; gap: 14px; padding: 22px 20px; }
.pipeline__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 84px; align-items: center; gap: 14px; font-size: 13px; }
.pipeline__row b { font-weight: 500; }
.pipeline__bar { height: 6px; border-radius: 6px; background: var(--tint); overflow: hidden; }
.pipeline__bar em { display: block; width: 100%; height: 100%; border-radius: inherit; transform-origin: left center; background: linear-gradient(90deg, var(--coral), var(--human), var(--nature), var(--cyan), var(--ai)); }
.tag {
  display: inline-flex; align-items: center; justify-self: start; gap: 6px;
  padding: 3px 9px; border-radius: 99px; background: var(--tint);
  font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.tag--done { background: color-mix(in srgb, var(--nature) 16%, transparent); color: color-mix(in srgb, var(--nature) 60%, var(--text)); }
.tag--live { background: color-mix(in srgb, var(--ai) 14%, transparent); color: var(--ai); }
.tag--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mock-phone {
  position: absolute; right: 6%; top: 40px; width: 170px; height: 340px;
  border-radius: 28px; padding: 8px; background: #0A0A0A; box-shadow: var(--shadow);
}
.mock-phone__screen { height: 100%; border-radius: 21px; background: #FFFFFF; padding: 14px 12px; display: grid; align-content: start; gap: 8px; overflow: hidden; }
.mock-phone__hero { height: 92px; border-radius: 12px; background: linear-gradient(135deg, var(--coral), var(--human) 40%, var(--nature)); }
.mock-phone__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.mock-phone__tiles i { height: 54px; border-radius: 10px; background: #F1F1F3; }
.mock-phone__cta { height: 30px; margin-top: 6px; border-radius: 8px; background: var(--ai); }
.sk { height: 8px; border-radius: 8px; background: #E9E9EC; }
.sk--lg { height: 12px; width: 70%; background: #D8D8DD; }
.sk--short { width: 55%; }

/* Ads Factory */
.bcard--ads::before {
  background:
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--human) 55%, transparent), transparent 70%),
    radial-gradient(60% 60% at 100% 100%, color-mix(in srgb, var(--human) 45%, transparent), transparent 70%);
}
.ads {
  position: absolute; left: 28px; right: -30px; top: 28px; bottom: -30px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  transform: rotate(-6deg); transform-origin: 0 0;
}
.ad { position: relative; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; min-height: 130px; }
.ad--a { background: radial-gradient(circle at 30% 30%, var(--coral), var(--human) 60%, #C2185B); }
.ad--b { background: radial-gradient(circle at 70% 30%, var(--cyan), var(--ai) 65%, #1A0F6E); }
.ad--c { background: radial-gradient(circle at 40% 70%, #B6FF3B, var(--nature) 55%, #006B4F); }
.ad--d { background: radial-gradient(circle at 60% 60%, #FF7AC6, var(--human) 50%, var(--ai)); }
.ad__chip { position: absolute; left: 10px; top: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.92); color: #000; font-size: 12px; font-weight: 600; }
.ad__win { position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 99px; background: #FFFFFF; color: #000; font-size: 11px; font-weight: 600; opacity: 0; }
.ad::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px #FFFFFF; opacity: 0; }
.ad--b .ad__win, .ad--b::after { opacity: 1; } /* still state */

/* Content Factory */
.bcard--content::before {
  background:
    radial-gradient(70% 60% at 100% 100%, color-mix(in srgb, var(--nature) 55%, transparent), transparent 70%),
    radial-gradient(60% 60% at 0% 100%, color-mix(in srgb, var(--cyan) 45%, transparent), transparent 70%);
}
.feed {
  position: absolute; left: 28px; right: -24px; top: 28px; bottom: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
          mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.feed__track { display: grid; gap: 12px; padding-bottom: 12px; }
.post {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.post__body { display: grid; gap: 7px; justify-items: start; }
.post__body .sk { width: 100%; background: var(--line); }
.post__body .sk--short { width: 60%; }
.post__thumb { width: 56px; height: 56px; border-radius: 8px; }
.post__thumb--video { background: linear-gradient(135deg, var(--coral), var(--human)); }
.post__thumb--article { background: linear-gradient(135deg, var(--nature), var(--cyan)); }
.post__thumb--short { background: linear-gradient(135deg, var(--cyan), var(--ai)); }
.post__thumb--audio { background: linear-gradient(135deg, var(--human), var(--ai)); }

/* AI Engines */
.bcard--engines::before {
  background:
    radial-gradient(50% 70% at 50% 100%, color-mix(in srgb, var(--ai) 45%, transparent), transparent 70%),
    radial-gradient(40% 60% at 0% 0%, color-mix(in srgb, var(--cyan) 30%, transparent), transparent 70%),
    radial-gradient(40% 60% at 100% 0%, color-mix(in srgb, var(--nature) 30%, transparent), transparent 70%);
}
.engine { position: absolute; left: 50%; top: 50%; width: min(100%, 640px); transform: translate(-50%, -46%); overflow: visible; }
.engine__links path { fill: none; stroke: var(--line); stroke-width: 2; }
.engine__nodes rect { fill: var(--card); stroke: var(--line); filter: drop-shadow(0 6px 14px rgba(0,0,0,.08)); }
.engine__nodes text, .engine__core text { font: 500 14px var(--font); fill: var(--text); text-anchor: middle; }
.engine__core-inner { fill: var(--card); }
.pulse { fill: var(--ai); offset-rotate: 0deg; animation: travel 3.2s cubic-bezier(.77, 0, .175, 1) infinite; }
.p1 { offset-path: path("M320 150 C 240 150, 220 60, 158 60"); fill: var(--human); }
.p2 { offset-path: path("M320 150 C 240 150, 200 150, 138 150"); fill: var(--human); animation-delay: -.5s; }
.p3 { offset-path: path("M320 150 C 240 150, 220 240, 158 240"); fill: var(--nature); animation-delay: -1s; }
.p4 { offset-path: path("M320 150 C 400 150, 420 60, 482 60"); fill: var(--cyan); animation-delay: -1.6s; }
.p5 { offset-path: path("M320 150 C 400 150, 440 150, 502 150"); fill: var(--ai); animation-delay: -2.1s; }
.p6 { offset-path: path("M320 150 C 400 150, 420 240, 482 240"); fill: var(--human); animation-delay: -2.7s; }
@keyframes travel {
  0% { offset-distance: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.machine__close { margin-top: clamp(40px, 5vw, 56px); font-size: clamp(26px, 3.4vw, 40px); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }

@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bcard--wide { grid-column: span 2; }
  .bcard { min-height: 460px; }
}
@media (max-width: 899px) {
  .mock-window { right: 28px; }
  .mock-phone { display: none; }
  .bcard { min-height: 380px; }
}

/* What We Build — editorial rows: oversized spectrum titles, short line beside */
.build { border-top: 1px solid var(--line); }
.build__row {
  display: grid; gap: 10px; align-items: baseline;
  padding: clamp(28px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
}
.build__title {
  font-size: clamp(48px, 8vw, 112px); font-weight: 500; line-height: .95; letter-spacing: -.055em;
  background: linear-gradient(90deg, var(--coral), var(--human) 25%, var(--nature) 50%, var(--cyan) 75%, var(--ai)) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: background-position .6s cubic-bezier(.23, 1, .32, 1);
}
.build__row:nth-child(2) .build__title { background-position: 50% 0; }
.build__row:nth-child(3) .build__title { background-position: 100% 0; }
@media (hover: hover) and (pointer: fine) {
  .build__row:hover .build__title { background-position: 100% 0; }
  .build__row:nth-child(3):hover .build__title { background-position: 0 0; }
}
.build__text { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--text-2); max-width: 34ch; }
@media (min-width: 900px) {
  .build__row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: end; }
  .build__text { padding-bottom: .4em; }
}

/* How We Grow — three principle cards, each with a small picture of the idea */
.principles { display: grid; gap: 16px; }
.pcard {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
}
.pcard__art { position: relative; height: 200px; border-bottom: 1px solid var(--line); }
.pcard__text {
  padding: 24px 26px 28px;
  font-size: clamp(19px, 1.7vw, 22px); font-weight: 500; line-height: 1.3; letter-spacing: -.02em; max-width: 30ch;
}

/* 1. Many launches, most stay small, winners scale */
.pcard__art--bars {
  display: flex; align-items: flex-end; gap: 6px; padding: 28px 26px 0;
  background: radial-gradient(60% 80% at 45% 100%, color-mix(in srgb, var(--ai) 16%, transparent), transparent 70%);
}
.pcard__art--bars i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--line); }
.pcard__art--bars i.is-win { background: linear-gradient(to top, var(--ai), var(--cyan) 50%, var(--nature)); box-shadow: 0 0 24px color-mix(in srgb, var(--cyan) 45%, transparent); }
.pcard__art--bars i.is-win--2 { background: linear-gradient(to top, var(--coral), var(--human)); box-shadow: 0 0 20px color-mix(in srgb, var(--human) 40%, transparent); }

/* 2. Any sector; only the ones where the economics work light up */
.pcard__art--grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 26px;
  background: radial-gradient(60% 80% at 60% 50%, color-mix(in srgb, var(--nature) 14%, transparent), transparent 70%);
}
.pcard__art--grid i { border-radius: 6px; border: 1px dashed var(--line); }
.pcard__art--grid i.on { border: 0; position: relative; }
.pcard__art--grid i.on::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 5px;
  border: solid #FFFFFF; border-width: 0 0 2px 2px; transform: translate(-50%, -70%) rotate(-45deg);
}
.on--human { background: var(--human); box-shadow: 0 0 18px color-mix(in srgb, var(--human) 50%, transparent); }
.on--nature { background: var(--nature); box-shadow: 0 0 18px color-mix(in srgb, var(--nature) 50%, transparent); }
.on--ai { background: var(--ai); box-shadow: 0 0 18px color-mix(in srgb, var(--ai) 50%, transparent); }

/* 3. They bring the license, operations or customers; we bring the machine */
.pcard__art--jv {
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 20px;
  background: radial-gradient(60% 80% at 75% 50%, color-mix(in srgb, var(--human) 14%, transparent), transparent 70%);
}
.jv__side { display: grid; gap: 8px; justify-items: end; }
.chip {
  display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.jv__plus { font-size: 22px; font-weight: 400; color: var(--text-3); }
.chip--machine {
  padding: 12px 18px; border: 0; color: #FFFFFF; font-size: 15px; font-weight: 600;
  background: linear-gradient(120deg, var(--coral), var(--human) 30%, var(--ai) 75%, var(--cyan));
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--ai) 60%, transparent);
}

@media (min-width: 840px) {
  .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Portfolio — Stripe-style story cards */
.stories {
  display: grid; grid-auto-flow: column; grid-auto-columns: 82%;
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.stories::-webkit-scrollbar { display: none; }
.story { scroll-snap-align: start; display: flex; flex-direction: column; }
.story__media {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 5; border-radius: 10px; background: #000;
}
.story__media::after {
  /* film grain */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .28; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.story__logo {
  position: absolute; left: 24px; bottom: 22px; z-index: 3;
  color: #FFFFFF; font-size: 28px; font-weight: 700; letter-spacing: -.035em; line-height: 1;
}
.story__logo--img { width: 104px; height: auto; }
.story__text { margin-top: 18px; font-size: 18px; line-height: 1.45; letter-spacing: -.01em; }
.story__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 500; color: var(--ai); text-decoration: none; }
.story__link .chev { width: 10px; height: 10px; transition: transform .2s cubic-bezier(.23, 1, .32, 1); }

/* Generated artwork fills the card; the real logo sits bottom-left on top */
.story__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story__media::before {
  /* soft shade behind the logo so it reads on any image */
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent);
}
.story__logo--wordmark { width: 150px; height: auto; }

@media (min-width: 840px) {
  .stories { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
}

/* Lab — a lab notebook, deliberately unlike the Portfolio's picture cards */
.lab {
  --grid: color-mix(in srgb, var(--text) 6%, transparent);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
  border-top: 1px solid var(--line);
}
.lab__log { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.exp {
  display: grid; gap: 24px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.exp__meta { display: grid; align-content: start; justify-items: start; gap: 14px; }
.exp__no { font: 500 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; color: var(--text-3); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--live { color: var(--nature-text); background: color-mix(in srgb, var(--nature) 14%, transparent); }
.status--live i { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nature) 60%, transparent); animation: live-ping 2s ease-out infinite; }
@keyframes live-ping { to { box-shadow: 0 0 0 7px transparent; } }
.exp__meta dl { display: grid; gap: 10px; margin: 0; }
.exp__meta dt { font: 500 11px/1.2 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-3); }
.exp__meta dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; }
.exp__title { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.exp__text { margin-top: 12px; color: var(--text-2); max-width: 46ch; }
.exp__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-weight: 500; color: var(--ai); text-decoration: none; }
.exp__link .chev { width: 10px; height: 10px; transition: transform .2s cubic-bezier(.23, 1, .32, 1); }
@media (hover: hover) and (pointer: fine) { .exp__link:hover .chev { transform: translateX(2px); } }
.exp__shot {
  display: block; overflow: hidden; border-radius: 10px; border: 1px solid var(--line);
  background: #0E0E10; box-shadow: var(--shadow); text-decoration: none;
}
.exp__bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #1A1A1D; }
.exp__bar i { width: 8px; height: 8px; border-radius: 50%; background: #3A3A3F; }
.exp__bar span { margin-left: 10px; font: 500 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: #9A9AA2; }
.exp__shot img { display: block; width: 100%; height: auto; }
.exp--next {
  display: flex; align-items: center; gap: 16px; padding: 18px 24px;
  border-style: dashed; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.exp--next p { color: var(--text-3); font-weight: 500; }
.lab__rules { display: grid; gap: 1px; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.lab__rules li { padding: 16px 20px; background: var(--bg); font-size: 14px; color: var(--text-2); }
.lab__rules b { display: block; margin-bottom: 2px; color: var(--text); font-weight: 600; font-size: 15px; }
@media (min-width: 720px) { .lab__rules { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .exp { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: 32px; padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { .status--live i { animation: none; } }
.status--paused { color: color-mix(in srgb, #F2A100 70%, var(--text)); background: color-mix(in srgb, #F2A100 16%, transparent); }
.status--retired { color: var(--text-3); background: var(--tint); }
.status--graduated { color: var(--ai); background: color-mix(in srgb, var(--ai) 12%, transparent); }
.exp__learned { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--tint); font-size: 14px; color: var(--text-2); max-width: 52ch; }
.exp__learned b { color: var(--text); font-weight: 600; }
.exp[data-status="retired"] .exp__shot { filter: grayscale(1); opacity: .7; }

/* Older experiments on the homepage: one line each */
.lab__rows { margin: 16px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.exp[hidden], .exp-row[hidden] { display: none; }
.exp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "no status" "name status" "sum sum"; align-items: center; gap: 4px 12px; padding: 14px 18px; }
.exp-row .exp__no { grid-area: no; }
.exp-row__name { grid-area: name; }
.exp-row + .exp-row { border-top: 1px solid var(--line); }
.exp-row__name { font-weight: 600; letter-spacing: -.02em; }
.exp-row__name a { color: inherit; text-decoration: none; }
.exp-row__name a:hover { color: var(--ai); }
.exp-row__summary { grid-area: sum; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-row .status { grid-area: status; justify-self: end; }
@media (min-width: 900px) {
  .exp-row { grid-template-columns: 130px 220px minmax(0, 1fr) auto; grid-template-areas: "no name sum status"; gap: 16px; padding: 14px 20px; }
}
.lab__all { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-weight: 500; color: var(--ai); text-decoration: none; }
.lab__all .chev { width: 10px; height: 10px; }

/* The full Lab page */
.lab--page { padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 80px)); min-height: 100vh; }
.lab-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 24px; }
.lab-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text-2); font: 500 14px var(--font); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.lab-filter span { font-size: 12px; color: var(--text-3); }
.lab-filter[aria-pressed="true"] { color: var(--on-cta); background: var(--cta); border-color: var(--cta); }
.lab-filter[aria-pressed="true"] span { color: color-mix(in srgb, var(--on-cta) 75%, transparent); }
.lab-foot { padding: 28px 0 36px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.lab-foot a { color: inherit; }
.nav__links a[aria-current="page"] { color: var(--text); font-weight: 600; }


/* Finale — Work With Us + footer as one full-bleed scene over rice terraces */
.finale {
  --fin-fg: #000000; --fin-fg-2: rgba(0,0,0,.66); --fin-line: rgba(0,0,0,.14);
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(760px, 100vh, 1000px);
  display: flex; flex-direction: column;
  padding-top: clamp(64px, 9vw, 120px);
  color: var(--fin-fg);
  background: #F9FAF5; /* halftone paper */
}
.finale__art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.finale::after {
  /* keeps the copy readable over the art */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--fin-scrim, rgba(255,255,255,.55)) 0%, transparent 55%);
}
/* Dark mode: the inverted terraces glow on black, so the copy turns white */
@media (prefers-color-scheme: dark) {
  .finale {
    --fin-fg: #FFFFFF; --fin-fg-2: rgba(255,255,255,.74); --fin-line: rgba(255,255,255,.2);
    --fin-scrim: rgba(0,0,0,.6); --fin-glass: rgba(0,0,0,.55);
    background: #000000;
  }
}

.finale__top { display: grid; gap: 48px; }
.finale__title { font-size: clamp(44px, 6.4vw, 84px); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.finale__text { margin-top: 18px; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.45; color: var(--fin-fg-2); max-width: 34ch; }
.finale__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 32px; }
.finale__email { font-weight: 500; color: var(--fin-fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }

.finale__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; align-content: start; }
.finale__cols h3 { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--fin-fg-2); margin-bottom: 12px; }
.finale__cols a { display: block; padding: 5px 0; font-size: 17px; font-weight: 500; text-decoration: none; color: var(--fin-fg); }
.finale__cols a:hover { text-decoration: underline; text-underline-offset: 4px; }

.finale__bottom { margin-top: auto; padding-top: 40px; position: relative; z-index: 2; }
.finale__legal {
  /* frosted bar: the legal entity must stay readable over any artwork */
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  padding: 14px 20px; border-radius: 10px;
  background: var(--fin-glass, rgba(255,255,255,.78));
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  font-size: 14px; color: var(--fin-fg-2);
}

.finale__legal strong { font-weight: 600; color: var(--fin-fg); }
.finale__legal p:last-child { margin-left: auto; }
.finale__legal a { color: inherit; text-underline-offset: 2px; }

.finale__wordmark {
  position: relative; z-index: 1;
  margin: 0 0 -0.2em; padding: 0 var(--gutter);
  font-size: min(calc((100vw - var(--gutter) * 2) / 5.3), 340px); font-weight: 600; line-height: .82; letter-spacing: -.065em;
  color: #FFFFFF; white-space: nowrap; text-align: center;
  pointer-events: none; user-select: none;
}

@media (min-width: 900px) {
  .finale__top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px; }
  .finale__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 10px; }
}
@media (max-width: 899px) {
  .finale__legal p:last-child { margin-left: 0; width: 100%; }
  /* links stack over the terraces on phones: carry the fade further down */
  .finale::after { background: linear-gradient(180deg, var(--fin-scrim, rgba(255,255,255,.8)) 0%, var(--fin-scrim, rgba(255,255,255,.8)) 45%, transparent 80%); }
}

/* ---------- Living cards: The Machine and How We Grow ----------
   transform/opacity only; paused off-screen (main.js toggles .is-live). */
.machine, #grow { --play: paused; }
.machine.is-live, #grow.is-live { --play: running; }

/* Software Factory: each stage cycles Queued -> Running -> Done, one after another */
.stat { display: grid; justify-items: start; }
.stat > .tag { grid-area: 1 / 1; }
.stat--queued, .stat--run { opacity: 0; } /* still state: everything Done */
.pipeline__bar em { animation: stage-fill 10s cubic-bezier(.77, 0, .175, 1) infinite both; }
.stat--run { animation: stage-run 10s linear infinite both; }
.stat--done { animation: stage-done 10s linear infinite both; }
.stat--queued { animation: stage-queued 10s linear infinite both; }
.pipeline__bar em, .stat > .tag { animation-delay: calc(var(--i) * 2s - 10s); animation-play-state: var(--play); }
@keyframes stage-fill { 0% { transform: scaleX(0); } 20% { transform: scaleX(1); } 88% { transform: scaleX(1); } 90%, 100% { transform: scaleX(0); } }
@keyframes stage-run { 0%, 19.9% { opacity: 1; } 20%, 100% { opacity: 0; } }
@keyframes stage-done { 0%, 19.9% { opacity: 0; } 20%, 89.9% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes stage-queued { 0%, 89.9% { opacity: 0; } 90%, 100% { opacity: 1; } }
.mock-phone { animation: drift 6s ease-in-out infinite alternate; animation-play-state: var(--play); }
.mock-phone__cta { animation: breathe 2.4s ease-in-out infinite; animation-play-state: var(--play); }

/* Ads Factory: the winning creative rotates as tests finish */
.ad { animation: drift 5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -1.3s); animation-play-state: var(--play); }
.ad__win, .ad::after { animation: win 8s cubic-bezier(.23, 1, .32, 1) infinite both; animation-delay: calc(var(--i) * 2s - 8s); animation-play-state: var(--play); }
@keyframes win { 0% { opacity: 0; transform: scale(.9); } 4%, 22% { opacity: 1; transform: scale(1); } 26%, 100% { opacity: 0; transform: scale(1); } }

/* Content Factory: an endless feed */
.feed__track { animation: feed-scroll 14s linear infinite; animation-play-state: var(--play); }
@keyframes feed-scroll { to { transform: translateY(-50%); } }

/* Engines: pulses follow the same pause rule */
.pulse { animation-play-state: var(--play); }

/* How We Grow 1: launches rise and fall, winners keep climbing */
.pcard__art--bars i { transform-origin: bottom center; animation: launch 4s ease-in-out infinite alternate; animation-play-state: var(--play); }
.pcard__art--bars i:nth-child(3n) { animation-duration: 3.2s; animation-delay: -1s; }
.pcard__art--bars i:nth-child(3n+1) { animation-duration: 4.6s; animation-delay: -2.2s; }
.pcard__art--bars i.is-win { animation: winner 5s cubic-bezier(.77, 0, .175, 1) infinite alternate; animation-play-state: var(--play); }
.pcard__art--bars i.is-win--2 { animation-delay: -2.5s; }
@keyframes launch { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
@keyframes winner { 0% { transform: scaleY(.3); } 60%, 100% { transform: scaleY(1); } }

/* How We Grow 2: a scan sweeps the sectors; the ones that work light up */
.pcard__art--grid i { position: relative; }
.pcard__art--grid i:not(.on)::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  background: color-mix(in srgb, var(--ai) 22%, transparent); opacity: 0;
  animation: scan 6s linear infinite; animation-delay: calc(var(--n) * .18s - 6s); animation-play-state: var(--play);
}
@keyframes scan { 0% { opacity: 0; } 3% { opacity: 1; } 10%, 100% { opacity: 0; } }
.pcard__art--grid i.on { animation: pass 6s cubic-bezier(.23, 1, .32, 1) infinite; animation-delay: calc(var(--n) * .18s - 6s); animation-play-state: var(--play); }
@keyframes pass { 0%, 100% { transform: scale(1); } 4% { transform: scale(1.18); } 12% { transform: scale(1); } }

/* How We Grow 3: what partners bring flows into the machine */
.jv__side .chip { animation: hand-over 4.5s cubic-bezier(.77, 0, .175, 1) infinite; animation-play-state: var(--play); }
.jv__side .chip:nth-child(2) { animation-delay: -1.5s; }
.jv__side .chip:nth-child(3) { animation-delay: -3s; }
@keyframes hand-over { 0%, 55% { transform: translateX(0); opacity: 1; } 80% { transform: translateX(28px); opacity: 0; } 81% { transform: translateX(-12px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.chip--machine { animation: breathe 1.5s ease-in-out infinite; animation-play-state: var(--play); }

@keyframes drift { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* Reduced motion: every card shows its finished, still state */
@media (prefers-reduced-motion: reduce) {
  .machine *, .machine *::before, .machine *::after,
  #grow *, #grow *::before, #grow *::after { animation: none !important; }
}

/* Reduced motion: no sticky scroll track, final state shown statically */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intel { height: auto; }
  .intel__sticky { position: static; height: auto; padding: var(--section-y) 0; }
  .btn, .btn .chev, .story__link .chev { transition: none; }
  .pulse { animation: none; opacity: 0; }
}
