/*
 * Baruch product page. Colours and type follow the app (packages/app/src/renderer/styles/tokens.css)
 * and the approved boards in docs/design: leaf ground, white surfaces, one green for actions,
 * brass only for eyebrows and Roman numerals, Cormorant Garamond 600 for titles.
 */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-latin-ext-600-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-title: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ground: #f4f5f1;
  --surface: #ffffff;
  --sunken: #e8ebe5;
  --ink: #121a16;
  --text-secondary: #3c4942;
  --text-tertiary: #55625a;
  --rule: #c9cfc6;
  --rule-soft: #e1e5de;
  --rule-strong: var(--ink);
  --border-control: #b9c1b7;
  --green: #0f5c45;
  --green-hover: #0c4d3a;
  --green-text: #0f5c45;
  --text-on-green: #ffffff;
  --brass: #8a6a1f;
  --seal: #0f5c45;
  --hover: rgb(18 26 22 / 5%);

  --gutter: clamp(16px, 4vw, 48px);
  --page: 1120px;
  --measure: 62ch;
  --radius: 6px;
  --radius-large: 8px;
  --duration: 120ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-slow: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 30px 60px -36px rgb(18 26 22 / 28%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1613;
    --surface: #18211d;
    --sunken: #141c18;
    --ink: #e4eae5;
    --text-secondary: #b4c0b8;
    --text-tertiary: #919e96;
    --rule: #2c3732;
    --rule-soft: #1f2925;
    --rule-strong: #8a968f;
    --border-control: #3a4640;
    --green: #5fb896;
    --green-hover: #74c6a6;
    --green-text: #6fc2a0;
    --text-on-green: #0e1a15;
    --brass: #c9a961;
    --seal: #c9a961;
    --hover: rgb(228 234 229 / 6%);
    --shadow: 0 30px 60px -36px rgb(0 0 0 / 70%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration: 0ms;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code {
  font: 400 0.9em/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}

kbd {
  font: inherit;
  font-weight: 600;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.skip:focus {
  top: 12px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ground) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.site-nav a[href='#download'] {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
}

.site-nav a[href='#download']:hover {
  border-color: var(--text-tertiary);
  text-decoration: none;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  color: var(--seal);
  flex: none;
}

.wordmark {
  font: 600 20px/1 var(--font-title);
  letter-spacing: 0.14em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
}

.lang [aria-current] {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 440px) {
  .lang [aria-current],
  .lang .dot {
    display: none;
  }
}

/* Shared pieces */

.eyebrow {
  margin: 0 0 14px;
  font: 600 12px/16px var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}

h2 {
  margin: 0;
  font: 600 clamp(32px, 3.8vw, 44px) / 1.05 var(--font-title);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.lede {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font: 600 16px/1.2 var(--font);
  text-decoration: none;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.button:hover {
  text-decoration: none;
}

.button-icon {
  flex: none;
  margin-right: 9px;
}

.button-primary {
  background: var(--green);
  color: var(--text-on-green);
  border: 1px solid var(--green);
}

.button-primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
}

.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-control);
}

.button-secondary:hover {
  border-color: var(--text-tertiary);
}

/* Side by side, a button keeps its label on one line and the row wraps instead. */
@media (min-width: 481px) {
  .button {
    flex: none;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .buttons {
    flex-direction: column;
    align-self: stretch;
  }
}

.release-note {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--text-tertiary);
}

/* The Windows line sits right under the Mac one. */
.release-note-win {
  margin-top: 4px;
}

/* A screenshot in a plain window: a bar with three rings, then the picture. */

.window {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.window-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  background: var(--sunken);
  border-bottom: 1px solid var(--rule);
}

.window-bar i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--border-control);
  border-radius: 50%;
}

.note {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

/* Hero */

.hero {
  position: relative;
  overflow: clip;
  padding: clamp(56px, 9vw, 120px) 0 clamp(56px, 8vw, 104px);
}

/* The ground is ruled like a page of the record, fading out from the top. */
.hero-rules {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    var(--rule) 43px,
    var(--rule) 44px
  );
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 0%, #000 12%, transparent 74%);
  mask-image: radial-gradient(ellipse 78% 62% at 50% 0%, #000 12%, transparent 74%);
}

.hero .wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-mark {
  width: clamp(64px, 8vw, 88px);
  height: auto;
  color: var(--seal);
}

.hero-mark path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.hero-word {
  margin: 28px 0 0;
  padding-left: 0.14em;
  font: 600 clamp(56px, 13.5vw, 176px) / 0.9 var(--font-title);
  letter-spacing: 0.14em;
}

.hero-word span {
  display: inline-block;
}

h1 {
  margin: 30px 0 0;
  max-width: 26em;
  font: 400 clamp(19px, 2.3vw, 25px) / 1.5 var(--font);
  color: var(--text-secondary);
  text-wrap: balance;
}

.hero .download {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-margin-top: 96px;
}

/* The window lies back and comes upright as it scrolls into view (site.js sets --flat, 0 to 1). */
.hero-stage {
  width: 100%;
  max-width: 1180px;
  margin-top: clamp(56px, 8vw, 96px);
  perspective: 1800px;
}

.hero .window {
  transform-origin: 50% 0;
  transform: rotateX(calc((1 - var(--flat, 1)) * 16deg)) scale(calc(0.9 + var(--flat, 1) * 0.1));
  box-shadow:
    var(--shadow),
    0 90px 140px -80px color-mix(in srgb, var(--green) 55%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-mark path {
    stroke-dasharray: 1;
    animation: mark-draw 1.6s var(--ease-slow) both;
  }

  .hero-word span,
  .hero h1,
  .hero .download,
  .hero-stage,
  .hero .note {
    animation: rise 1s var(--ease-slow) both;
  }

  .hero-word span {
    animation-delay: calc(0.45s + var(--i) * 70ms);
  }

  .hero h1 {
    animation-delay: 1s;
  }

  .hero .download {
    animation-delay: 1.15s;
  }

  .hero-stage,
  .hero .note {
    animation-delay: 1.3s;
  }
}

@keyframes mark-draw {
  0% {
    stroke-dashoffset: 1;
    fill-opacity: 0;
  }

  62% {
    stroke-dashoffset: 0;
    fill-opacity: 0;
  }

  100% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */

.section {
  border-top: 1px solid var(--rule);
  padding: clamp(56px, 8vw, 104px) 0;
}

.section-head {
  margin-bottom: clamp(32px, 5vw, 56px);
}

/* Revealed on scroll. Hidden only when the script is running (html.js). */

html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 1s var(--ease-slow),
    transform 1s var(--ease-slow);
}

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

/* The flow: messages arrive, are written into the record, and go out three ways. */

.flow {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1.3fr) 44px minmax(0, 1.15fr);
}

.flow-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.flow-label {
  margin: 0;
  font: 600 12px/16px var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}

.panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-large);
  padding: 16px;
  min-width: 0;
}

.panel-title {
  margin: 0 0 10px;
  font: 600 13px/18px var(--font);
  color: var(--text-tertiary);
}

.wire {
  position: relative;
  align-self: center;
  height: 1px;
  margin-top: 28px;
  background: var(--rule);
}

.tick {
  position: absolute;
  top: -1px;
  left: 0;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--green);
  opacity: 0;
}

.flow.live .tick.on {
  animation: tick-x 1s var(--ease-slow) both;
}

@keyframes tick-x {
  0% {
    left: 0;
    opacity: 0;
  }

  20%,
  80% {
    opacity: 1;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes tick-y {
  0% {
    top: 0;
    opacity: 0;
  }

  20%,
  80% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--sunken);
}

.msg {
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 12px 9px;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: 2px 10px 10px;
  font-size: 15px;
  line-height: 1.4;
}

.msg b {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-text);
}

.msg time,
.line time {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

.ledger {
  display: flex;
  flex-direction: column;
}

.line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}

.line > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.line strong {
  font-weight: 600;
}

.line span {
  color: var(--text-secondary);
}

.line-head {
  padding-top: 0;
  border-bottom-color: var(--rule-strong);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-tertiary);
}

.line-head span {
  color: inherit;
}

.line-old {
  opacity: 0.5;
}

.tally {
  margin: auto 0 0;
  padding-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.tally b {
  margin-right: 6px;
  font: 600 30px/1 var(--font-title);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}

.outs .panel {
  flex: 1 1 auto;
}

.sheet {
  border: 1px solid var(--rule);
  border-bottom: 0;
  font-size: 12px;
  line-height: 16px;
}

.sheet-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1.2fr);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.sheet-row > * {
  padding: 4px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid var(--rule-soft);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sheet-row > :first-child {
  border-left: 0;
}

.sheet-head {
  background: var(--sunken);
}

.sheet-head > * {
  font-weight: 600;
  color: var(--ink);
}

.ask {
  margin: 0 0 8px auto;
  width: fit-content;
  max-width: 100%;
  padding: 6px 11px;
  background: var(--sunken);
  border-radius: 10px 10px 2px;
  font-size: 13px;
  line-height: 1.4;
}

.answer {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.sent {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 400 12px/20px var(--font-mono);
  color: var(--text-secondary);
}

.sent li::after {
  content: ' ✓';
  color: var(--green-text);
}

/* The script drives the flow by adding .on to each step in turn. */

.flow.live [data-step] {
  opacity: 0;
  transition: opacity 0.7s var(--ease-slow);
}

.flow.live [data-step].on {
  opacity: 1;
}

.flow.live .msg[data-step] {
  transform: translateY(8px);
  transition:
    opacity 0.7s var(--ease-slow),
    transform 0.7s var(--ease-slow);
}

.flow.live .msg[data-step].on {
  transform: none;
}

.flow.live .wipe[data-step] {
  clip-path: inset(0 100% 0 0);
  transition:
    opacity 0.7s var(--ease-slow),
    clip-path 0s 0.7s;
}

.flow.live .wipe[data-step].on {
  clip-path: inset(0);
  transition:
    opacity 0.3s linear,
    clip-path 1.3s cubic-bezier(0.4, 0, 0.3, 1);
}

.flow.live.fading [data-step] {
  opacity: 0;
}

@media (max-width: 860px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .wire {
    justify-self: center;
    width: 1px;
    height: 36px;
    margin: 6px 0;
  }

  .tick {
    top: 0;
    left: -1px;
    width: 3px;
    height: 14px;
    margin: -7px 0 0;
  }

  .flow.live .tick.on {
    animation-name: tick-y;
  }

  .ledger .line-old:not(:nth-child(4)) {
    display: none;
  }

  .tally {
    padding-top: 20px;
  }
}

/* The dark band: the same tokens as the dark theme, so everything on it follows. */

.stage {
  --ground: #0f1613;
  --surface: #18211d;
  --sunken: #141c18;
  --ink: #e4eae5;
  --text-secondary: #b4c0b8;
  --text-tertiary: #919e96;
  --rule: #2c3732;
  --rule-soft: #1f2925;
  --rule-strong: #8a968f;
  --border-control: #3a4640;
  --green: #5fb896;
  --green-hover: #74c6a6;
  --green-text: #6fc2a0;
  --text-on-green: #0e1a15;
  --brass: #c9a961;
  --seal: #c9a961;
  --hover: rgb(228 234 229 / 6%);
  border-top: 0;
  background: var(--ground);
  color: var(--ink);
}

.stage + .section,
.stage + .site-footer {
  border-top: 0;
}

.stage h2 {
  font-size: clamp(36px, 5vw, 60px);
}

@media (prefers-color-scheme: dark) {
  .stage {
    --ground: #080d0b;
    --surface: #131b17;
    --sunken: #0f1613;
  }
}

/* The tour: three scenes. With the script, the picture stays pinned while the text scrolls. */

.tour-stop {
  display: grid;
  gap: 32px 72px;
  align-items: center;
  padding: clamp(32px, 6vw, 64px) 0;
}

.tour-stop:first-child {
  padding-top: 0;
}

.tour-stop:last-child {
  padding-bottom: 0;
}

.tour-stop + .tour-stop {
  border-top: 1px solid var(--rule);
}

.tour-stage {
  display: none;
}

.tour .lede {
  max-width: 26em;
}

@media (min-width: 900px) {
  .tour-stop {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
  }

  html.has-tour .tour .wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
    gap: 0 72px;
    align-items: start;
  }

  html.has-tour .tour-stop {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    min-height: 86vh;
    padding: 0;
    border-top: 0;
    transition: opacity 0.5s var(--ease-slow);
  }

  html.has-tour .tour-stop:not(.is-on) {
    opacity: 0.26;
  }

  html.has-tour .tour-own {
    display: none;
  }

  html.has-tour .tour-stage {
    display: block;
    position: sticky;
    top: max(92px, calc(50vh - 262px));
  }

  html.has-tour .tour .count-number {
    font-size: clamp(64px, 8vw, 104px);
  }
}

.tour-shots {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--surface);
}

.tour-shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 0.7s var(--ease-slow),
    transform 0.9s var(--ease-slow);
}

.tour-shot.is-on {
  opacity: 1;
  transform: none;
}

.tour-marks {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font: 600 20px/1 var(--font-title);
  color: var(--text-tertiary);
}

.tour-marks li {
  min-width: 30px;
  padding-bottom: 7px;
  border-bottom: 1px solid transparent;
  text-align: center;
  transition:
    color 0.4s var(--ease-slow),
    border-color 0.4s var(--ease-slow);
}

.tour-marks li.is-on {
  color: var(--brass);
  border-color: var(--brass);
}

/* Record scene: the count, and thirty days drawn as hairlines. */

.count {
  margin: 0;
  border-top: 1px solid var(--rule-strong);
  padding-top: 20px;
}

.count-number {
  display: block;
  font: 600 clamp(64px, 10vw, 128px) / 0.95 var(--font-title);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.01em;
}

.count-label {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 0;
  justify-content: space-between;
  height: 120px;
  margin-top: 36px;
  border-bottom: 1px solid var(--rule);
}

.bars span {
  width: 2px;
  height: calc(var(--h) * 1%);
  background: var(--green);
  transform-origin: bottom;
}

html.js .reveal .bars span {
  transform: scaleY(0);
}

html.js .reveal.in .bars span {
  transform: none;
  transition: transform 1.1s var(--ease-slow) calc(0.3s + var(--i) * 35ms);
}

.bars-label {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Works with: the names alone, in a row that wraps; one may say it is not here yet. */

.works {
  margin: 0;
  padding: 28px 0 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--rule-strong);
}

.work {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 20px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font: 600 clamp(20px, 2.1vw, 26px) / 1.15 var(--font-title);
}

html.js .works.reveal .work {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.7s var(--ease-slow) calc(var(--i) * 70ms),
    transform 0.7s var(--ease-slow) calc(var(--i) * 70ms);
}

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

.work-soon {
  border-style: dashed;
  background: none;
  color: var(--text-tertiary);
}

.work-status {
  font: 600 13px/1 var(--font);
  color: var(--brass);
}

/* A line that opens to say more, for the few who need it. */

.more {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-tertiary);
}

.more summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--duration) var(--ease);
}

.more[open] summary::before {
  transform: rotate(45deg);
}

.more summary:hover {
  color: var(--ink);
}

.more p {
  max-width: 46ch;
  margin: 8px 0 0;
  line-height: 1.55;
  color: var(--text-secondary);
}

.download .more p {
  margin-inline: auto;
}

/* A bubble over a button that says which computer it is for. */

@media screen and (hover: hover) {
  [data-tip] {
    position: relative;
  }

  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    z-index: 5;
    width: max-content;
    max-width: 260px;
    padding: 8px 12px;
    text-align: center;
    text-wrap: balance;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text-secondary);
    font: 400 13px/1.4 var(--font);
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition:
      opacity var(--duration) var(--ease),
      transform var(--duration) var(--ease);
  }

  [data-tip]:hover::after,
  [data-tip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
    transition-delay: 150ms;
  }
}

/* Steps, numbered with Roman numerals as in the app. */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0 48px;
  border-top: 1px solid var(--rule-strong);
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.step {
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--rule);
}

.numeral {
  display: block;
  margin-bottom: 14px;
  font: 600 clamp(44px, 5vw, 64px) / 1 var(--font-title);
  color: var(--brass);
}

.step h3,
.fact h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.step p,
.fact p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

html.js .steps.reveal .step,
html.js .facts.reveal .fact {
  opacity: 0;
  transition: opacity 0.9s var(--ease-slow) calc(var(--i) * 110ms);
}

html.js .steps.reveal.in .step,
html.js .facts.reveal.in .fact {
  opacity: 1;
}

/* Things to know: a plain two-column list. */

.facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0 64px;
  border-top: 1px solid var(--rule-strong);
}

@media (min-width: 800px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fact {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--rule);
}

/* A fact shows its heading; pressing it opens the sentence beneath. */

.fact summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.fact summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a cross once the fact is open. */
.fact summary::after {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--text-tertiary);
  transition: transform 0.3s var(--ease-slow);
}

.fact summary:hover::after {
  color: var(--green-text);
}

.fact details[open] summary::after {
  transform: rotate(45deg);
}

.fact details[open] > p {
  animation: fact-open 0.35s var(--ease-slow);
}

@keyframes fact-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fact details[open] > p {
    animation: none;
  }
}

/* Things to know, wide: the heading stays beside the list as it scrolls. */

.know .fact h3 {
  font: 600 clamp(22px, 2.2vw, 26px) / 1.2 var(--font-title);
}

@media (min-width: 900px) {
  .know .wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
    gap: 0 72px;
    align-items: start;
  }

  .know .section-head {
    position: sticky;
    top: 108px;
    margin: 0;
  }

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

/* Company concepts: each has a small figure above its text. A figure is drawn in its end state;
   the script adds .playing while it is on screen, and the keyframes below then loop it. */

.concepts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 44px 48px;
}

@media (min-width: 800px) {
  .concepts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.concept {
  /* Neighbouring figures start a little apart, so they do not move in step. */
  --delay: calc(var(--i) * 0.5s);
  min-width: 0;
}

.concept > h3 {
  margin: 22px 0 0;
  font: 600 clamp(22px, 2.2vw, 26px) / 1.2 var(--font-title);
}

.concept > p {
  max-width: 46ch;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

.vignette {
  display: grid;
  align-items: center;
  height: 216px;
  padding: 18px;
  overflow: hidden;
  background: var(--sunken);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-large);
}

.v-in {
  min-width: 0;
}

.v-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) 28px minmax(0, 1.15fr);
  align-items: center;
}

.v-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.v-wire {
  position: relative;
  height: 1px;
  /* Level with the boxes, which sit under a label. */
  margin-top: 26px;
  background: var(--rule);
}

.v-tick {
  position: absolute;
  top: -1px;
  left: 0;
  width: 12px;
  height: 3px;
  margin-left: -6px;
  border-radius: 2px;
  background: var(--green);
  opacity: 0;
}

.vignette .msg {
  font-size: 14px;
}

.v-phone {
  position: relative;
  padding: 22px 8px 12px;
  background: var(--ground);
  border: 1.5px dashed var(--border-control);
  border-radius: 16px;
  opacity: 0.45;
}

.v-phone::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 28px;
  height: 3px;
  margin-left: -14px;
  border-radius: 2px;
  background: var(--rule);
}

.v-record {
  min-width: 0;
  padding: 2px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-large);
}

.vignette .line {
  grid-template-columns: 40px minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 8px;
  padding: 9px 0;
}

/* Beside a chat bubble, which already shows the time, a record line is name and text only. */

.v-pair .line {
  grid-template-columns: fit-content(56%) minmax(0, 1fr);
}

.v-pair .line time {
  display: none;
}

.vignette .line:last-child {
  border-bottom: 0;
}

.v-miss {
  opacity: 0.3;
}

.line mark {
  margin: 0 -2px;
  padding: 0 2px;
  border-radius: 2px;
  background-color: color-mix(in srgb, var(--brass) 26%, transparent);
  color: var(--ink);
}

.v-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-bottom: 12px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  font-size: 14px;
}

.v-field svg {
  flex: none;
  color: var(--text-tertiary);
}

/* The deleted message: the old text and WhatsApp's notice share one place in the bubble. */

.v-swap {
  display: grid;
}

.v-was,
.v-now {
  grid-area: 2 / 1;
}

.v-was {
  opacity: 0;
}

.v-now {
  font-style: italic;
  color: var(--text-tertiary);
}

.v-chip {
  margin: 0;
  padding: 7px 0 8px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tertiary);
}

.v-chip::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--brass);
  vertical-align: 1px;
}

/* The voice note: grey bars, with a green copy on top that is uncovered as it plays. */

.v-note {
  width: min(100%, 300px);
}

.v-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--text-tertiary);
}

.v-wave {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 26px;
}

.v-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--rule);
}

.v-bars i {
  width: 2px;
  height: calc(var(--h) * 1%);
  border-radius: 1px;
  background: currentColor;
}

.v-bars-on {
  color: var(--green);
}

.v-dur {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.v-voice .flow-label {
  margin-top: 16px;
}

.v-text {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .vignette {
    height: auto;
  }

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

  .v-wire {
    width: 1px;
    height: 26px;
    margin: 8px 0 8px 22px;
  }

  .v-tick {
    top: 0;
    left: -1px;
    width: 3px;
    height: 12px;
    margin: -6px 0 0;
  }
}

/* The loops. Every part runs on the same ten seconds, so the parts of one figure stay in step. */

.vignette.playing :is(.v-in, .msg, .v-tick, .v-new, .v-phone, .v-was, .v-now, .v-chip, .v-typed),
.vignette.playing :is(.v-miss, mark, .v-bars-on, .v-text, .v-late),
.keeps.playing :is(.k-tick, .k-row-new, .k-count i, .k-switch, .k-chip),
.keeps.playing .k-switch::after {
  animation-duration: 10s;
  animation-delay: var(--delay, 0s);
  animation-timing-function: var(--ease-slow);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.vignette.playing .v-in {
  animation-name: v-cycle;
}

.vignette.playing .msg {
  animation-name: v-arrive;
}

.vignette.playing .v-tick {
  animation-name: v-tick-x;
}

.vignette.playing .v-new {
  animation-name: v-write;
}

.vignette.playing .v-phone {
  animation-name: v-phone;
}

.vignette.playing .v-was {
  animation-name: v-was;
}

.vignette.playing .v-now {
  animation-name: v-now;
}

.vignette.playing .v-chip {
  animation-name: v-chip;
}

.vignette.playing .v-typed {
  animation-name: v-type;
}

.vignette.playing .v-miss {
  animation-name: v-dim;
}

.vignette.playing mark {
  animation-name: v-mark;
}

.vignette.playing .v-bars-on {
  animation-name: v-play;
  animation-timing-function: linear;
}

.vignette.playing .v-late {
  animation-name: v-label;
}

.vignette.playing .v-text {
  animation-name: v-text;
}

@media (max-width: 520px) {
  .vignette.playing .v-tick {
    animation-name: v-tick-y;
  }
}

@keyframes v-cycle {
  0%,
  100% {
    opacity: 0;
  }

  4%,
  93% {
    opacity: 1;
  }
}

@keyframes v-arrive {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  8%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes v-tick-x {
  0%,
  11% {
    left: 0;
    opacity: 0;
  }

  14%,
  21% {
    opacity: 1;
  }

  24%,
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes v-tick-y {
  0%,
  11% {
    top: 0;
    opacity: 0;
  }

  14%,
  21% {
    opacity: 1;
  }

  24%,
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes v-write {
  0%,
  23% {
    clip-path: inset(0 100% 0 0);
  }

  35%,
  100% {
    clip-path: inset(0);
  }
}

@keyframes v-phone {
  0%,
  56% {
    border-style: solid;
    opacity: 1;
  }

  66%,
  100% {
    border-style: dashed;
    opacity: 0.45;
  }
}

@keyframes v-was {
  0%,
  48% {
    opacity: 1;
  }

  54%,
  100% {
    opacity: 0;
  }
}

@keyframes v-now {
  0%,
  52% {
    opacity: 0;
  }

  60%,
  100% {
    opacity: 1;
  }
}

@keyframes v-chip {
  0%,
  60% {
    opacity: 0;
  }

  68%,
  100% {
    opacity: 1;
  }
}

@keyframes v-type {
  0%,
  10% {
    clip-path: inset(0 100% 0 0);
  }

  24%,
  100% {
    clip-path: inset(0);
  }
}

@keyframes v-dim {
  0%,
  28% {
    opacity: 1;
  }

  38%,
  100% {
    opacity: 0.3;
  }
}

@keyframes v-mark {
  0%,
  28% {
    background-color: transparent;
  }

  38%,
  100% {
    background-color: color-mix(in srgb, var(--brass) 26%, transparent);
  }
}

@keyframes v-play {
  0%,
  10% {
    clip-path: inset(0 100% 0 0);
  }

  48%,
  100% {
    clip-path: inset(0);
  }
}

@keyframes v-label {
  0%,
  46% {
    opacity: 0;
  }

  52%,
  100% {
    opacity: 1;
  }
}

@keyframes v-text {
  0%,
  50% {
    clip-path: inset(0 100% 0 0);
  }

  68%,
  100% {
    clip-path: inset(0);
  }
}

/* What is saved and where: the computer drawn as a boundary. Messages come in from WhatsApp, the
   folder holds them, and the two dashed lines out carry only what the owner switches on. Drawn
   in its end state and looped like the concept figures. */

.keeps {
  max-width: 400px;
  margin: 28px 0 0;
}

.k-source {
  padding-left: 22px;
}

.k-wire {
  position: relative;
  width: 1px;
  height: 30px;
  margin-top: 8px;
  background: var(--text-tertiary);
}

.k-wire-out {
  height: 26px;
  margin: 0 0 0 22px;
  background: none;
  border-left: 1px dashed var(--text-tertiary);
}

.k-tick {
  position: absolute;
  top: 0;
  left: -1px;
  width: 3px;
  height: 12px;
  margin-top: -6px;
  border-radius: 2px;
  background: var(--green);
  opacity: 0;
}

.k-wire-out .k-tick {
  left: -2px;
}

.k-computer {
  padding: 12px 14px 14px;
  background: var(--sunken);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
}

.k-computer > .flow-label {
  margin-bottom: 10px;
}

.k-folder {
  padding: 2px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-large);
}

.k-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 0;
  font: 600 13px/18px var(--font);
}

.k-name svg {
  flex: none;
  color: var(--text-tertiary);
}

.k-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -12px;
  padding: 8px 12px;
  border-top: 1px solid var(--rule-soft);
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.k-row b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* The old and the new count share one place. */

.k-count {
  display: grid;
}

.k-count i {
  grid-area: 1 / 1;
  font-style: normal;
  text-align: right;
}

.k-count i:first-child {
  opacity: 0;
}

.k-outs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.k-chip {
  padding: 8px 10px 9px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-large);
  opacity: 0.6;
}

.k-out-on .k-chip {
  opacity: 1;
}

.k-out-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font: 600 13px/18px var(--font);
}

.k-out-note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tertiary);
}

.k-switch {
  position: relative;
  flex: none;
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: var(--border-control);
}

.k-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
}

.k-out-on .k-switch {
  background: var(--green);
}

.k-out-on .k-switch::after {
  transform: translateX(12px);
}

.keeps.playing .k-tick-in {
  animation-name: k-in;
}

.keeps.playing .k-row-new {
  animation-name: k-flash;
}

.keeps.playing .k-count i:first-child {
  animation-name: k-old;
}

.keeps.playing .k-count i:last-child {
  animation-name: k-new;
}

.keeps.playing .k-out-on .k-switch {
  animation-name: k-track;
}

.keeps.playing .k-out-on .k-switch::after {
  animation-name: k-knob;
}

.keeps.playing .k-out-on .k-chip {
  animation-name: k-chip;
}

.keeps.playing .k-tick-out {
  animation-name: k-out;
}

@keyframes k-in {
  0%,
  6% {
    top: 0;
    opacity: 0;
  }

  9%,
  15% {
    opacity: 1;
  }

  18%,
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes k-flash {
  0%,
  17%,
  36%,
  100% {
    background-color: transparent;
  }

  22% {
    background-color: color-mix(in srgb, var(--brass) 22%, transparent);
  }
}

@keyframes k-old {
  0%,
  18%,
  100% {
    opacity: 1;
  }

  22%,
  95% {
    opacity: 0;
  }
}

@keyframes k-new {
  0%,
  18%,
  100% {
    opacity: 0;
  }

  22%,
  95% {
    opacity: 1;
  }
}

@keyframes k-track {
  0%,
  42%,
  100% {
    background-color: var(--border-control);
  }

  48%,
  94% {
    background-color: var(--green);
  }
}

@keyframes k-knob {
  0%,
  42%,
  100% {
    transform: none;
  }

  48%,
  94% {
    transform: translateX(12px);
  }
}

@keyframes k-chip {
  0%,
  42%,
  100% {
    opacity: 0.6;
  }

  48%,
  94% {
    opacity: 1;
  }
}

@keyframes k-out {
  0%,
  52% {
    top: 0;
    opacity: 0;
  }

  55%,
  62% {
    opacity: 1;
  }

  66%,
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Closing download */

.closing {
  padding: clamp(72px, 11vw, 150px) 0;
}

.closing h2 {
  font-size: clamp(44px, 7.5vw, 96px);
}

.closing .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.closing .wrap > svg {
  width: clamp(44px, 6vw, 72px);
  height: auto;
  color: var(--seal);
  margin-bottom: 24px;
}

.closing .buttons {
  margin-top: 28px;
  justify-content: center;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 40px 0 56px;
  font-size: 15px;
  color: var(--text-tertiary);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 48px;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 4px;
}

.site-footer .brand {
  margin-bottom: 12px;
}

.site-footer .brand .wordmark {
  font-size: 17px;
}

.site-footer a {
  color: var(--text-secondary);
}

/* Print: plain black on white, no navigation, no pictures, links written out. */

@media print {
  :root {
    --ground: #fff;
    --surface: #fff;
    --ink: #000;
    --text-secondary: #222;
    --text-tertiary: #333;
    --rule: #999;
    --rule-strong: #000;
    --green-text: #000;
    --brass: #000;
    --seal: #000;
  }

  body {
    font-size: 11pt;
  }

  .site-nav,
  .skip,
  .hero-rules,
  .tour-stage,
  .window,
  .flow,
  .bars,
  .bars-label,
  .closing {
    display: none;
  }

  .button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #000;
    font-weight: 600;
  }

  .button::after {
    content: ' (' attr(href) ')';
    font-weight: 400;
  }

  .section,
  .hero {
    padding: 18pt 0;
  }

  .step,
  .fact {
    break-inside: avoid;
  }

  h2 {
    break-after: avoid;
  }
}

[hidden] {
  display: none !important;
}
