/* Chemmy — website
   The same materials as the app: graphite, a dotted canvas, and one accent,
   the pink phenolphthalein turns in base. Instrument Serif speaks, Instrument
   Sans explains, DM Mono counts. */

@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/assets/fonts/dm-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/assets/fonts/dm-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #0b0b0e;
  --bg-raised: #111115;
  --panel: #17171c;
  --line: rgba(255, 255, 255, 0.085);
  --line-soft: rgba(255, 255, 255, 0.055);
  --raised: rgba(255, 255, 255, 0.06);
  --text: #ededf2;
  --text-2: #a6a6b3;
  --text-3: #6f6f7c;
  --accent: #ff4fa3;
  --accent-ink: #26000f;
  --accent-soft: rgba(255, 79, 163, 0.15);
  --dot: rgba(255, 255, 255, 0.075);

  --sans: 'Instrument Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --label: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --max: 1180px;
  --gutter: clamp(20px, 4.5vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.02;
  text-wrap: balance;
}

h1 em,
h2 em {
  font-style: italic;
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.42em;
  margin: 0 0.08em;
  border-radius: 0.36em;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -1.5px 0 rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1;
  vertical-align: 0.06em;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--text);
}

p code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--raised);
}

.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.formula sub,
.formula sup,
.w-formula sub,
.w-formula sup,
.w-layer sub {
  font-size: 0.62em;
  line-height: 0;
}

.formula sub,
.w-formula sub,
.w-layer sub {
  vertical-align: -0.22em;
}

.formula sup,
.w-formula sup {
  vertical-align: 0.55em;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 var(--gutter);
  background: rgba(11, 11, 14, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav nav a,
.foot nav a {
  color: var(--text-2);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s;
}

.nav nav a:hover,
.foot nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-weight: 620;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s, background 0.18s, box-shadow 0.18s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 36px -10px rgba(255, 79, 163, 0.6);
}

.btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 44px -10px rgba(255, 79, 163, 0.72);
}

.btn.small {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14.5px;
}

.btn.large {
  height: 60px;
  padding: 0 30px;
  border-radius: 17px;
  font-size: 18px;
}

.btn.ghost {
  box-shadow: inset 0 0 0 1px var(--line);
  background: transparent;
}

.nav .btn[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(56px, 9vh, 112px) var(--gutter) 0;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
}

/* The canvas the whole page sits on. */
.hero::before {
  content: '';
  position: absolute;
  inset: -64px -50vw 0;
  z-index: -1;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 30%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 30%, #000 20%, transparent 78%);
}

.eyebrow {
  display: inline-flex;
  gap: 0.6em;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow span {
  color: var(--text-3);
}

.hero h1 {
  max-width: 13.5ch;
  font-size: clamp(3rem, 8.4vw, 7.1rem);
  line-height: 0.96;
}

.lede {
  max-width: 60ch;
  margin-top: 30px;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.5;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 36px;
}

.cta-meta {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.cta-meta i {
  font-style: normal;
  margin: 0 0.35em;
  opacity: 0.6;
}

.cta-meta a {
  color: var(--text-2);
}

/* ── The app window ─────────────────────────────────────────────────────── */

.window-wrap {
  position: relative;
  margin-top: clamp(48px, 8vh, 88px);
  container-type: inline-size;
}

/* A pink bloom behind the window, like a lamp left on. */
.window-wrap::before {
  content: '';
  position: absolute;
  inset: 4% 6% 12%;
  z-index: -1;
  background: radial-gradient(60% 60% at 62% 44%, rgba(255, 79, 163, 0.34), transparent 70%),
    radial-gradient(50% 50% at 24% 70%, rgba(134, 166, 255, 0.16), transparent 70%);
  filter: blur(70px);
}

.window-wrap figcaption {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.window {
  position: relative;
  aspect-ratio: 1389 / 868;
  border-radius: 1.2em;
  background: #0d0d10;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  font-size: clamp(5px, 0.868cqw, 12.5px);
  line-height: 1.35;
  user-select: none;
  animation: window-in 1s var(--ease) both;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
}

.window .ico {
  width: 1.6em;
  height: 1.6em;
}

.w-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1em;
  height: 4.16em;
  padding: 0 1em 0 1.5em;
  color: var(--text-2);
}

.w-lights {
  display: flex;
  gap: 0.64em;
  margin-right: 1.6em;
}

.w-lights i {
  width: 0.96em;
  height: 0.96em;
  border-radius: 50%;
  background: #ff5f57;
}

.w-lights i:nth-child(2) {
  background: #febc2e;
}

.w-lights i:nth-child(3) {
  background: #28c840;
}

.w-title {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin-right: auto;
  color: var(--text);
  font-size: 1.04em;
  font-weight: 620;
}

.w-title svg {
  width: 1.4em;
  height: 1.4em;
}

.w-search {
  display: inline-flex;
  align-items: center;
  gap: 0.64em;
  height: 2.4em;
  padding: 0 0.6em 0 0.8em;
  border-radius: 0.72em;
  background: rgba(24, 24, 29, 0.84);
  box-shadow: inset 0 0 0 0.5px var(--line);
}

.w-search .ico {
  width: 1.2em;
  height: 1.2em;
}

.w-search kbd,
.palette kbd {
  font-size: 0.86em;
  box-shadow: inset 0 0 0 0.5px var(--line);
}

.w-zoom {
  font-family: var(--mono);
  font-size: 0.96em;
}

.w-export {
  display: inline-flex;
  align-items: center;
  height: 2.4em;
  padding: 0 0.96em;
  border-radius: 0.72em;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 620;
}

.w-left,
.w-right {
  position: absolute;
  top: 4.16em;
  bottom: 0.8em;
  z-index: 2;
  border-radius: 1.28em;
  background: rgba(24, 24, 29, 0.86);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.6), 0 1.1em 3.5em rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px var(--line);
  overflow: hidden;
}

.w-left {
  left: 0.8em;
  width: 19.84em;
}

.w-right {
  right: 0.8em;
  width: 21.12em;
  padding: 1.12em;
}

.w-tabs {
  display: flex;
  gap: 0.16em;
  padding: 0.64em;
  border-bottom: 0.5px solid var(--line-soft);
  color: var(--text-3);
  font-weight: 600;
}

.w-tabs span {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 2.4em;
  border-radius: 0.72em;
}

.w-tabs .on {
  background: var(--raised);
  color: var(--text);
}

.w-tabs .ico,
.w-layer .ico {
  width: 1.28em;
  height: 1.28em;
}

.w-layer {
  display: flex;
  align-items: center;
  gap: 0.72em;
  height: 2.56em;
  margin: 0.48em;
  padding: 0 0.72em;
  border-radius: 0.56em;
  font-weight: 540;
}

.w-layer.on {
  background: var(--accent-soft);
}

.w-layer .ico {
  color: var(--accent);
}

.w-layer em {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.88em;
  font-style: normal;
  color: var(--text-3);
}

.w-canvas {
  position: absolute;
  inset: 0;
  padding: 6.4em 24em 9.6em 22.6em;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.5px);
  background-size: 1.92em 1.92em;
}

.w-canvas .fig {
  width: 100%;
  height: 100%;
}

.w-eyebrow {
  display: flex;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 0.84em;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.w-eyebrow span {
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 500;
}

.w-formula {
  margin: 0.22em 0 0.4em;
  font-family: var(--serif);
  font-size: 2.64em;
  line-height: 1.12;
}

.w-facts {
  display: grid;
  gap: 0.48em;
}

.w-facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8em;
}

.w-facts dt {
  color: var(--text-2);
}

.w-facts dd {
  font-family: var(--mono);
  font-size: 0.96em;
}

.w-facts small {
  font-family: var(--sans);
  font-size: 0.9em;
  color: var(--text-3);
}

.w-facts.split {
  margin-top: 0.96em;
  padding-top: 0.96em;
  border-top: 0.5px solid var(--line-soft);
}

.w-bar-mix {
  display: flex;
  gap: 2px;
  height: 0.4em;
  margin-top: 0.96em;
}

.w-bar-mix i {
  min-width: 3px;
  border-radius: 3px;
}

.w-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 0.8em;
  margin-top: 0.56em;
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--text-2);
}

.w-mix b {
  font-family: var(--sans);
  font-weight: 620;
  color: var(--text);
}

.w-smiles {
  display: flex;
  align-items: center;
  gap: 0.64em;
  height: 2.56em;
  margin-top: 0.96em;
  padding: 0 0.8em;
  border-radius: 0.72em;
  background: var(--raised);
}

.w-smiles span {
  font-size: 0.8em;
  font-weight: 650;
  letter-spacing: 0.07em;
  color: var(--text-3);
}

.w-smiles code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92em;
}

.w-dock {
  position: absolute;
  bottom: 1.44em;
  left: calc(21.44em + (100% - 44.2em) / 2);
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.16em;
  padding: 0.4em;
  border-radius: 1.28em;
  background: rgba(24, 24, 29, 0.86);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.6), 0 1.1em 3.5em rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px var(--line);
  color: var(--text-2);
}

.w-dock span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.04em;
  height: 3.04em;
  border-radius: 0.88em;
}

.w-dock .on {
  background: var(--accent);
  color: var(--accent-ink);
}

.w-dock b {
  width: 1px;
  height: 1.6em;
  margin: 0 0.4em;
  background: var(--line);
}

.w-el {
  font-size: 1.2em;
  font-weight: 640;
}

/* Narrow: the panels step aside and the canvas takes the stage. */
@container (max-width: 720px) {
  .window {
    aspect-ratio: 4 / 3.3;
    font-size: clamp(6px, 1.72cqw, 11px);
  }
  .w-left,
  .w-right,
  .w-search,
  .w-zoom {
    display: none;
  }
  .w-canvas {
    padding: 5.6em 2em 7.6em;
  }
  .w-dock {
    left: 50%;
  }
}

/* ── Figures drawn by the renderer ──────────────────────────────────────── */

.fig text {
  font-family: var(--label);
}

.js .fig-draw .d {
  stroke-dasharray: var(--l);
  stroke-dashoffset: var(--l);
}

.js .fig-draw .f {
  opacity: 0;
}

.js .window .fig-draw .d,
.js .in .fig-draw .d {
  animation: draw 0.42s var(--ease) forwards;
  animation-delay: calc(var(--i) * 20ms + var(--wait, 0.2s));
}

.js .window .fig-draw .f,
.js .in .fig-draw .f {
  animation: fade 0.5s ease forwards;
  animation-delay: calc(var(--i) * 20ms + var(--wait, 0.2s) + 0.1s);
}

.window .fig-draw {
  --wait: 0.75s;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade {
  to {
    opacity: 1;
  }
}

/* The inspector fills in once the structure is on the canvas. */
.js .w-right > * {
  animation: rise 0.6s var(--ease) both;
  animation-delay: 1.5s;
}

.js .w-right > :nth-child(n + 3) {
  animation-delay: 1.62s;
}

.js .w-right > :nth-child(n + 6) {
  animation-delay: 1.74s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.6em);
  }
}

/* ── At a glance ────────────────────────────────────────────────────────── */

.glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: clamp(72px, 12vh, 140px) auto 0;
  padding: 0 var(--gutter);
}

.glance div {
  padding: 6px 28px 6px 0;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.glance b {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.6vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.glance div:last-child b {
  color: var(--accent);
}

.glance span {
  display: block;
  margin-top: 12px;
  max-width: 22ch;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.4;
}

/* ── Features ───────────────────────────────────────────────────────────── */

.feature,
.keys,
.files {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: clamp(96px, 17vh, 190px) auto 0;
  padding: 0 var(--gutter);
}

.feature.flip .copy {
  order: 2;
}

.kicker {
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.copy h2,
.dl-notes h2 {
  font-size: clamp(2.3rem, 4.5vw, 3.9rem);
}

.copy > p:not(.kicker) {
  margin-top: 22px;
  color: var(--text-2);
  max-width: 46ch;
}

.points {
  margin-top: 26px;
  display: grid;
  gap: 11px;
  max-width: 46ch;
}

.points li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.45;
}

/* A short bond for a bullet. */
.points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 14px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(-30deg);
  transform-origin: left center;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 6 / 5;
  border-radius: 30px;
  background-color: var(--bg-raised);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.6px);
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 110%, rgba(255, 79, 163, 0.09), transparent 70%);
  pointer-events: none;
}

.stage > .fig {
  width: 76%;
  max-height: 72%;
}

.stage > .fig-ghost {
  width: 62%;
}

/* The ring that is offered, then taken. */
.ghost-new {
  animation: ghost 5.2s ease-in-out infinite;
}

.ghost-new line {
  animation: ghost-ink 5.2s ease-in-out infinite;
}

.ghost-cursor {
  fill: #fff;
  stroke: #0b0b0e;
  stroke-width: 1;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: 0 0;
  animation: ghost-click 5.2s ease-in-out infinite;
}

@keyframes ghost {
  0%,
  8% {
    opacity: 0;
  }
  16%,
  50% {
    opacity: 0.6;
  }
  56%,
  90% {
    opacity: 1;
  }
  98%,
  100% {
    opacity: 0;
  }
}

@keyframes ghost-ink {
  0%,
  52% {
    stroke: #ff4fa3;
  }
  57%,
  100% {
    stroke: #ededf2;
  }
}

@keyframes ghost-click {
  0%,
  49%,
  60%,
  100% {
    scale: 1;
  }
  54% {
    scale: 0.8;
  }
}

/* Palette */
.palette {
  position: relative;
  z-index: 1;
  width: min(86%, 470px);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 34px 80px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  font-size: 15px;
}

.p-input {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 17px;
}

.p-input .ico {
  width: 18px;
  height: 18px;
}

.p-input [data-typed] {
  color: var(--text);
  white-space: pre;
}

.caret {
  width: 1.5px;
  height: 20px;
  margin-left: -9px;
  background: var(--accent);
  animation: blink 1.05s steps(2, jump-none) infinite;
}

.p-input kbd {
  margin-left: auto;
}

@keyframes blink {
  to {
    opacity: 0;
  }
}

.p-result {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  background: var(--accent-soft);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

.palette:not(.found) .p-result {
  opacity: 0;
  transform: translateY(6px);
}

.p-thumb {
  flex: none;
  width: 104px;
  height: 92px;
  display: grid;
  place-items: center;
}

.p-thumb .fig {
  max-height: 92px;
}

.p-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.p-text strong {
  font-weight: 600;
}

.p-text span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
}

/* Inspector card */
.card {
  position: relative;
  z-index: 1;
  width: min(82%, 330px);
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), 0 34px 80px -20px rgba(0, 0, 0, 0.8);
  font-size: 13.5px;
  line-height: 1.35;
}

.card-formula {
  margin: 6px 0 12px;
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1.08;
}

/* ── Keyboard ───────────────────────────────────────────────────────────── */

.try {
  font-family: var(--mono);
  font-size: 13px !important;
  color: var(--text-3) !important;
}

.keys-demo {
  display: grid;
  gap: 18px;
}

.stage.small {
  aspect-ratio: 16 / 8;
}

.stage.small .fig {
  width: 46%;
  max-height: 64%;
  z-index: 1;
}

.keys-readout {
  position: absolute;
  left: 22px;
  bottom: 18px;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
}

.keys-readout [data-keys-weight] {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
}

.keycaps {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
}

.keycaps button {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(#202027, #18181d);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 rgba(0, 0, 0, 0.45), 0 2px 0 rgba(0, 0, 0, 0.5);
  color: var(--text);
  font: 600 clamp(15px, 1.6vw, 19px) var(--sans);
  cursor: pointer;
  transition: transform 0.09s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.keycaps button small {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font: 500 9.5px var(--mono);
  color: var(--text-3);
}

.keycaps button:hover {
  background: linear-gradient(#26262e, #1c1c22);
}

.keycaps button.on {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 26px -4px rgba(255, 79, 163, 0.7);
}

.keycaps button.on small {
  color: rgba(38, 0, 15, 0.6);
}

/* ── Files ──────────────────────────────────────────────────────────────── */

.formats {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.formats > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: baseline;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.formats h3 {
  font: 400 12.5px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.formats p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.formats p span {
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 13.5px;
}

.formats .plain {
  display: block;
  color: var(--text-2);
  font-size: 15.5px;
}

/* ── Screenshots ────────────────────────────────────────────────────────── */

.shots {
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: clamp(96px, 17vh, 190px) auto 0;
  padding: 0 var(--gutter);
}

.shot-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.shot-row img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}

.shot-row figcaption {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ── Closing ────────────────────────────────────────────────────────────── */

.closing {
  position: relative;
  margin: clamp(110px, 20vh, 220px) auto 0;
  padding: 0 var(--gutter) clamp(90px, 16vh, 170px);
  text-align: center;
}

.closing::before {
  content: '';
  position: absolute;
  inset: -20% 0 0;
  z-index: -1;
  background: radial-gradient(42% 52% at 50% 46%, rgba(255, 79, 163, 0.17), transparent 72%);
}

.closing h2 {
  font-size: clamp(3.4rem, 11vw, 9rem);
  line-height: 0.94;
}

.closing > p {
  max-width: 44ch;
  margin: 26px auto 0;
  color: var(--text-2);
  font-size: 1.12rem;
}

.closing .cta {
  flex-direction: column;
  gap: 16px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 14px;
}

.foot p {
  margin-right: auto;
}

.foot p a {
  color: var(--text-2);
  text-underline-offset: 3px;
}

.foot nav {
  display: flex;
  gap: 22px;
}

/* ── Download page ──────────────────────────────────────────────────────── */

.dl-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(48px, 9vh, 104px) var(--gutter) 0;
  text-align: center;
}

.dl-hero::before {
  content: '';
  position: absolute;
  inset: -64px 0 -30%;
  z-index: -1;
  background: radial-gradient(38% 46% at 50% 26%, rgba(255, 79, 163, 0.2), transparent 72%),
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.6px);
  background-size: auto, 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 34%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 62% 70% at 50% 34%, #000 25%, transparent 78%);
}

.dl-icon {
  width: 112px;
  height: 112px;
  margin-bottom: 20px;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.6));
  animation: window-in 0.9s var(--ease) both;
}

.dl-hero h1 {
  font-size: clamp(3.2rem, 9vw, 6.6rem);
}

.dl-hero .lede {
  max-width: 46ch;
  margin-top: 22px;
}

.dl-hero .cta {
  flex-direction: column;
  gap: 16px;
}

.dl-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  max-width: calc(1060px + var(--gutter) * 2);
  margin: clamp(64px, 11vh, 120px) auto 0;
  padding: 0 var(--gutter);
  align-items: start;
}

.dl-side {
  display: grid;
  gap: 20px;
}

.dl-card {
  padding: clamp(22px, 3vw, 34px);
  border-radius: 24px;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line);
}

.dl-card > p:not(.kicker) {
  color: var(--text-2);
  font-size: 15.5px;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 26px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 58px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -3px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 15px var(--mono);
  color: var(--accent);
}

.steps h3 {
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.steps p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15.5px;
}

.steps p strong {
  color: var(--text);
  font-weight: 600;
}

.quiet {
  color: var(--text-3) !important;
  font-size: 14px !important;
}

details {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 560;
}

summary:hover {
  color: var(--text);
}

details p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
}

pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #08080a;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  overflow-x: auto;
}

pre code {
  font-size: 13px;
  color: var(--text-2);
}

.hash {
  margin: 12px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #08080a;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-family: var(--mono);
  font-size: 13px !important;
  line-height: 1.6;
  color: var(--text) !important;
  overflow-wrap: anywhere;
}

.dl-card .btn + .quiet {
  margin-top: 18px;
}

.reqs {
  display: grid;
}

.reqs > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}

.reqs > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.reqs dt {
  color: var(--text-3);
}

.reqs dd {
  text-align: right;
}

.dl-notes {
  max-width: calc(1060px + var(--gutter) * 2);
  margin: clamp(80px, 14vh, 150px) auto clamp(80px, 14vh, 150px);
  padding: 0 var(--gutter);
}

.notes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 44px;
}

.notes h3 {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font: 400 12.5px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.notes ul {
  display: grid;
  gap: 10px;
}

.notes li {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.4;
}

.page-missing main {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.page-missing .closing {
  margin-top: 0;
}

/* ── Arriving ───────────────────────────────────────────────────────────── */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.9s var(--ease);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.hero .eyebrow,
.hero h1,
.hero .lede,
.hero .cta,
.dl-hero .eyebrow,
.dl-hero h1,
.dl-hero .lede,
.dl-hero .cta {
  animation: rise-in 0.9s var(--ease) both;
}

.hero h1,
.dl-hero h1 {
  animation-delay: 0.06s;
}

.hero .lede,
.dl-hero .lede {
  animation-delay: 0.14s;
}

.hero .cta,
.dl-hero .cta {
  animation-delay: 0.22s;
}

.window {
  animation-delay: 0.3s;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* ── Smaller screens ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .feature,
  .keys,
  .files,
  .dl-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature.flip .copy {
    order: 0;
  }

  .glance {
    grid-template-columns: repeat(2, 1fr);
    gap: 34px 0;
  }

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

  .shot-row {
    grid-template-columns: repeat(3, 82%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 12px;
    scrollbar-width: none;
  }

  .shot-row figure {
    scroll-snap-align: center;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .nav nav {
    display: none;
  }

  .nav .btn {
    margin-left: auto;
  }

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

  .hero .btn.primary {
    width: 100%;
  }

  .stage {
    aspect-ratio: 1;
    border-radius: 22px;
  }

  .stage.small {
    aspect-ratio: 4 / 3;
  }

  .keycaps {
    grid-template-columns: repeat(5, 1fr);
  }

  .formats > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .notes {
    grid-template-columns: 1fr;
  }

  .steps li {
    padding-left: 50px;
  }

  .foot p {
    margin-right: 0;
    width: 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal,
  .js .fig-draw .f {
    opacity: 1;
    transform: none;
  }

  .js .fig-draw .d {
    stroke-dashoffset: 0;
  }

  .ghost-new {
    opacity: 0.6;
  }
}
