/* Bench, option B. One live card travels the page over three surfaces:
   night (the dark bench), mask (soldermask green) and sage (the app's own
   window grey). The card's canvas sits above section backgrounds and below
   their text, so content panels can slide over it.

   Ported from the Bench repo's website/option-b/styles.css for /bench, plus
   the Buy button and terms of sale, which the static page doesn't have. It
   lives in lib/assets, not app/assets, because `stylesheet_link_tag :app`
   links every CSS file under app/assets and the rest of the site must not
   get these global rules. Only layouts/bench.html.erb links it. */

/* The faces live in app/assets/fonts, beside usefae.com's own */
@font-face {
  font-family: "Archivo";
  src: url("/assets/archivo-var-ee25cbd0.woff2") format("woff2-variations"),
       url("/assets/archivo-var-ee25cbd0.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Fragment Mono";
  src: url("/assets/fragment-mono-400-623a0454.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
  --night: #08160f;
  --night-panel: #0d2017;
  --mask: #0f3322;
  --mask-panel: #0a2618;
  --pour: #143f2a;
  --sage: #d6e0dd;
  --sage-panel: #f3f6f4;

  --silk: #efe6cf;
  --gold: #d9b15e;
  --gold-hi: #f6e0a3;
  --gold-lo: #a67d35;
  --led: #6cff7c;
  --mac-blue: #0a7cff;
  --red: #ff6b5e;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --edge: clamp(20px, 4vw, 56px);
  --max: 1240px;

  color-scheme: dark;
}

/* Each surface sets the colours its content uses. */
.surface--night {
  --surface: var(--night);
  --panel: var(--night-panel);
  --text: #d9dfd2;
  --dim: #9aae9f;
  --head: var(--silk);
  --rule: rgb(239 230 207 / 0.12);
  --focus: var(--gold);
  background: var(--surface);
  color: var(--text);
}

.surface--mask {
  --surface: var(--mask);
  --panel: var(--mask-panel);
  --text: #d5d9c6;
  --dim: #a3b6a4;
  --head: var(--silk);
  --rule: rgb(239 230 207 / 0.14);
  --focus: var(--gold);
  background-color: var(--surface);
  background-image: repeating-linear-gradient(135deg, var(--pour) 0 2px, transparent 2px 6px);
  color: var(--text);
}

.surface--sage {
  --surface: var(--sage);
  --panel: var(--sage-panel);
  --text: #1d3428;
  --dim: #4d6458;
  --head: #0b2116;
  --rule: rgb(11 33 22 / 0.14);
  --focus: #0b2116;
  background: var(--surface);
  color: var(--text);
  color-scheme: light;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--night);
}

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

body {
  margin: 0;
  background: var(--night);
  color: #d9dfd2;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  overflow-wrap: break-word;
}

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

img {
  height: auto;
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

b {
  color: var(--head);
  font-weight: 650;
}

code,
.mono,
.log,
.console__lines,
.terminal dt {
  font-variant-ligatures: none;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--head);
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.16em 0.42em 0.2em;
  border: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
  border-bottom-width: 2px;
  border-radius: 0.4em;
  font-family: var(--font);
  font-size: 0.84em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--gold);
  color: var(--night);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--edge), var(--max));
  margin-inline: auto;
}

section,
.footer {
  position: relative;
}

/* The live card */
.stage-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}

.gl .stage-canvas {
  opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Type                                                                */
/* ------------------------------------------------------------------ */

.statement {
  color: var(--head);
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.statement--big {
  font-size: clamp(3rem, 6.4vw, 5.75rem);
  line-height: 0.95;
}

/* the four words printed on the card */
.word {
  width: fit-content;
  padding-bottom: 0.08em;
  font-size: clamp(3.6rem, 8.4vw, 7.6rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.86;
  letter-spacing: -0.012em;
  background: linear-gradient(180deg, var(--gold-hi) 4%, var(--gold) 42%, var(--gold-lo) 64%, #e4c273 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.surface--sage .word {
  background: none;
  color: var(--head);
}

.chapter__sub {
  max-width: 22ch;
  margin-top: 0.35em;
  color: var(--head);
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 650;
  font-stretch: 106%;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.prose {
  max-width: 36rem;
}

.prose p + p {
  margin-top: 0.9em;
}

.small,
.prose .small {
  color: var(--dim);
  font-size: 0.94rem;
}

h3 {
  color: var(--head);
  font-size: 1.15rem;
  font-weight: 650;
  font-stretch: 106%;
  line-height: 1.25;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.button {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
  padding: 0.85em 1.35em 0.9em;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  color: var(--night);
  font-size: 1.05rem;
  font-weight: 700;
  font-stretch: 108%;
  line-height: 1.1;
  text-decoration: none;
}

.button--soon {
  background: none;
  color: var(--head);
  box-shadow: inset 0 0 0 1.5px rgb(217 177 94 / 0.75);
  cursor: default;
}

.button--soon small {
  color: var(--dim);
  font-size: 0.82em;
  font-weight: 500;
  font-stretch: 100%;
}

.button--quiet {
  padding-inline: 0.2em;
  background: none;
  color: var(--head);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--head) 40%, transparent);
  text-underline-offset: 0.25em;
}

/* Buy is a form's button (checkout takes a POST), so it drops the
   browser's button chrome to match the links */
button.button {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.button small {
  font-size: 0.82em;
  font-weight: 500;
  font-stretch: 100%;
  opacity: 0.78;
}

a.button:not(.button--quiet):hover,
button.button:hover {
  filter: brightness(1.08);
}

/* the second of two real buttons: a gold line, like "Coming soon", that works */
.button--line {
  background: none;
  color: var(--head);
  box-shadow: inset 0 0 0 1.5px rgb(217 177 94 / 0.75);
}

a.button--line:hover,
button.button--line:hover {
  filter: none;
  background: rgb(217 177 94 / 0.12);
}

.button--line small {
  color: var(--dim);
  opacity: 1;
}

.key-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.8em 0.5em 1em;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  color: var(--head);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
}

.key-button kbd {
  border-color: currentColor;
  opacity: 0.7;
}

.key-button:hover {
  background: color-mix(in srgb, var(--text) 22%, transparent);
}

.key-button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.key-button--blue {
  background: var(--mac-blue);
  color: #fff;
}

.key-button--blue:hover {
  background: #2a8fff;
}

.key-button--ghost {
  padding-inline: 0.9em;
  background: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 30%, transparent);
}

/* ------------------------------------------------------------------ */
/* Masthead                                                            */
/* ------------------------------------------------------------------ */

/* the header floats over the hero so its glow runs to the top edge */
.masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: none;
}

.masthead__row {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  min-height: 84px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
}

.brand__fae {
  border-radius: 3px;
}

.brand__name {
  color: var(--silk);
  font-size: 1.45rem;
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: clamp(14px, 2.2vw, 30px);
}

.nav a {
  color: var(--dim);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--silk);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.55em;
  color: var(--dim);
  font-size: 0.9rem;
  white-space: nowrap;
}

.led-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 6px 1px rgb(108 255 124 / 0.75), 0 0 18px 4px rgb(108 255 124 / 0.25);
}

/* ------------------------------------------------------------------ */
/* Slots: where the card sits. Fallback pictures show without WebGL.    */
/* ------------------------------------------------------------------ */

.slot {
  position: relative;
}

.slot__fallback {
  width: 100%;
  transition: opacity 0.4s;
}

.slot.is-live .slot__fallback {
  opacity: 0;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.hero {
  overflow: clip;
  padding-block: calc(84px + clamp(16px, 3vw, 40px)) clamp(56px, 8vw, 120px);
  background:
    radial-gradient(60% 70% at 78% 40%, rgb(40 110 70 / 0.35), transparent 70%),
    var(--surface);
}

.hero__grid {
  display: grid;
  gap: 8px;
}

.hero__title {
  color: var(--silk);
  font-size: clamp(2.5rem, 7vw, 4.3rem);
  font-weight: 750;
  font-stretch: 104%;
  line-height: 0.98;
  letter-spacing: -0.022em;
}

.hero__title span {
  display: block;
  text-wrap: balance;
}

.hero__title span + span {
  margin-top: 0.12em;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 1.8rem;
  font-size: clamp(1.12rem, 1.5vw, 1.28rem);
  line-height: 1.55;
}

.hero__boards {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--dim);
  font-size: 1rem;
  text-wrap: pretty;
}

.hero .actions {
  margin-top: 2.1rem;
}

.hero__fine {
  max-width: 34rem;
  margin-top: 1.1rem;
  text-wrap: pretty;
}

.hero__fine a {
  white-space: nowrap;
}

.slot--hero {
  aspect-ratio: 1500 / 1800;
  max-width: 100%;
  border-radius: 24px;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 64rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    gap: 24px;
  }

  .hero__title {
    font-size: clamp(2.6rem, 4.6vw, 4.3rem);
  }

  .hero__card {
    margin-right: calc(-1 * var(--edge));
  }
}

@media (max-width: 63.99rem) {
  .hero__card {
    width: min(100%, 520px);
    margin: 16px auto 0;
  }
}

/* ------------------------------------------------------------------ */
/* Boards                                                              */
/* ------------------------------------------------------------------ */

.boards {
  padding-block: clamp(80px, 10vw, 150px);
}

.boards__head {
  display: grid;
  gap: 24px;
}

@media (min-width: 56rem) {
  .boards__head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 5vw, 72px);
  }

  .boards__head .prose {
    padding-top: 0.4rem;
  }
}

.shot {
  margin-top: clamp(40px, 5vw, 72px);
}

.shot img {
  width: 100%;
  filter: drop-shadow(0 36px 44px rgb(11 33 22 / 0.28)) drop-shadow(0 6px 12px rgb(11 33 22 / 0.18));
}

.shot figcaption {
  margin-top: 1rem;
  color: var(--dim);
  font-size: 0.92rem;
}

/* ------------------------------------------------------------------ */
/* Chapters: text panels slide over the card on the right               */
/* ------------------------------------------------------------------ */

.chapters {
  position: relative;
}

.chapters__rail {
  display: none;
}

.chapter__panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 26px;
  align-content: start;
  width: min(100% - 2 * var(--edge), var(--max));
  margin-inline: auto;
  padding-block: clamp(80px, 10vw, 140px);
}

.slot--chapter {
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
}

.slot--chapter .slot__fallback {
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

@media (min-width: 64rem) {
  .chapters__rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    right: 0;
    pointer-events: none;
  }

  .stage {
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .chapter {
    min-height: 118vh;
  }

  .chapter__panel {
    width: 50%;
    margin: 0;
    padding-left: max(var(--edge), (100vw - var(--max)) / 2);
    padding-right: clamp(32px, 4vw, 64px);
    background: inherit;
    background-attachment: fixed;
  }

  /* the card slides out from under the panel's edge */
  .chapter__panel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 90px;
    background: inherit;
    background-attachment: fixed;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent);
    mask-image: linear-gradient(90deg, #000, transparent);
    pointer-events: none;
  }

  /* the hatch stays put behind panel and stage alike, so they line up */
  .chapter.surface--mask {
    background-attachment: fixed;
  }

  .slot--chapter {
    display: none;
  }

  .no-gl .chapters__rail {
    display: none;
  }

  .no-gl .slot--chapter {
    display: block;
  }
}

/* ------------------------------------------------------------------ */
/* Demos                                                               */
/* ------------------------------------------------------------------ */

.demo {
  max-width: 40rem;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--rule), 0 24px 50px -30px rgb(0 0 0 / 0.6);
  overflow: hidden;
}

.surface--sage .demo {
  box-shadow: 0 0 0 1px var(--rule), 0 24px 50px -30px rgb(11 33 22 / 0.35);
}

.demo__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--rule);
}

.demo__bar--foot {
  border-top: 1px solid var(--rule);
  border-bottom: 0;
}

.demo__title {
  margin-right: auto;
  color: var(--head);
  font-weight: 650;
}

.demo__title span {
  color: var(--dim);
  font-weight: 500;
}

.demo__note {
  margin-right: auto;
  color: var(--text);
  font-size: 0.95rem;
}

.demo__status {
  padding: 10px 18px 14px;
  color: var(--dim);
  font-size: 0.92rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--dim);
  font-size: 0.92rem;
  cursor: pointer;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gold);
}

.log {
  height: 16em;
  padding: 14px 18px;
  overflow: auto;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.log--short {
  height: 9.4em;
  border-top: 1px solid var(--rule);
}

.log .ok {
  color: var(--led);
}

.surface--sage .log .ok {
  color: #13843a;
}

.log .head {
  color: var(--head);
}

.log .dim {
  color: var(--dim);
}

/* flash */
.device {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
}

.device__name {
  color: var(--head);
  font-size: 1.1rem;
  font-weight: 650;
}

.device__meta {
  color: var(--dim);
  font-size: 0.92rem;
  line-height: 1.45;
}

.device__running {
  margin-top: 0.25rem;
  color: var(--text);
  font-size: 0.95rem;
}

.images {
  display: grid;
  gap: 2px;
  padding: 10px 18px 14px;
}

.images li {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr) auto;
  grid-template-rows: auto 4px;
  column-gap: 12px;
  row-gap: 5px;
  padding-block: 6px;
  font-size: 0.92rem;
}

.images .mono {
  color: var(--dim);
}

.images__size {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: var(--mac-blue);
}

.images li.is-done .bar i {
  background: var(--led);
}

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

.keys div {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.keys dd {
  color: var(--dim);
  font-size: 0.96rem;
}

/* inspect */
.chip-facts {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}

.chip-facts div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 12px;
  font-size: 0.95rem;
}

.chip-facts dt {
  color: var(--dim);
}

.pmap {
  padding: 18px 18px 14px;
}

.pmap__bar {
  display: flex;
  gap: 2px;
  height: 34px;
  padding: 3px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.pmap__seg {
  position: relative;
  flex: var(--size) 0 0;
  min-width: 5px;
  border: 0;
  border-radius: 4px;
  background: var(--c);
  cursor: pointer;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: box-shadow 0.2s, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s;
}

.pmap__seg.is-in {
  transform: none;
  opacity: 1;
}

.pmap__seg.is-active {
  box-shadow: inset 0 0 0 2.5px #0b2116;
}

.pmap__seg[aria-current="true"] {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pmap__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--dim);
  font-size: 0.85rem;
}

.pmap__readout {
  min-height: 1.6em;
  margin-top: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.pmap__readout .mono {
  color: var(--dim);
}

/* ------------------------------------------------------------------ */
/* Explore: the console                                                */
/* ------------------------------------------------------------------ */

.explore {
  padding-block: clamp(96px, 12vw, 170px);
}

.explore__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.slot--explore {
  width: clamp(150px, 20vw, 260px);
  aspect-ratio: 1;
}

.slot--explore .slot__fallback {
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.console {
  margin-top: clamp(32px, 4vw, 56px);
  border-radius: 14px;
  background: #050c08;
  box-shadow: 0 0 0 1px var(--rule), 0 40px 80px -40px rgb(0 0 0 / 0.8);
  overflow: hidden;
}

.console__tabs {
  display: flex;
  justify-content: center;
  gap: 2px;
  width: fit-content;
  margin: 14px auto 0;
  padding: 3px;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.07);
}

.console__tabs button {
  padding: 0.4em 1.2em;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.console__tabs button[aria-selected="true"] {
  background: var(--mac-blue);
  color: #fff;
}

.console__lines {
  height: clamp(300px, 42vh, 440px);
  padding: 10px 0;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  overscroll-behavior: contain;
}

.line {
  display: grid;
  grid-template-columns: 7.6em minmax(0, 1fr);
  gap: 1.4em;
  padding: 0 16px;
  white-space: pre-wrap;
  color: #d4dccf;
}

.line .ts {
  color: #66766c;
}

.line--W .msg { color: #ffc36b; }
.line--E .msg { color: #ff8a80; }
.line--D .msg { color: #8fbfff; }
.line--V .msg { color: #8e9992; }

.line.is-new {
  animation: line-in 0.9s ease-out;
}

@keyframes line-in {
  from { background: rgb(108 255 124 / 0.12); }
  to { background: transparent; }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px;
  color: #7f8f85;
  font-family: var(--font);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgb(255 255 255 / 0.12);
}

.crash {
  margin: 10px 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgb(255 107 94 / 0.09);
  box-shadow: inset 3px 0 0 var(--red);
  font-family: var(--font);
}

.crash__title {
  color: #ffb3ab;
  font-weight: 650;
}

.crash__sub {
  margin-top: 2px;
  color: #c9a19c;
  font-size: 0.9rem;
}

.crash ol {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.crash button {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #f2e3df;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.crash button:hover {
  background: rgb(255 255 255 / 0.06);
}

.crash button .mono {
  color: #b7928c;
}

.crash button .where {
  color: #ffcbc4;
}

.crash__note {
  min-height: 1.5em;
  margin-top: 8px;
  color: #c9a19c;
  font-size: 0.88rem;
}

/* the output is ruled off from the tabs above it */
.console__panel {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
}

.console__panel[hidden] {
  display: none;
}

.plot__label {
  padding: 16px 18px 0;
  color: var(--dim);
  font-size: 0.92rem;
}

.plot {
  width: 100%;
  height: clamp(260px, 36vh, 380px);
}

.console__send {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  color: #5f6f65;
}

.trio {
  display: grid;
  gap: 28px;
  margin-top: clamp(40px, 5vw, 64px);
}

.trio p {
  margin-top: 0.5rem;
  font-size: 1rem;
}

@media (min-width: 48rem) {
  .trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
  }
}

/* ------------------------------------------------------------------ */
/* Editors, also, specs                                                */
/* ------------------------------------------------------------------ */

.editors,
.also,
.specs {
  padding-block: clamp(96px, 12vw, 170px);
}

.split {
  display: grid;
  gap: 32px;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: start;
  }
}

.split .prose {
  margin-top: 1.4rem;
}

.editor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1em;
  margin-top: 1.8rem;
  color: var(--head);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 650;
  font-stretch: 112%;
}

.terminal {
  padding: 22px 26px 26px;
  border-radius: 14px;
  background: var(--night);
  color: #d9dfd2;
  box-shadow: 0 30px 60px -30px rgb(11 33 22 / 0.5);
  --head: var(--silk);
  --dim: #9aae9f;
  --rule: rgb(239 230 207 / 0.1);
}

.terminal__title {
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 0.95rem;
}

.terminal__title code {
  padding: 0;
  background: none;
  color: var(--silk);
}

.terminal dl div {
  padding-block: 12px;
  border-top: 1px solid var(--rule);
}

.terminal dt {
  color: var(--silk);
  font-family: var(--mono);
  font-size: 0.92rem;
}

.terminal dt::before {
  content: "$ ";
  color: var(--gold);
}

.terminal dd {
  margin-top: 0.15rem;
  color: var(--dim);
  font-size: 0.94rem;
}

.terminal__note {
  margin-top: 10px;
  color: var(--dim);
  font-size: 0.9rem;
}

.vias {
  display: grid;
  gap: 36px 40px;
  margin-top: clamp(32px, 4vw, 56px);
}

@media (min-width: 44rem) {
  .vias {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .vias {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.vias li {
  position: relative;
  padding-left: 34px;
}

.vias li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mask-panel) 0 3px, var(--gold) 3.5px 7.5px, transparent 8px);
}

.vias p {
  margin-top: 0.45rem;
  font-size: 1rem;
}

.spec-table div {
  display: grid;
  grid-template-columns: minmax(6.5rem, 10rem) minmax(0, 1fr);
  gap: 16px;
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
}

.spec-table div:last-child {
  border-bottom: 1px solid var(--rule);
}

.spec-table dt {
  color: var(--dim);
  font-weight: 600;
}

.spec-table dd {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  color: var(--head);
}

/* ------------------------------------------------------------------ */
/* License                                                             */
/* ------------------------------------------------------------------ */

.license {
  padding-block: clamp(96px, 12vw, 170px);
  background:
    radial-gradient(45% 60% at 28% 50%, rgb(217 177 94 / 0.14), transparent 70%),
    var(--surface);
}

.license__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 56rem) {
  .license__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(40px, 6vw, 96px);
  }
}

.license__card {
  width: min(100%, 400px);
  justify-self: center;
}

.slot--license {
  aspect-ratio: 900 / 1325;
  border-radius: 20px;
  user-select: none;
  -webkit-user-select: none;
}

.license__text .prose {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}

.license .actions {
  margin-top: 2rem;
}

.license__text > .small {
  margin-top: 1rem;
}

/* ------------------------------------------------------------------ */
/* Modal: "Lost your key?", loaded by Turbo into the dialog's frame     */
/* ------------------------------------------------------------------ */

.modal {
  width: min(100% - 2 * var(--edge), 32rem);
  max-height: calc(100% - 2 * var(--edge));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--rule), 0 40px 90px -30px rgb(0 0 0 / 0.85);
}

.modal::backdrop {
  background: rgb(4 12 8 / 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal[open] {
  animation: modal-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal__panel {
  position: relative;
  padding: clamp(28px, 5vw, 44px);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--head);
}

.modal__title {
  padding-right: 40px;
}

.modal__text {
  margin-top: 1rem;
}

.modal__text a {
  color: var(--head);
  text-decoration-color: rgb(239 230 207 / 0.4);
}

.modal__status {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-top: 1.4rem;
  color: var(--head);
  font-weight: 650;
}

.modal__field {
  margin-top: 1.6rem;
}

.modal__field label {
  display: block;
  color: var(--head);
  font-weight: 650;
}

.modal__field input {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.7em 0.9em;
  border: 1px solid rgb(239 230 207 / 0.28);
  border-radius: 10px;
  background: rgb(0 0 0 / 0.28);
  color: var(--silk);
  font: inherit;
  font-size: 1.1rem;
}

.modal__field input[aria-invalid="true"] {
  border-color: var(--red);
}

.modal__error {
  margin-top: 0.55rem;
  color: var(--red);
  font-size: 0.94rem;
}

.modal .actions {
  margin-top: 1.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.footer {
  padding-top: clamp(64px, 8vw, 110px);
}

.footer__row {
  display: grid;
  gap: 24px 40px;
  align-items: center;
  padding-bottom: 48px;
}

@media (min-width: 56rem) {
  .footer__row {
    grid-template-columns: auto 1fr auto;
  }
}

.stamp {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stamp__mark {
  border-radius: 3px;
}

.stamp p {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.stamp span:first-child {
  color: var(--silk);
  font-weight: 650;
}

.stamp span:last-child {
  color: var(--dim);
  font-size: 0.95rem;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer__nav a {
  color: var(--silk);
  font-weight: 600;
  text-decoration-color: rgb(239 230 207 / 0.35);
}

.footer__legal {
  color: var(--dim);
  font-size: 0.9rem;
}

.fingers {
  position: relative;
  z-index: 2;
  height: 64px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 30%, var(--gold-lo) 85%);
  -webkit-mask:
    radial-gradient(circle at 12px 12px, #000 11.5px, transparent 12px) 50% 0 / 40px 24px repeat-x,
    linear-gradient(90deg, #000 24px, transparent 24px) 50% 12px / 40px calc(100% - 12px) repeat-x;
  mask:
    radial-gradient(circle at 12px 12px, #000 11.5px, transparent 12px) 50% 0 / 40px 24px repeat-x,
    linear-gradient(90deg, #000 24px, transparent 24px) 50% 12px / 40px calc(100% - 12px) repeat-x;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 47.99rem) {
  .nav {
    display: none;
  }

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

  .slot--explore {
    display: none;
  }

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

  .line .ts {
    font-size: 0.72rem;
  }
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .nav a:nth-child(5) {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Key caps that press themselves                                      */
/* ------------------------------------------------------------------ */

.cap {
  padding: 0.35em 0.6em 0.4em;
  font-size: 0.9rem;
  color: var(--head);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--text) 30%, transparent);
  transition: transform 0.12s, box-shadow 0.12s, background 0.3s;
}

.cap.is-pressed {
  animation: cap-press 0.5s ease-out;
}

@keyframes cap-press {
  0% { transform: none; }
  25% { transform: translateY(2px); box-shadow: 0 0 0 transparent; background: color-mix(in srgb, var(--gold) 45%, transparent); }
  100% { transform: none; }
}

.app-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.8em 0.5em 1em;
  border-radius: 8px;
  background: var(--mac-blue);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
}

.app-button kbd {
  border-color: currentColor;
  opacity: 0.7;
}

.app-button.is-pressed {
  animation: app-press 0.5s ease-out;
}

@keyframes app-press {
  25% { transform: scale(0.95); filter: brightness(1.25); }
}

.device__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .cap.is-pressed,
  .app-button.is-pressed {
    animation: none;
  }

  .pmap__seg {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Phones and small tablets: the card sits out the feature sections    */
/* ------------------------------------------------------------------ */

@media (max-width: 63.99rem) {
  .slot--chapter,
  .slot--explore {
    display: none;
  }

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