/* ==========================================================================
   Sigentic Labs — styles
   ========================================================================== */

@property --glow-a { syntax: '<color>'; inherits: true; initial-value: #e9ffd0; }
@property --glow-b { syntax: '<color>'; inherits: true; initial-value: #8fd9ff; }

:root {
  --bg: #060708;
  --bg-2: #0a0b0d;
  --surface: #0e1013;
  --surface-2: #14161a;
  --surface-3: #1a1d22;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.22);
  --text: #f4f5f7;
  --text-2: #a5aab3;
  --text-3: #7b818a;

  --signal: #bdf75f;
  --signal-rgb: 189, 247, 95;

  --savorly-a: #ffb45c;
  --savorly-b: #ff6a3d;
  --morse-a: #5b9dff;
  --morse-b: #2f63e0;
  --mesh-a: #4fdba6;
  --mesh-b: #1fa572;
  --incant-a: #9d86ff;
  --incant-b: #5a37d6;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', ui-serif, Georgia, 'Times New Roman', serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --nav-h: 68px;
  --col-gap: clamp(20px, 2.4vw, 32px);
  --grid: repeat(12, minmax(0, 1fr));

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }

::selection { background: var(--signal); color: #0a0b0d; }

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

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.3s var(--ease-out);
}
.skip:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-3); }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

h2 {
  font-size: clamp(2.5rem, 5.6vw, 4.75rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
  margin-top: 22px;
}

h2 em,
.manifesto__text em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 15px/1 var(--font-sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }

.btn--light { background: var(--text); color: #08090b; }
.btn--light:hover { background: #fff; }

.btn--ghost { color: var(--text); border-color: var(--line-2); background: transparent; }
.btn--ghost:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.05); }

.btn__icon { width: 16px; height: 16px; flex: none; transition: transform 0.35s var(--ease-out); }
.btn:hover .btn__icon { transform: translateX(2px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  transition: background-color 0.4s, transform 0.5s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(6, 7, 8, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__bar {
  position: relative;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  height: var(--nav-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand__mark { color: var(--signal); width: 24px; height: 24px; flex: none; }
.brand__name span { color: var(--text-2); font-weight: 500; }

.nav__links {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 32px;
  transform: translateX(-50%);
}
.nav__links a {
  padding: 6px 0;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text); }

.nav__end { display: flex; align-items: center; gap: 8px; }

.nav__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 23px; }
.nav__toggle[aria-expanded='true'] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__toggle[aria-expanded='true'] span:last-child { top: 19px; transform: rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 32px) var(--gutter) 40px;
  background: rgba(6, 7, 8, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.menu.is-open { opacity: 1; }
.menu[hidden] { display: none; }
.menu__links { display: grid; }
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
.menu__links a .mono { font-size: 12px; color: var(--text-3); letter-spacing: 0; }
.menu.is-open .menu__links a { opacity: 1; transform: none; }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: 0.04s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: 0.08s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: 0.12s; }
.menu.is-open .menu__links a:nth-child(5) { transition-delay: 0.16s; }
.menu__foot { color: var(--text-3); font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  --sx: 72%;
  --sy: 48%;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* the particles' light, in the colour of whichever product they're drawing */
.hero__glow {
  position: absolute;
  z-index: -1;
  left: var(--sx);
  top: var(--sy);
  width: min(70vw, 880px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in oklab, var(--glow-a) 15%, transparent),
    color-mix(in oklab, var(--glow-b) 5%, transparent) 55%,
    transparent 100%);
  transition: --glow-a 1.6s var(--ease-out), --glow-b 1.6s var(--ease-out);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 40px;
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 64px;
}

.hero__copy { position: relative; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

.hero__title {
  margin-top: 28px;
  font-size: clamp(2.7rem, 6.3vw, 5.75rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.hero__line { display: block; }
.hero__line > span { display: inline-block; white-space: nowrap; }

.rotator {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.02em;
  line-height: 1;
  padding-right: 0.06em;
  white-space: nowrap;
}
.rotator .ch {
  display: inline-block;
  white-space: pre;
  will-change: transform, opacity, filter;
}
.rotator .ch.in { animation: chIn 0.8s var(--ease-out) both; animation-delay: calc(var(--k) * 24ms); }
.rotator .ch.out { animation: chOut 0.38s cubic-bezier(0.55, 0, 1, 0.45) both; animation-delay: calc(var(--k) * 12ms); }

@keyframes chIn {
  from { opacity: 0; transform: translateY(0.4em) rotate(6deg); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes chOut {
  to { opacity: 0; transform: translateY(-0.32em) rotate(-4deg); filter: blur(8px); }
}

.hero__lede {
  max-width: 41ch;
  margin-top: 30px;
  font-size: clamp(1.04rem, 1.25vw, 1.18rem);
  color: var(--text-2);
  line-height: 1.6;
  text-wrap: balance;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.hero__stage {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  justify-self: end;
}

/* registration marks around the particles */
.stage-frame {
  --c: rgba(255, 255, 255, 0.16);
  --l: 14px;
  position: absolute;
  inset: -6%;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
}

/* the four products along the bottom; the one the particles are drawing is lit */
.hero__index { position: relative; z-index: 1; }
.hero__index-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero__index a {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 3px;
  padding: 22px 20px 26px 0;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.5s;
}
.hero__index a + a { padding-left: 20px; }
.hero__index a::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: var(--glow-a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out);
}
.hero__index img { grid-row: span 2; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; outline: 1px solid rgba(255, 255, 255, 0.12); outline-offset: -1px; opacity: 0.55; transition: opacity 0.5s; }
.hero__index a:hover img { opacity: 1; }
.hero__index strong { font-size: 15px; font-weight: 500; letter-spacing: -0.015em; color: var(--text-2); transition: color 0.5s; }
.hero__index a > span:last-child { font-size: 13px; }
.hero__index a:hover strong { color: var(--text); }
.hero[data-scene='1'] [data-scene-link='1'],
.hero[data-scene='2'] [data-scene-link='2'],
.hero[data-scene='3'] [data-scene-link='3'],
.hero[data-scene='4'] [data-scene-link='4'] { color: var(--text-2); }
.hero[data-scene='1'] [data-scene-link='1'] strong,
.hero[data-scene='2'] [data-scene-link='2'] strong,
.hero[data-scene='3'] [data-scene-link='3'] strong,
.hero[data-scene='4'] [data-scene-link='4'] strong,
.hero[data-scene='1'] [data-scene-link='1'] img,
.hero[data-scene='2'] [data-scene-link='2'] img,
.hero[data-scene='3'] [data-scene-link='3'] img,
.hero[data-scene='4'] [data-scene-link='4'] img { color: var(--text); opacity: 1; }
.hero[data-scene='1'] [data-scene-link='1']::before,
.hero[data-scene='2'] [data-scene-link='2']::before,
.hero[data-scene='3'] [data-scene-link='3']::before,
.hero[data-scene='4'] [data-scene-link='4']::before { transform: none; }

/* intro */
.js [data-intro] {
  animation: introIn 1.1s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}
@keyframes introIn { from { opacity: 0; transform: translateY(20px); filter: blur(8px); } }

/* reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Section heads ----------
   One grid for the whole page: a label in the first three columns, the
   heading and content in the other nine. */
.section { position: relative; padding: clamp(96px, 11vw, 160px) 0; }

.section-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.section-label span { color: var(--text-3); }

.section-head {
  display: grid;
  grid-template-columns: var(--grid);
  column-gap: var(--col-gap);
  margin-bottom: clamp(64px, 8vw, 112px);
}
.section-head .section-label { grid-column: 1 / span 3; grid-row: 1 / span 2; padding-top: 0.35em; }
.section-head__title {
  grid-column: 4 / -1;
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.3rem, 4.8vw, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
  text-wrap: balance;
}
.section-head__title em { color: var(--text-2); font-size: 1.06em; }
.section-head__lede {
  grid-column: 4 / -1;
  max-width: 50ch;
  margin-top: 26px;
  font-size: clamp(1.02rem, 1.2vw, 1.12rem);
  color: var(--text-2);
}

/* ---------- Manifesto ---------- */
.manifesto { padding: clamp(120px, 15vw, 200px) 0 clamp(40px, 5vw, 64px); }
.manifesto__inner {
  display: grid;
  grid-template-columns: var(--grid);
  column-gap: var(--col-gap);
}
.manifesto__inner > .section-label { grid-column: 1 / span 3; padding-top: 0.9em; }
.manifesto__inner > div { grid-column: 4 / -1; }
.manifesto__text {
  max-width: 31ch;
  font-size: clamp(1.75rem, 3.5vw, 3.15rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.04em;
  text-wrap: pretty;
}
.manifesto__text em { font-size: 1.1em; letter-spacing: -0.01em; }
.manifesto__sig { display: flex; align-items: center; gap: 12px; margin-top: 44px; color: var(--text-3); font-size: 13px; }
.manifesto__sig svg { width: 22px; height: 22px; color: var(--signal); }

/* ---------- Products ----------
   One chapter per product: a rule with its number, field and status, the
   name and copy on the left, and a lit stage with the real product on the
   right. Stages crop their contents at the bottom edge on purpose. */
.products { padding-top: clamp(40px, 6vw, 80px); }

/* each stage is lit in its product's hue, at the same lightness and depth */
.product--savorly { --stage-1: oklch(0.4 0.105 50);   --stage-2: oklch(0.19 0.045 42); }
.product--morse   { --stage-1: oklch(0.37 0.1 264);   --stage-2: oklch(0.18 0.05 264); }
.product--mesh    { --stage-1: oklch(0.37 0.065 168); --stage-2: oklch(0.18 0.03 168); }
.product--incant  { --stage-1: oklch(0.36 0.11 290);  --stage-2: oklch(0.18 0.06 290); }

.product {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "rule    rule"
    "intro   stage"
    "details stage";
  column-gap: clamp(40px, 6vw, 88px);
}
.product + .product { margin-top: clamp(96px, 11vw, 150px); }

.product__rule {
  grid-area: rule;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.product__field { color: var(--text-2); }

.state { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text); }
.state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.state--dev::before { background: #ffc857; }

.product__intro { grid-area: intro; }
/* a hairline ring so dark product icons (Morse) still read on dark surfaces */
.product__icon,
.ledger__project img { outline: 1px solid rgba(255, 255, 255, 0.12); outline-offset: -1px; }
.product__icon { width: 52px; height: 52px; border-radius: 13px; }
.product__name {
  margin-top: 30px;
  font-size: clamp(3rem, 5.6vw, 4.9rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.92;
}
.product__tagline {
  max-width: 22ch;
  margin-top: 18px;
  font-size: clamp(1.3rem, 1.9vw, 1.65rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-2);
  text-wrap: balance;
}
.product__tagline em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.product__details { grid-area: details; align-self: end; padding-top: 44px; }
.product__desc { max-width: 46ch; font-size: 15.5px; line-height: 1.65; color: var(--text-2); }
.product__features {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.product__features li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.45;
}
.product__features li::before {
  content: '';
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  transform: translateY(-3px);
}
.product__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.product__platforms { margin-top: 16px; font-size: 13px; color: var(--text-3); }

/* the stage: a lit backdrop in the product's colour, with the work set into it */
.product__stage {
  grid-area: stage;
  position: relative;
  min-height: 640px;
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  background:
    radial-gradient(70% 60% at 50% -8%, rgba(255, 255, 255, 0.13), transparent 72%),
    linear-gradient(180deg, var(--stage-1), var(--stage-2) 92%);
}
.product__stage::after {
  /* hairline edge and top highlight, drawn over the contents */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* the work rises into the stage as it reveals */
.js .product__stage[data-reveal] > * { transform: translateY(56px); transition: transform 1.5s var(--ease-out) 0.1s; }
.js .product__stage[data-reveal] > :nth-child(2) { transition-delay: 0.3s; }
.js .product__stage[data-reveal].is-in > * { transform: none; }

/* Savorly: a phone */
.phone {
  position: absolute;
  left: 50%;
  top: 64px;
  width: 300px;
  margin-left: -150px;
  padding: 8px;
  border: 3px solid #2b2d32;
  border-radius: 56px;
  background: #050505;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 50px 90px -30px rgba(0, 0, 0, 0.75),
    0 18px 36px -18px rgba(0, 0, 0, 0.5);
}
.phone__screen { overflow: hidden; border-radius: 45px; background: #0d0d0d; }
.phone__screen img { display: block; width: 100%; height: auto; }
.phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 4px 24px 0 34px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.phone__island { width: 86px; height: 26px; border-radius: 20px; background: #000; }
.phone__sys { display: flex; align-items: flex-end; gap: 2px; width: 30px; justify-content: flex-end; }
.phone__sys i { width: 3px; border-radius: 1px; background: var(--text); }
.phone__sys i:nth-child(1) { height: 5px; }
.phone__sys i:nth-child(2) { height: 7px; }
.phone__sys i:nth-child(3) { height: 9px; }

/* Morse: a capture of the desktop app in a plain window */
.app-window {
  position: absolute;
  left: 50%;
  top: 56px;
  width: min(80%, 560px);
  translate: -50% 0;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 50px 90px -30px rgba(0, 0, 0, 0.7), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
}
.app-window__bar { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; background: #f2f3f5; border-bottom: 1px solid #e3e5e9; }
.app-window__bar i { width: 11px; height: 11px; border-radius: 50%; background: #d7d9de; }
.app-window img { display: block; width: 100%; height: auto; }

/* Mesh: an editor, and the install command in a terminal */
.editor {
  position: absolute;
  top: 56px;
  left: 40px;
  right: 40px;
  bottom: -1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #0b0d0d;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.7);
}
.editor__bar,
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.editor__bar i,
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.13); }
.editor__bar span,
.terminal__bar span { margin-left: 8px; }
.editor__body {
  display: flex;
  padding: 18px 0;
  font-family: var(--font-mono);
  /* the longest line is 46 characters: shrink to fit narrow stages */
  font-size: clamp(9.5px, (100cqi - 160px) / 28, 13.5px);
  line-height: 1.8;
}
.editor__body pre { margin: 0; font: inherit; }
.editor__gutter { flex: none; width: 4.2em; padding-right: 1.6em; text-align: right; color: rgba(255, 255, 255, 0.2); user-select: none; }
.editor__code { color: #e6e8e4; white-space: pre; }
.editor .k { color: var(--mesh-a); }
.editor .t { color: #9cc6ff; }
.editor .n { color: #f0c674; }
.editor .f { color: #fff; }

.terminal {
  position: absolute;
  right: 24px;
  bottom: 32px;
  width: min(66%, 440px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(16, 19, 19, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 40px 70px -24px rgba(0, 0, 0, 0.8);
}
.terminal__line {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: clamp(9px, (66cqi - 60px) / 30, 12.5px);
  white-space: nowrap;
  overflow-x: auto;
}
.terminal__line span { color: var(--mesh-a); user-select: none; }

/* Incant: the native game window, with the editor's agent panel over its corner */
.game-window {
  position: absolute;
  top: 56px;
  left: 40px;
  width: calc(100% - 128px);
  height: auto;
  /* the capture has white outside its ~36px window corners (at 1280px wide);
     clip a little inside them at any size: 3.2% of the width, 4% of the height */
  border-radius: 3.2% / 4%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 50px 90px -30px rgba(0, 0, 0, 0.7), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
}
.agent-panel {
  position: absolute;
  right: 28px;
  bottom: -48px;
  width: 42%;
  max-width: 272px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 40px 70px -24px rgba(0, 0, 0, 0.85);
}

.catalog__note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: clamp(72px, 8vw, 110px);
  font-size: 15px;
  color: var(--text-2);
}

@media (max-width: 1000px) {
  .product {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "rule" "intro" "stage" "details";
  }
  .product__stage { min-height: 0; height: clamp(440px, 66vw, 580px); margin-top: 36px; }
  /* the editor sets the stage's height, so the install terminal only ever covers its empty lines */
  .product__stage.stage--code { height: auto; }
  .editor { position: relative; inset: auto; margin: 56px 40px 0; }
  .product__details { padding-top: 32px; }
  .product__desc { max-width: 60ch; }
}

@media (max-width: 640px) {
  .product__rule { gap: 12px; margin-bottom: 26px; font-size: 11px; }
  .product__icon { width: 44px; height: 44px; border-radius: 11px; }
  .product__name { margin-top: 22px; font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .product__stage { height: 480px; border-radius: 20px; margin-top: 28px; }
  .phone { top: 40px; width: 264px; margin-left: -132px; border-radius: 50px; }
  .phone__screen { border-radius: 39px; }
  .phone__status { height: 40px; font-size: 13px; padding: 2px 22px 0 30px; }
  .phone__island { width: 76px; height: 23px; }
  /* the window sets the stage's height and always runs past its bottom edge */
  .product__stage.stage--desktop { height: auto; }
  .app-window { position: relative; top: auto; left: auto; translate: none; width: 88%; margin: 32px auto -56px; }
  .editor { margin: 36px 16px 0; }
  .editor__body { font-size: clamp(9px, (100cqi - 70px) / 29, 13.5px); }
  .editor__gutter { width: 3.2em; padding-right: 1.2em; }
  .terminal { left: 8px; right: 28px; bottom: 24px; width: auto; }
  .terminal__line { font-size: clamp(9px, (100cqi - 90px) / 30, 12.5px); }
  .product__stage.stage--engine { height: calc(156px + (100vw - 64px) * 0.8); }
  .game-window { top: 36px; left: 16px; width: calc(100% - 32px); }
  .agent-panel { right: 16px; bottom: -64px; width: 56%; }
}

/* ---------- Lab: a ledger of where each project stands ---------- */
.ledger__head,
.ledger__row {
  display: grid;
  grid-template-columns: var(--grid);
  column-gap: var(--col-gap);
}
.ledger__head > :nth-child(1), .ledger__project { grid-column: 1 / span 3; }
.ledger__head > :nth-child(2), .ledger__note { grid-column: 4 / span 5; }
.ledger__head > :nth-child(3), .stages { grid-column: 9 / -1; }
.ledger__head {
  padding-bottom: 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ledger__rows { display: grid; gap: clamp(40px, 4.5vw, 56px); margin: 12px 0 0; padding: 0; list-style: none; }
.ledger__row { align-items: start; }
.ledger__project { display: flex; align-items: center; gap: 14px; }
.ledger__project img { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.ledger__project strong { display: block; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.ledger__project .mono { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ledger__note h3 { font-size: 1.2rem; letter-spacing: -0.025em; line-height: 1.3; }
.ledger__note p { max-width: 52ch; margin-top: 8px; font-size: 15px; color: var(--text-2); }

/* Spark → Prototype → Beta → Shipped: reached steps filled, the current one in lime */
.stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}
.stages span { display: flex; align-items: center; gap: 8px; }
.stages span::before { content: ''; flex: none; width: 6px; height: 6px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%; }
.stages .is-done { color: var(--text-3); }
.stages .is-done::before { border-color: var(--text-3); background: var(--text-3); }
.stages .is-now { color: var(--text); }
.stages .is-now::before { border-color: var(--signal); background: var(--signal); }

/* ---------- Approach ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--col-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.process__step { position: relative; }
.process__num { font-size: 12px; color: var(--text-3); }
.process__step h3 { margin-top: 20px; font-size: clamp(1.6rem, 2.3vw, 2.1rem); letter-spacing: -0.045em; line-height: 1.05; }
.process__step p { margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* ---------- Principles ---------- */
.tenets { display: grid; gap: clamp(40px, 4.5vw, 60px); margin: 0; padding: 0; list-style: none; }
.tenet {
  display: grid;
  grid-template-columns: var(--grid);
  column-gap: var(--col-gap);
  align-items: baseline;
}
.tenet__num { grid-column: 1 / span 3; font-size: 12px; color: var(--text-3); }
.tenet h3 { grid-column: 4 / span 4; }
.tenet p { grid-column: 8 / -1; }
.tenet h3 { font-size: clamp(1.5rem, 2.5vw, 2.15rem); letter-spacing: -0.045em; line-height: 1.08; }
.tenet p { max-width: 46ch; font-size: 15.5px; color: var(--text-2); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(110px, 13vw, 180px); }
.contact .section-head { margin-bottom: clamp(48px, 6vw, 80px); }

.mailbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.mailbox__link {
  min-width: 0;
  font-size: clamp(2rem, 6.4vw, 5.9rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) left 100% / 0 2px no-repeat;
  transition: background-size 0.6s var(--ease-out);
}
.mailbox__link:hover { background-size: 100% 2px; }
.mailbox__copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
}
.mailbox__copy:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.05); }
.mailbox__copy svg { width: 16px; height: 16px; }
.mailbox__copy.is-copied { border-color: var(--signal); color: var(--signal); }

.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--col-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.routes a {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 26px 40px 28px 0;
  text-decoration: none;
}
.routes .mono { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.routes strong { font-size: 1.1rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text-2); transition: color 0.2s; }
.routes a:hover strong { color: var(--text); }
.routes svg { position: absolute; top: 26px; right: 0; width: 16px; height: 16px; color: var(--text-3); transition: transform 0.35s var(--ease-out), color 0.2s; }
.routes a:hover svg { transform: translate(2px, -2px); color: var(--text); }

/* ---------- Footer ---------- */
.footer { position: relative; padding: 24px 0 28px; }
.footer__top {
  display: grid;
  grid-template-columns: var(--grid);
  column-gap: var(--col-gap);
  row-gap: 48px;
}
.footer__brand { grid-column: 1 / span 3; }
.footer__cols { grid-column: 4 / -1; }
.footer__brand p { max-width: 30ch; margin-top: 16px; color: var(--text-3); font-size: 14px; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px var(--col-gap); }
.footer__cols div { display: grid; align-content: start; gap: 10px; }
.footer__cols p { margin-bottom: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.footer__cols a { color: var(--text-2); font-size: 14.5px; text-decoration: none; transition: color 0.2s; }
.footer__cols a:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 80px;
  font-size: 12px;
  color: var(--text-3);
}
.footer__top-link { text-decoration: none; transition: color 0.2s; }
.footer__top-link:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(20, 22, 26, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 14px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .ledger__note { grid-column: 4 / span 4; }
  .stages { grid-column: 8 / -1; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 64px; }

  .nav__links { display: none; }
  .nav__toggle { display: block; }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 8px;
    padding-top: calc(var(--nav-h) + 40px);
    padding-bottom: 48px;
  }
  .hero__stage {
    order: -1;
    justify-self: center;
    width: min(62vw, 320px);
    margin-bottom: 40px;
  }
  .hero__index-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__index a:nth-child(3) { padding-left: 0; }

  .section-head,
  .manifesto__inner,
  .footer__top { display: block; }
  .section-head .section-label,
  .manifesto__inner > .section-label { padding-top: 0; margin-bottom: 28px; }
  .footer__cols { margin-top: 48px; }

  .ledger__head { display: none; }
  .ledger__row { grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
  .ledger__row > * { grid-column: 1 / -1; }
  .stages { max-width: 420px; }

  .tenet { grid-template-columns: 48px minmax(0, 1fr); row-gap: 10px; }
  .tenet__num { grid-column: 1; }
  .tenet h3, .tenet p { grid-column: 2; }

  .routes { grid-template-columns: minmax(0, 1fr); }

  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  /* balance picks odd breaks at this size ("On the / bench right now.") */
  .section-head__title { text-wrap: pretty; }
  .hero__title { font-size: clamp(2.35rem, 10.6vw, 3.4rem); }
  .hero__actions .btn { flex: 1 1 auto; }
  .nav__cta { display: none; }
  .hero__index a { padding: 16px 12px 18px 0; column-gap: 10px; }
  .hero__index a + a { padding-left: 12px; }
  .hero__index a:nth-child(3) { padding-left: 0; }
  .hero__index a > span:last-child { font-size: 12px; }

  .process { grid-template-columns: minmax(0, 1fr); row-gap: 44px; }
  .process__step h3 { margin-top: 16px; }

  .mailbox { flex-direction: column; align-items: flex-start; }

  .footer__bottom { flex-direction: column; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .hero__stage { max-width: 420px; }
  .hero__title { font-size: clamp(2.6rem, 5.4vw, 5rem); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-intro], .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}

/* ==========================================================================
   Secondary pages (legal, 404)
   ========================================================================== */
.page-glow {
  /* full-bleed, so the light never shows the text column's edges */
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 520px;
  transform: translateX(-50%);
  z-index: -1;
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(var(--signal-rgb), 0.08), transparent 70%),
    radial-gradient(700px 320px at 85% 0%, rgba(91, 140, 255, 0.08), transparent 70%);
  pointer-events: none;
}

.doc {
  position: relative;
  isolation: isolate;
  max-width: calc(760px + var(--gutter) * 2);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 96px) var(--gutter) 120px;
}
.doc__title {
  margin-top: 22px;
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.doc__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--text-2); letter-spacing: -0.02em; }
.doc__meta { margin-top: 22px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.doc__lede { margin-top: 28px; font-size: 1.15rem; color: var(--text-2); }
.doc__note {
  margin-top: 32px;
  padding: 16px 20px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  font-size: 14.5px;
  color: var(--text-2);
}
.doc__note strong { color: var(--text); font-weight: 500; }
.doc__toc {
  display: grid;
  gap: 6px;
  margin: 40px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  list-style: none;
  counter-reset: toc;
}
.doc__toc li { counter-increment: toc; font-size: 15px; }
.doc__toc a { display: flex; gap: 12px; color: var(--text-2); text-decoration: none; transition: color 0.2s; }
.doc__toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); padding-top: 3px; }
.doc__toc a:hover { color: var(--text); }
.doc h2 {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.doc h3 { margin-top: 28px; font-size: 1.1rem; letter-spacing: -0.02em; }
.doc p, .doc li { color: var(--text-2); font-size: 16.5px; line-height: 1.75; }
.doc p + p { margin-top: 14px; }
.doc h2 + p, .doc h3 + p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 0; list-style: none; }
.doc ul li { position: relative; padding-left: 22px; }
.doc ul li + li { margin-top: 8px; }
.doc ul li::before { content: ''; position: absolute; left: 4px; top: 0.75em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); }
.doc strong { color: var(--text); font-weight: 500; }
.doc a:not(.btn) { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.doc a:not(.btn):hover { text-decoration-color: var(--text); }

.lost {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 80px;
  text-align: center;
  overflow: hidden;
}
.lost__code {
  font-size: clamp(7rem, 26vw, 18rem);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.85;
  background: linear-gradient(180deg, var(--text) 0%, rgba(255, 255, 255, 0.06) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lost__title { margin-top: 18px; font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -0.04em; line-height: 1.15; }
.lost__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--text-2); }
.lost p { max-width: 40ch; margin: 16px auto 0; color: var(--text-2); }
.lost .hero__actions { justify-content: center; }
.lost__mark { width: 44px; height: 44px; margin: 0 auto 28px; color: var(--signal); animation: drift 6s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(-8px) rotate(12deg); } }

.footer--slim { padding-top: 0; }
.footer--slim .footer__bottom { margin-top: 0; }

/* ==========================================================================
   Links
   ========================================================================== */
.text-link {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--text); }
.text-link::after { content: ' \2197'; }
