/* Smart business analytics — one page, motion on scroll.
   Grammar after Uber's Base: black and white, large grotesk type, strict grid, sharp corners, one accent. */

:root {
  --black: #000;
  --white: #fff;
  --gray50: #f6f6f6;
  --gray100: #eeeeee;
  --gray200: #e2e2e2;
  --gray300: #cbcbcb;
  --gray400: #afafaf;
  --gray500: #757575;
  --gray600: #545454;
  --gray700: #333333;
  --gray800: #1f1f1f;
  --accent: #276ef1;     /* Base blue400 — the one accent: the progress line, the call to action on hover */

  --gutter: clamp(16px, 4vw, 64px);
  --display: "Inter Tight", system-ui, -apple-system, sans-serif;
  --text: "Inter", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--white);
  color: var(--black);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.mono {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Nav ─────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  color: var(--white);
  mix-blend-mode: difference;
  transition: transform .5s var(--ease);
}
/* hidden while scrolling down, back on the way up */
.nav.away { transform: translateY(-100%); }
.nav:focus-within { transform: none; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 16px/1 var(--display);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.mark { width: 28px; height: 28px; fill: currentColor; flex: none; }
.nav nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.nav nav a { text-decoration: none; }
.nav nav a:not(.pill):hover { text-decoration: underline; text-underline-offset: 4px; }
.pill { border: 1.5px solid currentColor; padding: 9px 16px; }
@media (max-width: 720px) { .nav nav a:not(.pill) { display: none; } }
@media (max-width: 420px) { .nav .pill { display: none; } }

/* ── Page progress ─────────────────────────────── */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 11;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--page, 0));
}

/* ── Scenes: a tall section with a sticky stage; JS writes --p (0 → 1) ─── */
.scene { position: relative; --p: 0; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* ── 1 · Hero ────────────────────────────────────── */
.hero { height: 100vh; height: 100svh; }   /* not pinned: the first scroll moves the page */
.hero .stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) clamp(28px, 6vh, 64px);
}
.hero h1 {
  position: relative;
  font: 700 clamp(64px, 14.5vw, 240px)/.86 var(--display);
  letter-spacing: -.05em;
}
/* the mask leaves room for descenders (the y of analytics); the text waits further down to stay hidden */
.line { display: block; overflow: hidden; padding-bottom: .22em; margin-bottom: -.22em; }
.line > span {
  display: block;
  transform: translateY(130%);
  animation: rise 1.1s var(--ease) forwards;
}
.line:nth-child(2) > span { animation-delay: .1s; }
.line:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { to { transform: none; } }

.hero-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: clamp(24px, 4vh, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--black);
  opacity: 0;
  animation: fade .9s .6s var(--ease) forwards;
}
.hero-meta p:first-child { max-width: 34ch; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.35; }
.hero-meta .mono { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.scroll-cue { color: var(--gray500); opacity: calc(1 - var(--p) * 4); }
.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 32px;
  margin: 10px 0 0 auto;
  background: currentColor;
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes fade { to { opacity: 1; } }

/* ── 2 · Statement ───────────────────────────────── */
.statement { height: 260vh; }
.statement .stage { display: grid; place-items: center; padding: 0 var(--gutter); }
.statement p {
  max-width: 18ch;
  font: 600 clamp(34px, 5.6vw, 96px)/1.02 var(--display);
  letter-spacing: -.035em;
}
.statement .w { opacity: .12; }
/* the stage turns black at the end of the scene, handing over to Services (JS writes the colours) */

/* ── 3 · Services ────────────────────────────────── */
.services { background: var(--black); color: var(--white); }
.services-head {
  display: flex;
  justify-content: space-between;
  padding: clamp(80px, 14vh, 140px) var(--gutter) 0;
  color: var(--gray400);
}
.service { height: 240vh; }
.service .stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--gutter);
  padding: 96px var(--gutter) 48px;
}
.num { color: var(--gray400); }
.service h2 {
  margin: 20px 0 28px;
  font: 700 clamp(40px, 5.4vw, 92px)/.95 var(--display);
  letter-spacing: -.04em;
  max-width: 11ch;
}
.service .body { max-width: 44ch; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.55; color: var(--gray300); }
.viz-space { width: 100%; aspect-ratio: 1; max-width: 560px; justify-self: end; }   /* the shape stands here */

/* ── The shape: one wireframe object over the whole page, drawn white and inverted by what lies under it ── */
.shape {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: difference;
}

/* ── 4 · Sectors ─────────────────────────────────── */
.sectors { height: 240vh; }
.sectors .stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1vh;
}
.sectors .label { padding: 0 var(--gutter) 2vh; color: var(--gray500); }
.track {
  white-space: nowrap;
  font: 700 clamp(80px, 18vw, 320px)/.9 var(--display);
  letter-spacing: -.055em;
  will-change: transform;
}
.track.outline { color: transparent; -webkit-text-stroke: 2px var(--black); }
.sectors-note {
  padding: 3vh var(--gutter) 0;
  max-width: 40ch;
  margin-left: auto;
  font-size: clamp(16px, 1.4vw, 20px);
}

/* ── 5 · Company ─────────────────────────────────── */
.company {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: clamp(40px, 8vh, 96px);
  padding: clamp(96px, 16vh, 180px) var(--gutter);
  border-top: 1px solid var(--black);
}
.company-head { grid-column: 1 / span 7; }
.company-head .mono { display: block; margin-bottom: 24px; color: var(--gray500); }
.company-head h2 { font: 700 clamp(36px, 4.6vw, 76px)/1 var(--display); letter-spacing: -.04em; }
.company-body { grid-column: 8 / span 5; display: grid; gap: 20px; align-content: end; color: var(--gray600); font-size: 17px; }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.facts > div, .details > div { position: relative; padding-top: 18px; }
.facts > div::before, .details > div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s var(--ease);
}
.facts > div.in::before, .details > div.in::before { transform: none; }
.facts dt, .details dt { color: var(--gray500); margin-bottom: 10px; }
.facts dd { font: 600 clamp(20px, 2vw, 28px)/1.15 var(--display); letter-spacing: -.02em; }

/* ── 6 · Contact ─────────────────────────────────── */
.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 100vh;
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(48px, 8vh, 96px);
  background: var(--black);
  color: var(--white);
}
.contact > .mono { color: var(--gray400); }
.contact h2 {
  margin: 24px 0 32px;
  font: 700 clamp(72px, 15vw, 260px)/.86 var(--display);
  letter-spacing: -.055em;
}
.contact-lede { max-width: 40ch; color: var(--gray300); font-size: clamp(16px, 1.4vw, 20px); }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 auto;
  padding: 20px 28px;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  font: 600 18px/1 var(--display);
  transition: background .2s, color .2s;
}
.cta span { transition: transform .3s var(--ease); }
.cta:hover { background: var(--accent); color: var(--white); }
.cta:hover span { transform: translateX(6px); }
.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  margin-top: clamp(64px, 12vh, 140px);
}
.details dt { color: var(--gray400); }
.details dd { font: 500 clamp(17px, 1.5vw, 22px)/1.3 var(--display); }
.details a { text-decoration: none; }
.details a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ── Footer ──────────────────────────────────────── */
.footer {
  padding: 0 var(--gutter) 28px;
  background: var(--black);
  color: var(--white);
}
.bigmark {
  overflow: hidden;
  padding: .04em 0 .1em;
  font: 700 100px/.9 var(--display);   /* JS sets the size that fills the width */
  letter-spacing: -.05em;
  white-space: nowrap;
}
.bigmark .ch { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.bigmark.in .ch { transform: none; }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--gray700);
}
.footer-row .mono { color: var(--gray500); }

/* ── Lines that rise into place on enter ─────────── */
.reveal-line .line > span { transform: translateY(130%); transition: transform 1.1s var(--ease); }
.reveal-line.in .line > span { transform: none; }

/* ── Reveal on enter ─────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ── Phone ───────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-meta { flex-direction: column; align-items: flex-start; }
  .hero-meta .mono { align-items: flex-start; text-align: left; flex-direction: row; gap: 16px; }

  .service .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
    gap: 20px;
    padding-top: 92px;
    padding-bottom: 24px;
  }
  .service h2 { margin: 12px 0 14px; font-size: clamp(32px, 9vw, 52px); }
  .service .body { font-size: 15px; line-height: 1.5; }
  .viz-space { aspect-ratio: auto; height: 100%; }

  .company { grid-template-columns: minmax(0, 1fr); }
  .company-head, .company-body, .facts { grid-column: 1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .details { grid-template-columns: minmax(0, 1fr); }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .scroll-cue::after { display: none; }
}

/* ── Reduced motion: every scene shown at rest, in its final state ─── */
@media (prefers-reduced-motion: reduce) {
  .hero, .statement, .service, .sectors { height: auto; }
  .stage { position: relative; height: auto; min-height: 100svh; }
  .line > span, .hero-meta { animation: none; transform: none; opacity: 1; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .reveal-line .line > span, .bigmark .ch { transform: none; transition: none; }
  .scroll-cue::after { animation: none; }
  .sectors .stage { overflow: hidden; }
}
