/* Bench's page. 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.

   It began as the Bench repo's website/option-b/styles.css and is this
   page's own now. 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,
.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;
}

.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;
}

/* ------------------------------------------------------------------ */
/* 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 .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;
  }
}

/* ------------------------------------------------------------------ */
/* Features: a headline, then what makes it worth having                */
/* ------------------------------------------------------------------ */

.boards,
.console,
.plot,
.crashes,
.mac {
  padding-block: clamp(96px, 12vw, 170px);
}

.feature-head {
  display: grid;
  gap: 28px;
  align-items: center;
}

.feature-head .statement--big {
  font-size: clamp(2.6rem, 5.4vw, 4.75rem);
}

.prose--lede {
  max-width: 38rem;
  margin-top: 1.6rem;
  font-size: clamp(1.1rem, 1.4vw, 1.22rem);
}

@media (min-width: 64rem) {
  /* the headline, and the live card beside it */
  .feature-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(40px, 6vw, 96px);
  }

  /* the headline, and the prose beside it */
  .feature-head--wide {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: end;
  }

  .feature-head--wide .prose--lede {
    margin-top: 0;
  }
}

/* the small things worth knowing, each under a rule */
.points {
  display: grid;
  gap: 32px 40px;
  margin-top: clamp(48px, 6vw, 80px);
}

.points li {
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

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

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

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

  .points--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

/* the live card, close on its name plate */
.slot--plate {
  aspect-ratio: 5 / 4;
  user-select: none;
  -webkit-user-select: none;
}

.slot--plate .slot__fallback {
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
  border-radius: 16px;
}

.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));
}

/* the top of the window, fading out where the crop ends */
.shot--fade img {
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
}

/* a crop of the window rather than the whole of it */
.shot--console img {
  border-radius: 12px;
  filter: none;
  box-shadow: 0 0 0 1px var(--rule), 0 26px 50px -28px rgb(0 0 0 / 0.65);
}

/* ------------------------------------------------------------------ */
/* 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;
}

/* half the page wide, a size under Boards' and Console's */
.chapter .statement--big {
  font-size: clamp(2.4rem, 4.4vw, 4.1rem);
}

.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;
  }
}

/* ------------------------------------------------------------------ */
/* Screenshots: the app in a few states, switched by tabs              */
/* ------------------------------------------------------------------ */

.states {
  display: grid;
  gap: 14px;
  max-width: 40rem;
}

/* across the page */
.states--wide {
  max-width: none;
  margin-top: clamp(32px, 4vw, 56px);
}

.states__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

/* without JavaScript the first state shows, and tabs would do nothing */
html:not(.js) .states__bar {
  display: none;
}

.states__tabs,
.states__looks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

/* a figure with one state shows only Light and Dark */
.states__tabs--single {
  display: none;
}

.states__bar button {
  padding: 0.42em 0.9em;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

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

.states__bar button[aria-selected="true"],
.states__bar button[aria-pressed="true"] {
  background: var(--head);
  color: var(--surface);
}

/* Light and Dark, for the states that have both */
.states__looks.is-off {
  visibility: hidden;
}

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

.states__shots img {
  grid-area: 1 / 1;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--rule), 0 26px 50px -28px rgb(0 0 0 / 0.65);
  opacity: 0;
  transition: opacity 0.35s;
}

.surface--sage .states__shots img {
  box-shadow: 0 0 0 1px var(--rule), 0 26px 50px -30px rgb(11 33 22 / 0.4);
}

.states__shots img.is-on {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .states__shots img {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Console                                                             */
/* ------------------------------------------------------------------ */

/* the live card, close on its LED and blinking with each line */
.slot--console {
  aspect-ratio: 10 / 7;
  user-select: none;
  -webkit-user-select: none;
}

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

/* ------------------------------------------------------------------ */
/* Crashes and editors, also, specs                                    */
/* ------------------------------------------------------------------ */

.crashes .editors {
  margin-top: clamp(80px, 10vw, 140px);
}

/* on the dark bench, the terminal is a panel of its own */
.crashes .terminal {
  background: var(--night-panel);
  box-shadow: 0 0 0 1px var(--rule), 0 30px 60px -30px rgb(0 0 0 / 0.7);
}

/* a way to try it, halfway down */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-top: clamp(80px, 10vw, 140px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--rule);
}

.cta .statement {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
}

/* Inspect leads the list, with its screenshots */
.also__inspect {
  margin-top: clamp(32px, 4vw, 56px);
  padding-bottom: clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}

.also__inspect h3 {
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.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%;
}

/* the bench command, for coding agents */
.agents {
  margin-top: clamp(32px, 4vw, 48px);
}

.agents p {
  margin-top: 0.5rem;
}

.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;
}

.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;
  }
}

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

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

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