/* VISI — public site. White, monochrome, almost no words: one continuous page.

   From the top: the name over a point-cloud hand; two dotted cables from the
   end of its wrist into the heads of two humanoids ("For The Next Generation
   of Humanoids"); the demo video; then data, contribute, contact.
   Everything below the robots is a short line and a lot of air. */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:    #ffffff;
  --ink:   #111111;
  --dim:   #8e8e8e;   /* the second tone; large type only (3.3:1) */
  --label: #6f6f6f;   /* small type needs the darker grey (4.9:1) */
  --line:  #ededed;
  --pill:  #222222;
  --tone:  #8995a4;   /* "Hand Data": the title's second tone (3.0:1, display size) */
  --blue:  #1898df;   /* "Humanoids": the logo's blue, deep enough for type (3.2:1) */
  --gutter: 40px;
  --nav: 76px;        /* the nav's height, over the top of the hero */
  /* The hand-and-robots picture is laid out in this unit, 1% of the width, so
     it keeps its proportions from a laptop to a large monitor. */
  --u: min(1vw, 19.2px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; font-weight: 400; }
.ink { color: var(--ink); }
.dim { color: var(--dim); }

/* ----------------------------------------------------------------- nav */

/* Part of the page, not the window: it sits over the top of the hero and
   scrolls away with it. */
.nav {
  position: absolute; inset: 0 0 auto; z-index: 10;
  height: var(--nav); padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.brand { display: flex; align-items: center; gap: 9px; justify-self: start; }
.brand .mark { display: block; height: 22px; width: auto; }
.brand span { font-size: 15px; font-weight: 500; letter-spacing: .2em; }
.links { display: flex; gap: 64px; }
.links a, .nav-cta {
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--label); transition: color .2s;
}
.links a:hover, .nav-cta:hover { color: var(--ink); }
.nav-cta { justify-self: end; color: var(--ink); }

/* ------------------------------------------------- hero: name and hand */

.stage { position: relative; }

.hero { padding: calc(var(--nav) + var(--u) * 5.5) var(--gutter) 0; text-align: center; }
.title {
  position: relative; z-index: 3;      /* over the white above the fingers */
  display: inline-flex; align-items: center; gap: .3em;
  font-size: clamp(36px, calc(var(--u) * 5.4), 92px);
  line-height: 1; letter-spacing: -.01em; font-weight: 400;
}
.title .tone { color: var(--tone); }
/* The mark sits in a 1.3em box, as the title was laid out with, and fills
   .82em of it. */
.title-mark {
  width: 1.3em; height: 1.3em; flex: none; margin-top: -.06em;
  padding: .24em; object-fit: contain;
}

/* The video has some white above the fingers; it tucks under the title. */
.hand {
  width: clamp(280px, calc(var(--u) * 42), 800px);
  margin: calc(var(--u) * -4) auto 0;
}
.hand-video {
  display: block; width: 100%; height: auto; aspect-ratio: 1036 / 942;
  background: #fff;
  /* The video's white is the page's white; feathering three edges hides the
     frame wherever a browser renders video a shade off. The bottom stays
     sharp: the wrist's end and the cables are there. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10%);
  mask-composite: intersect;
}

/* ----------------------------------------------- the cables and the robots */

.cables {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none; z-index: 2;
}
.cable {
  fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round;
  /* Zero-length dashes with round caps: a line of dots, moving from the hand
     to the robots. */
  stroke-dasharray: 0 7.5;
  animation: flow 1.2s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -7.5; } }
/* Hidden until the page has been scrolled, so the first screen is the name and
   the hand alone; then drawn downward from where they leave the wrist (--from,
   which site.js sets). */
.js .cables {
  clip-path: inset(0 0 calc(100% - var(--from, 0px)) 0);
  transition: clip-path 2.4s cubic-bezier(.45, .05, .2, 1);
}
.js .cables.drawn { clip-path: inset(0 0 0 0); }

/* Both robots fade out over the same stretch of the page, so they end at the
   same height: --fade-from and --fade-to are measured from the section's top,
   and each robot's mask converts them to its own top (--top). */
.humanoids {
  position: relative; height: calc(var(--u) * 80);
  --fade-from: calc(var(--u) * 40); --fade-to: calc(var(--u) * 52.5);
}
.robot {
  position: absolute; z-index: 1; width: auto; display: block; top: var(--top);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--fade-from) - var(--top)),
                                      transparent calc(var(--fade-to) - var(--top)));
  mask-image: linear-gradient(to bottom, #000 calc(var(--fade-from) - var(--top)),
                              transparent calc(var(--fade-to) - var(--top)));
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
/* Sized so the two heads come out the same size, as the photos are not. The
   first is cut at its left side, so it sits against the page's edge. */
.robot-a { left: 0; --top: calc(var(--u) * 13.5); height: calc(var(--u) * 40); }
.robot-b { left: calc(var(--u) * 14.6); --top: calc(var(--u) * 16.5); height: calc(var(--u) * 61); }

.next {
  position: absolute; z-index: 3;
  left: calc(var(--u) * 66.5); top: calc(var(--u) * 21);
  transform: translateX(-50%); width: max-content; max-width: calc(var(--u) * 58);
  font-size: calc(var(--u) * 4.2); line-height: 1.38; letter-spacing: -.005em;
  text-align: center;
}
.next .blue { display: block; color: var(--blue); }
.js .next.rv { transform: translate(-50%, 18px); }
.js .next.rv.in { transform: translateX(-50%); }

/* --------------------------------------------------------------- demos */

.demos { padding: 10vh var(--gutter) 4vh; }
.demo { margin: 7vh 0 0; }
.demo-video {
  display: block; width: 100%; height: auto;
  border-radius: 18px; border: 1px solid var(--line); background: #fafafa;
  cursor: pointer;
}
.demo figcaption { margin-top: 18px; font-size: 17px; letter-spacing: -.005em; }

.pill {
  display: inline-block;
  background: var(--pill); color: #fff;
  padding: 15px 30px; border-radius: 999px;
  font-size: 17px; letter-spacing: -.005em;
  transition: background .2s;
}
.pill:hover { background: #000; }

/* --------------------------------------------------------------- bands */

.band { padding: 20vh var(--gutter) 18vh; }
.line {
  font-size: clamp(28px, 3.1vw, 46px); line-height: 1.12; letter-spacing: -.025em;
  /* Each line is a few words and fits on one row at desktop widths; when it
     has to wrap, split it evenly instead of stranding the last word. */
  text-wrap: balance;
}

.specs {
  margin: 13vh 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.specs div { padding: 28px 24px 0 0; }
.specs dd {
  margin: 0; font-size: clamp(44px, 5.4vw, 80px); font-weight: 300;
  line-height: 1; letter-spacing: -.045em;
}
.specs small {
  font-size: .32em; font-weight: 400; letter-spacing: 0;
  color: var(--dim); margin-left: .25em;
}
.specs dt {
  margin-top: 16px; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--label);
}

/* ------------------------------------------------------------- closing */

.closing {
  padding: 18vh var(--gutter) 22vh;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
}

.foot {
  padding: 26px var(--gutter) 30px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; letter-spacing: .06em; color: var(--label);
}
.foot nav { display: flex; gap: 30px; }
.foot a:hover { color: var(--ink); }

/* -------------------------------------------------------------- reveal */

/* Armed only once JS has marked the page, so nothing stays hidden if the
   script never runs. */
.js .rv {
  opacity: 0; transform: translateY(18px);
  transition: opacity 1s cubic-bezier(.2, .7, .2, 1),
              transform 1s cubic-bezier(.2, .7, .2, 1);
}
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .js .next.rv { transform: translateX(-50%); }
  .cable { animation: none; }
  .js .cables { transition: none; }
}

/* -------------------------------------------------------------- narrow */

@media (max-width: 860px) {
  :root { --gutter: 20px; --nav: 60px; }
  .nav { grid-template-columns: 1fr auto; }
  .links { display: none; }

  .pill { padding: 13px 24px; font-size: 15px; }

  .band { padding: 16vh var(--gutter) 14vh; }
  .specs { grid-template-columns: repeat(2, 1fr); row-gap: 36px; margin-top: 9vh; }
  .closing { flex-direction: column; align-items: flex-start; padding: 16vh var(--gutter); }
}

/* --------------------------------------- phones: the picture, re-composed */

@media (max-width: 760px) {
  .hero { padding-top: calc(var(--nav) + 9vw); }
  .title { font-size: clamp(30px, 9vw, 44px); }
  .hand { width: 84vw; margin-top: -4vw; }

  .humanoids { height: 120vw; --fade-from: 53vw; --fade-to: 72vw; }
  .robot-a { --top: 14vw; height: 60vw; }
  .robot-b { left: 21vw; --top: 19vw; height: 92vw; }
  .next {
    left: auto; right: 4vw; top: 34vw; transform: none; width: 44vw; max-width: none;
    font-size: clamp(19px, 6vw, 28px); line-height: 1.3; text-align: left;
  }
  .js .next.rv { transform: translateY(18px); }
  .js .next.rv.in { transform: none; }
  .cable { stroke-width: 2.4; stroke-dasharray: 0 6; }
  @keyframes flow { to { stroke-dashoffset: -6; } }

  .demos { padding-top: 6vh; }
  .demo { margin-top: 5vh; }
  .demo-video { border-radius: 12px; }
  .demo figcaption { font-size: 15px; margin-top: 12px; }
}
