/* Corva: everything below the hero.
   The three dots are one fixed layer (.dots) that src/site.js moves between
   three sets of anchors: the hero's #heroMark, the rail mark, and the closing logo. */

@property --lit { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --night: #05070A;
  --text: #E9EEF0;
  --teal: #35D0BE;
  --dim: #7F8D98;
  --soft: #B9C4CB;
  --line: #1C242C;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(84px, 10vw, 168px);
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--night); }
body {
  background: var(--night); color: var(--text);
  font: 400 16px/1.5 "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h2, h3, p, ul, ol { padding: 0; }
ul, ol { list-style: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the travelling dots ---------- */

/* hidden while the hero draws its own dots; shown from the moment the hero ends */
.dots { position: fixed; inset: 0; z-index: 5; pointer-events: none; visibility: hidden; }
html.js[data-dots="page"] .dots { visibility: visible; }

.tdot {
  --lit: 1;
  --halo: 0;
  --glow: 233, 238, 240;
  position: absolute; left: 0; top: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  will-change: transform;
}
.tdot.teal { --glow: 53, 208, 190; }
.tdot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, #fff 0, rgb(var(--glow)) 46%, rgba(var(--glow), .82) 100%);
  opacity: var(--lit);
}
/* the light a dot throws grows in as it leaves the hero, so the hand-off is a bare dot */
.tdot::after {
  content: ""; position: absolute; inset: -230%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--glow), .3) 0, rgba(var(--glow), .11) 20%, rgba(var(--glow), .035) 46%, rgba(var(--glow), 0) 100%);
  opacity: calc(var(--lit) * var(--lit) * .9 * var(--halo));
}

/* the mark: three anchors in the logo's triangle, sized in em */
.tri { position: relative; display: inline-block; width: .74em; height: .68em; flex: none; }
.tri b { position: absolute; width: .27em; height: .27em; border-radius: 50%; }
.tri b:nth-child(1) { left: 0; bottom: 0; }
.tri b:nth-child(2) { right: 0; bottom: 0; }
.tri b:nth-child(3) { left: 50%; top: 0; translate: -50% 0; }
/* without the script the closing logo still has its dots */
html:not(.js) #mark b { background: var(--text); }
html:not(.js) #mark b:nth-child(3) { background: var(--teal); }

.rail {
  position: fixed; z-index: 1; pointer-events: none;
  left: calc((var(--gutter) - 26px) / 2);
  top: 50%; translate: 0 -50%;
  font-size: 35px; line-height: 0;
}

/* ---------- shared type ---------- */

.label {
  font: 500 12px/1.4 "Hanken Grotesk", system-ui, sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}

h2 {
  font: 800 clamp(30px, 4.3vw, 66px)/1.02 "Archivo", system-ui, sans-serif;
  font-stretch: 125%; letter-spacing: -.022em; text-wrap: balance;
}
h3 { font: 800 1em/1.05 "Archivo", system-ui, sans-serif; font-stretch: 125%; letter-spacing: -.015em; }

/* headings are lit from the left, where the dots sit */
.lit { --lit: 1; color: var(--text); }
.js .lit { --lit: 0; transition: --lit 1100ms var(--ease-out); }
.js .lit[data-on="true"] { --lit: 1; }
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .lit {
    color: transparent;
    background: radial-gradient(circle at -10% 50%, #fff 0, var(--text) 30%, #9AA7AF 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-mask-image: radial-gradient(circle at -10% 50%, #000 calc(var(--lit) * 180% - 34%), transparent calc(var(--lit) * 180%));
    mask-image: radial-gradient(circle at -10% 50%, #000 calc(var(--lit) * 180% - 34%), transparent calc(var(--lit) * 180%));
  }
}

/* one item arrives; a group's children arrive in a short stagger (--i is set inline) */
.js [data-reveal],
.js [data-group] > * {
  opacity: 0; translate: 0 10px;
  transition: opacity 280ms var(--ease-out), translate 280ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js [data-reveal][data-on="true"],
.js [data-group][data-on="true"] > * { opacity: 1; translate: 0 0; }

.aside { color: var(--dim); font-size: clamp(16px, 1.3vw, 20px); line-height: 1.5; max-width: 44ch; }

a:focus-visible { outline: 2px solid var(--teal); outline-offset: 6px; border-radius: 2px; }

/* ---------- the agent layer: one list, finished row by row ---------- */

.layer {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(32px, 5vw, 96px);
  padding: 16svh var(--pad) 0 var(--gutter);
  --pin-top: max(14vh, calc(50vh - 270px));
}
.layer-intro { position: sticky; top: var(--pin-top); align-self: start; display: grid; gap: clamp(18px, 2vw, 28px); }
.layer-intro h2 { font-size: clamp(34px, 4.1vw, 66px); }
.layer-intro .then { color: var(--teal); }
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .layer-intro .then { background: radial-gradient(circle at -10% 50%, #D9FFF9 0, var(--teal) 40%, #2BA597 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.layer-body { color: var(--soft); font-size: clamp(17px, 1.35vw, 21px); line-height: 1.55; max-width: 36ch; }

/* the list holds still while the agents work through it; the room below is the scroll it takes */
.layer-run { position: relative; }
.layer-pin { position: sticky; top: var(--pin-top); }
.layer-room { height: 150vh; }

.clock {
  display: grid; padding-bottom: clamp(14px, 1.6vw, 22px);
  font: 500 clamp(15px, 1.2vw, 18px)/1 "Hanken Grotesk", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .12em; color: var(--dim);
}
.clock .at { grid-area: 1 / 1; transition: opacity 240ms var(--ease-out); }
.clock [data-at="after"] { opacity: 0; color: var(--text); }
.clock[data-done="true"] [data-at="before"] { opacity: 0; }
.clock[data-done="true"] [data-at="after"] { opacity: 1; }

.jobs { border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; column-gap: clamp(18px, 2vw, 32px);
  padding: clamp(18px, 2.6vh, 30px) 0; border-bottom: 1px solid var(--line);
  font-size: clamp(19px, 1.95vw, 30px); line-height: 1.25; font-weight: 500; letter-spacing: -.01em;
}
.ring { position: relative; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #34404A; }
.ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--teal);
  opacity: 0; transform: scale(.6); transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.job[data-done="true"] .ring::after { opacity: 1; transform: scale(1); }
.job-state { display: grid; }
.todo, .did { grid-area: 1 / 1; transition: opacity 240ms var(--ease-out); }
.todo { color: var(--soft); }
.todo em { font-style: normal; font-size: .6em; letter-spacing: .02em; color: var(--dim); white-space: nowrap; margin-left: .4em; }
.did { opacity: 0; color: var(--text); }
.did time { font-size: .6em; letter-spacing: .06em; color: var(--teal); font-variant-numeric: tabular-nums; margin-right: .7em; }
.job[data-done="true"] .todo { opacity: 0; }
.job[data-done="true"] .did { opacity: 1; }

/* ---------- how a project runs: one tall track, five stops, filled by scrolling ---------- */

.how { padding: 22svh var(--pad) 12svh var(--gutter); display: grid; gap: clamp(18px, 2.2vw, 32px); }
.how > h2 { font-size: clamp(40px, 6.4vw, 110px); line-height: .98; max-width: 12ch; }
.track { position: relative; margin-top: clamp(40px, 8vh, 110px); }
/* the rule's ends are placed on the first and last tick by the script */
.rule { position: absolute; left: 0; top: 0; width: 2px; height: 0; background: var(--line); }
.fill { position: absolute; inset: 0; background: var(--text); transform-origin: 50% 0; transform: scaleY(0); }

.stops { display: grid; }
.stop {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: clamp(16px, 2.6vw, 44px);
  padding-bottom: clamp(64px, 14vh, 150px);
}
.stop:last-child { padding-bottom: 0; }
.stop .n { grid-area: 1 / 2; font: 500 clamp(13px, 1vw, 15px)/1 "Hanken Grotesk", system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .1em; color: var(--dim); margin-bottom: clamp(10px, 1.2vw, 18px); }
.tick { grid-area: 2 / 1; align-self: center; position: relative; width: 18px; height: 18px; }
.tick::before, .tick::after { content: ""; position: absolute; left: 0; top: 8px; width: 18px; height: 2px; background: var(--line); }
.tick::after { background: var(--text); opacity: 0; transition: opacity 240ms var(--ease-out); }
.stop h3 { grid-area: 2 / 2; font-size: clamp(36px, 6vw, 100px); line-height: 1; letter-spacing: -.03em; }
.stop p { grid-column: 2; color: var(--soft); font-size: clamp(17px, 1.45vw, 23px); line-height: 1.5; max-width: 30ch; margin-top: clamp(12px, 1.4vw, 20px); }
.stop .n, .stop h3, .stop p { opacity: .3; transition: opacity 240ms var(--ease-out); }
.stop[data-on="true"] .n, .stop[data-on="true"] h3, .stop[data-on="true"] p { opacity: 1; }
.stop[data-on="true"] .tick::after { opacity: 1; }
/* step four is the agents, and gets the most room */
.stop.agents { padding-bottom: clamp(90px, 20vh, 220px); }
.stop.agents .n, .stop.agents h3 { color: var(--teal); }
.stop.agents h3 { font-size: clamp(44px, 8.2vw, 140px); }
.stop.agents .tick::after { background: var(--teal); }
.stop .yes { color: var(--text); max-width: 34ch; }
html:not(.js) .stop .n, html:not(.js) .stop h3, html:not(.js) .stop p, html:not(.js) .tick::after { opacity: 1; }
html:not(.js) .rule { display: none; }

.how .aside { margin-top: clamp(40px, 8vh, 96px); }

/* ---------- work so far: a quiet index ---------- */

.work { padding: 10svh var(--pad) 8svh var(--gutter); display: grid; gap: 14px; }
.work-head { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.1; }
.apps { margin-top: 14px; border-top: 1px solid var(--line); max-width: 1040px; }
.apps li {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; align-items: baseline;
  column-gap: clamp(16px, 2.4vw, 36px); padding: 16px 0; border-bottom: 1px solid var(--line);
}
.apps h3 { font-size: clamp(17px, 1.3vw, 20px); letter-spacing: -.01em; }
.apps .what { color: var(--soft); font-size: clamp(15px, 1.1vw, 17px); line-height: 1.45; }
.apps .state { color: var(--dim); font-size: 14px; font-weight: 500; text-align: right; white-space: nowrap; }
.apps a {
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; margin: -14px 0;
  background: linear-gradient(var(--dim), var(--dim)) 0 calc(100% - 11px) / 100% 1px no-repeat;
}
.apps a:active { opacity: .7; }
.work .aside { margin-top: 10px; color: var(--text); font-size: clamp(15px, 1.15vw, 18px); }
.work .aside span { color: var(--dim); }
@media (hover: hover) and (pointer: fine) {
  .apps a { transition: color 200ms ease; }
  .apps a:hover { color: var(--teal); background-image: linear-gradient(var(--teal), var(--teal)); }
}

/* ---------- the close ---------- */

/* the close is a tall run with one stuck screen: scrolling through it plays the logo reveal
   (src/reveal.js). Without the script, or with reduced motion, it is one ordinary screen. */
.close { position: relative; }
.js .close { height: 260svh; }
.close-pin { position: sticky; top: 0; min-height: 100svh; padding: 12svh var(--pad) 0 var(--gutter); display: flex; flex-direction: column; }
.js .close-pin { height: 100svh; }
.close-end { display: block; height: 0; }
.close-main { margin-block: auto; }
.logo { display: flex; align-items: baseline; gap: .13em; font: 700 clamp(44px, 15.5vw, 250px)/1 "Unbounded", system-ui, sans-serif; letter-spacing: -.012em; }
.word-lg { white-space: nowrap; }
.word-lg > * { display: inline-block; }
.ch { will-change: transform, opacity; }
/* the v: an unseen copy holds the space while each arm, a copy cut along the pen's edge, is drawn;
   once drawn, the two cut copies give way to the one whole letter, so no seam shows */
.v { position: relative; color: var(--teal); }
.v .half, .v .arm { position: absolute; inset: 0; }
html:not(.js) .v .half, .close.no-reveal .v .half { display: none; }
.js .close:not(.no-reveal) .v .hold { visibility: hidden; }
.js .close:not(.no-reveal) .v[data-done="true"] .hold { visibility: visible; }
.v[data-done="true"] .half { visibility: hidden; }
/* until the script places them, the word and the contact line wait unseen */
.js .close:not(.no-reveal) .ch, .js .close:not(.no-reveal) .tail { opacity: 0; }
.ask { margin-top: clamp(26px, 4vw, 56px); color: var(--soft); font-size: clamp(18px, 1.7vw, 26px); }
.reach { margin-top: 12px; }
.addr { display: block; margin-top: 6px; color: var(--dim); font-size: 15px; }
.reach a {
  display: inline-flex; align-items: center; min-height: 48px; color: var(--text); text-decoration: none;
  font: 800 clamp(28px, 3.6vw, 56px)/1.1 "Archivo", system-ui, sans-serif; font-stretch: 125%; letter-spacing: -.015em;
  background: linear-gradient(var(--teal), var(--teal)) 0 100% / 100% 2px no-repeat;
  transition: transform 140ms var(--ease-out);
}
.reach a:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .reach a { transition: transform 140ms var(--ease-out), color 200ms ease; }
  .reach a:hover { color: var(--teal); }
}
.foot {
  margin-top: auto; padding: clamp(60px, 12svh, 140px) 0 clamp(20px, 4svh, 40px);
  font: 500 12px/1.4 "Hanken Grotesk", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: clamp(20px, 2.4vw, 32px); row-gap: 14px;
}
/* small and quiet; each link still takes a 44px tap without moving the line */
.foot nav { display: flex; flex-wrap: wrap; column-gap: clamp(18px, 2vw, 28px); row-gap: 4px; }
.foot nav a { display: inline-block; padding: 15px 0; margin: -15px 0; color: var(--dim); text-decoration: none; }
.foot nav a[aria-current="page"] { color: var(--soft); }
.foot p { margin-left: auto; }
@media (hover: hover) and (pointer: fine) {
  .foot nav a { transition: color 200ms ease; }
  .foot nav a:hover { color: var(--text); }
}

/* ---------- phones and narrow windows (same expression as the script's matchMedia) ---------- */

@media (max-width: 900px), (max-aspect-ratio: 1/1) {
  :root { --gutter: var(--pad); }
  .rail { left: var(--pad); top: 20px; translate: none; font-size: 26px; }
  /* text scrolls under the mark at the top of a phone: a band of night keeps the dots clear */
  .rail::before {
    content: ""; position: fixed; left: 0; right: 0; top: 0; height: 64px; z-index: -1;
    background: linear-gradient(var(--night) 58%, rgba(5, 7, 10, 0));
    opacity: 0; transition: opacity 200ms ease;
  }
  html.js[data-dots="page"] .rail::before { opacity: 1; }

  .layer { grid-template-columns: minmax(0, 1fr); padding: 14svh var(--pad) 0; --pin-top: 76px; }
  .layer-intro { position: static; margin-bottom: 8svh; }
  .layer-room { height: 130vh; }
  .job { grid-template-columns: 22px minmax(0, 1fr); column-gap: 16px; padding: 16px 0; font-size: clamp(17px, 4.6vw, 20px); }
  .ring { width: 22px; height: 22px; }

  .how { padding: 16svh var(--pad) 10svh; }
  .stop { grid-template-columns: 22px minmax(0, 1fr); column-gap: 18px; padding-bottom: clamp(48px, 9svh, 80px); }
  .stop h3 { font-size: clamp(30px, 9vw, 44px); }
  .stop.agents h3 { font-size: clamp(36px, 11vw, 54px); }
  .stop.agents { padding-bottom: clamp(64px, 12svh, 110px); }

  .work { padding: 10svh var(--pad) 6svh; }
  .apps li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .apps h3 { grid-area: 1 / 1; }
  .apps .state { grid-area: 1 / 2; }
  .apps .what { grid-area: 2 / 1 / 3 / 3; }

  .close-pin { padding: 12svh var(--pad) 0; }
  .foot nav { column-gap: 14px; }
  .foot p { margin-left: 0; flex-basis: 100%; }
  .logo { font-size: clamp(44px, 18vw, 120px); }
}

/* ---------- reduced motion: no travel, no slides, short fades ---------- */

@media (prefers-reduced-motion: reduce) {
  .tdot { transition: --lit 200ms ease; }
  .js .lit { transition-duration: 200ms; }
  .js [data-reveal], .js [data-group] > * { translate: 0 0; transition: opacity 200ms ease; transition-delay: 0ms; }
  .stop .n, .stop h3, .stop p, .tick::after { transition-duration: 200ms; }
  .ring::after { transform: none; transition: opacity 200ms ease; }
  .todo, .did, .clock .at { transition-duration: 200ms; }
  .js .close { height: auto; }
  .js .close-pin { position: static; height: auto; }
  .ch, .tail { transition: opacity 200ms ease; }
}
