/* fastframe.dev: the home page (under .ff) and the top bar's Get started
   button. Colours come from the theme's tokens in _config.yml, so light
   and dark follow the site. */

/* The top bar's Get started link, as a button. */
.VPNavBarMenuLink[href$="/getting-started/"] {
  margin-left: 8px;
  padding: 0 14px;
  height: 32px;
  line-height: 32px;
  align-self: center;
  border-radius: 8px;
  background: #c2410c;
  color: #fff !important;
  font-weight: 600;
}
.VPNavBarMenuLink[href$="/getting-started/"]:hover { background: #a3360a; }

/* ---------- Home ---------- */

.ff {
  --ff-line: var(--vp-c-divider);
  --ff-surface: var(--vp-c-bg-soft);
  --ff-text: var(--vp-c-text-1);
  --ff-soft: var(--vp-c-text-2);
  --ff-accent: var(--vp-c-brand-1);
  --ff-mono: var(--vp-font-family-mono);
  color: var(--ff-text);
  font-size: 17px;
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 120px;
}
.ff *, .ff *::before, .ff *::after { box-sizing: border-box; }
.ff a { color: var(--ff-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ff-accent) 60%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.ff a:hover { color: var(--ff-accent); }
.ff h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  border: 0;
  padding: 0;
}
.ff-lede { margin: 0 0 28px; max-width: 44em; color: var(--ff-soft); }
.ff-small { margin: 20px 0 0; font-size: 14.5px; color: var(--ff-soft); max-width: 60em; }
.ff section { margin-top: 96px; }

/* Hero */
.ff-hero { text-align: center; max-width: 860px; margin: 0 auto; }
.ff-mark { width: 72px; height: 72px; margin: 0 auto 28px; display: block; }
.ff-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.ff-hero h1 .ff-tag { font-weight: 600; color: var(--ff-soft); }
/* On phones the tagline takes its own line, after the colon. */
@media (max-width: 600px) { .ff-hero h1 .ff-tag-words { display: block; } }
.ff-sub { margin: 24px auto 0; max-width: 40em; color: var(--ff-soft); font-size: 19px; line-height: 1.55; }
.ff-install {
  margin: 36px auto 0;
  max-width: 720px;
  text-align: left;
  border: 1px solid var(--ff-line);
  border-radius: 10px;
  background: var(--ff-surface);
  overflow: hidden;
}
.ff-install-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0 18px; font: 500 12px/1 var(--ff-mono); color: var(--ff-soft); }
.ff-install pre { margin: 0; padding: 12px 18px 16px; overflow-x: auto; }
.ff-install code { font: 500 14px/1.5 var(--ff-mono); color: var(--ff-text); background: none; white-space: pre; }
.ff-copy {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--ff-line);
  background: var(--vp-c-bg);
  color: var(--ff-text);
  font: 500 12px/1 var(--vp-font-family-base);
  cursor: pointer;
}
.ff-copy:hover { border-color: var(--ff-soft); }
.ff-star { margin: 20px auto 0; }
.ff-star .VPMetricButton { min-height: 40px; padding: 0 18px; font-size: 15px; gap: 10px; }
.ff-after { margin: 16px auto 0; font-size: 15px; color: var(--ff-soft); }
.ff-post { margin: 10px auto 0; font-size: 15px; }
/* The proof strip: short facts, each checkable, separated by dots. */
.ff-proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 18px auto 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.6; color: var(--ff-soft); }
.ff-proof li + li::before { content: "\00b7"; margin: 0 10px; color: var(--vp-c-text-3); }

/* The live demo */
.ff-demo-section { text-align: left; }
.ff-demo {
  margin: 0;
  border: 1px solid var(--ff-line);
  border-radius: 12px;
  background: var(--vp-c-bg);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--ff-line), 0 28px 56px -36px rgba(0, 0, 0, 0.45);
}
.ff-demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid var(--ff-line); background: var(--ff-surface); }
.ff-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--ff-line); border-radius: 8px; background: var(--vp-c-bg); }
.ff-seg button {
  font: 500 13px/1 var(--vp-font-family-base);
  color: var(--ff-soft);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
.ff-seg button:hover { color: var(--ff-text); }
.ff-seg button[aria-pressed="true"] { color: var(--ff-text); background: var(--vp-c-default-soft); font-weight: 600; }
.ff-theme { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ff-soft); }
.ff-theme select {
  font: 500 13px/1 var(--vp-font-family-base);
  color: var(--ff-text);
  background: var(--vp-c-bg);
  border: 1px solid var(--ff-line);
  border-radius: 6px;
  padding: 6px 8px;
}
/* The test apps are drawn for a 1040 by 680 window, plus the gallery's margin. Narrow screens get a
   still that opens the app full screen, rather than a squeezed app and
   10 MB of WebAssembly. */
.ff-demo-stage { overflow-x: auto; background: var(--vp-c-bg); }
.ff-demo-frame { display: block; width: 100%; min-width: 1040px; height: 704px; border: 0; background: transparent; }
.ff-demo-poster { display: none; position: relative; }
.ff a.ff-demo-poster { text-decoration: none; }
.ff-demo-poster img { display: block; width: 100%; height: auto; }
.ff-demo-poster .ff-dark, .dark .ff-demo-poster .ff-light { display: none; }
.dark .ff-demo-poster .ff-dark { display: block; }
.ff-demo-poster span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #c2410c;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 760px) {
  .ff-demo-frame { display: none; }
  .ff-demo-poster { display: block; }
  .ff-demo-bar { display: none; }
}
.ff-demo figcaption {
  padding: 11px 14px 12px;
  border-top: 1px solid var(--ff-line);
  background: var(--ff-surface);
  font: 500 12.5px/1.5 var(--ff-mono);
  color: var(--ff-soft);
}

/* The apps */
.ff-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ff a.ff-app { display: block; text-decoration: none; color: var(--ff-text); border: 1px solid var(--ff-line); border-radius: 12px; overflow: hidden; background: var(--ff-surface); transition: border-color 0.2s; }
.ff a.ff-app:hover { border-color: var(--ff-accent); color: var(--ff-text); }
.ff-app > img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-bottom: 1px solid var(--ff-line); }
.ff-app-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; }
.ff-app-title { font-size: 15px; color: var(--ff-soft); }
.ff-app-title b { display: block; font-size: 17px; color: var(--ff-text); }
/* One number per app, measured on that app. */
.ff-app-stat { padding-top: 12px; border-top: 1px solid var(--ff-line); font-size: 14.5px; line-height: 1.45; color: var(--ff-soft); }
.ff-app-stat strong { display: block; margin-bottom: 2px; font: 700 24px/1.2 var(--ff-mono); letter-spacing: -0.02em; color: var(--ff-text); font-variant-numeric: tabular-nums; }
.ff-app-stat i { font-style: normal; color: var(--ff-accent); }

/* Components are ordinary egui widgets: the text beside the code. */
.ff-code-section { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.ff-code-text .ff-lede { margin-bottom: 0; }
.ff-code-text code { font: 500 0.88em var(--ff-mono); padding: 1px 5px; border-radius: 4px; background: var(--vp-c-default-soft); color: var(--ff-text); }
.ff-install.ff-code { margin: 0; max-width: none; }
.ff-code pre { padding: 14px 18px 18px; }
.ff-code code { font-size: 13.5px; line-height: 1.6; }
.ff-code .k { color: #a626a4; }
.ff-code .t { color: #c2410c; }
.ff-code .f { color: #4078f2; }
.ff-code .s { color: #50a14f; }
.ff-code .c { color: var(--ff-soft); font-style: italic; }
.dark .ff-code .k { color: #c678dd; }
.dark .ff-code .t { color: #fb923c; }
.dark .ff-code .f { color: #61afef; }
.dark .ff-code .s { color: #98c379; }

/* The bigger components, each running live under the code sample. */
.ff-big-title { margin: 56px 0 18px; font-size: 21px; font-weight: 650; letter-spacing: -0.01em; }
.ff-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ff-big-item { border: 1px solid var(--ff-line); border-radius: 12px; overflow: hidden; background: var(--ff-surface); }
.ff-big-stage { position: relative; height: 300px; border-bottom: 1px solid var(--ff-line); background: var(--vp-c-bg); }
.ff-live-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.ff a.ff-big-run { display: none; }
.ff-big-item h4 { margin: 16px 18px 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ff .ff-big-item h4 a { text-decoration: none; }
.ff .ff-big-item h4 a:hover { text-decoration: underline; }
.ff-big-item p { margin: 6px 18px 0; font-size: 15.5px; color: var(--ff-soft); }
.ff-big-item .ff-crates { margin: 12px 18px 18px; }

/* Everything a desktop app needs: a group a row, its picture beside its
   crates. */
.ff-group { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; padding: 40px 0; border-top: 1px solid var(--ff-line); }
.ff-group:first-of-type { margin-top: 12px; }
.ff-group-head h3 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.ff-group-head > p { margin: 8px 0 20px; font-size: 16px; color: var(--ff-soft); }
.ff-desk-pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--ff-line); border-radius: 12px; background: var(--ff-surface); }
.ff-crate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.ff-crate-list li { display: flex; flex-direction: column; padding: 14px 16px 14px; border: 1px solid var(--ff-line); border-radius: 10px; background: var(--ff-surface); }
.ff-crate-list h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.ff .ff-crate-list h4 a { text-decoration: none; }
.ff .ff-crate-list h4 a::after { content: " \2192"; color: var(--ff-accent); }
.ff .ff-crate-list h4 a:hover { text-decoration: underline; }
.ff-crate-list p { flex: 1; margin: 4px 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ff-soft); }
.ff-crate-list code { align-self: flex-start; font: 500 12px/1.4 var(--ff-mono); color: var(--ff-soft); background: none; padding: 0; }
/* The font specimen is a native render; show its lower part, larger. */
.ff-desk-photo img { position: absolute; left: -2%; bottom: -1%; width: 150%; max-width: none; height: auto; }
.ff-desk-photo .ff-dark, .dark .ff-desk-photo .ff-light { display: none; }
.dark .ff-desk-photo .ff-dark { display: block; }

/* The illustrations take every colour from the site's tokens. */
.ff-ill { display: block; width: 100%; height: 100%; font-family: var(--vp-font-family-base); }
.ff-ill .mono { font-family: var(--ff-mono); }
.ff-ill .bg { fill: var(--ff-surface); }
.ff-ill .panel { fill: var(--vp-c-default-soft); }
.ff-ill .dim { fill: var(--vp-c-text-3); }
.ff-ill .card { fill: var(--vp-c-bg); stroke: var(--ff-line); stroke-width: 1; }
.ff-ill .lift { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.14)); }
.dark .ff-ill .lift { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5)); }
.ff-ill .ghost { fill: none; stroke: var(--vp-c-text-3); stroke-width: 1.2; stroke-dasharray: 5 5; }
.ff-ill .hover { fill: var(--vp-c-default-soft); }
.ff-ill .rule { stroke: var(--ff-line); stroke-width: 1; }
.ff-ill .t1 { fill: var(--ff-text); }
.ff-ill .t2 { fill: var(--ff-soft); }
.ff-ill .acc { fill: #c2410c; }
.dark .ff-ill .acc { fill: #f97316; }
.ff-ill .on-acc { fill: #fff; }
.ff-ill .on-acc-line { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ff-ill .key-on { stroke: #c2410c; stroke-width: 1.5; }
.dark .ff-ill .key-on { stroke: #f97316; }
.ff-ill .track { fill: var(--vp-c-default-soft); }
.ff-ill .arrow { fill: none; stroke: var(--ff-soft); stroke-width: 1.5; }
.ff-ill .acc-line { stroke: #c2410c; stroke-dasharray: 4 4; }
.dark .ff-ill .acc-line { stroke: #f97316; }
.ff-ill .acc-card { stroke: #c2410c; stroke-width: 1.5; }
.dark .ff-ill .acc-card { stroke: #f97316; }

/* Fast, small and native: one measured figure a tile. */
.ff-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.ff-stat { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; border: 1px solid var(--ff-line); border-radius: 12px; background: var(--ff-surface); }
.ff-stat strong { font: 700 28px/1.15 var(--ff-mono); letter-spacing: -0.02em; color: var(--ff-text); font-variant-numeric: tabular-nums; }
.ff-stat strong i { font-style: normal; color: var(--ff-accent); }
.ff-stat span { font-size: 14.5px; line-height: 1.5; color: var(--ff-soft); }

/* Add one crate to the egui app you have */
.ff-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: ff-step; }
.ff-steps li { position: relative; padding: 20px 20px 18px; border: 1px solid var(--ff-line); border-radius: 12px; background: var(--ff-surface); counter-increment: ff-step; }
.ff-steps li::before { content: counter(ff-step); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #c2410c; color: #fff; font: 700 13px/1 var(--ff-mono); }
.ff-steps h3 { margin: 12px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ff-steps p { margin: 6px 0 0; font-size: 15.5px; color: var(--ff-soft); }
.ff-crates { display: flex; flex-wrap: wrap; gap: 6px; }
.ff-steps .ff-crates { margin-top: 14px; }
.ff .ff-crates a { padding: 3px 8px; border: 1px solid var(--ff-line); border-radius: 6px; background: var(--vp-c-bg); font: 500 12.5px/1.4 var(--ff-mono); text-decoration: none; }
.ff .ff-crates a:hover { border-color: var(--ff-accent); }

/* The close repeats the hero's first step. */
.ff-close { text-align: center; padding-top: 72px; border-top: 1px solid var(--ff-line); }
.ff-close .ff-lede { margin: 0 auto; font-size: 19px; }
.ff-close .ff-install { margin-top: 28px; }
.ff-close .ff-after { margin-top: 20px; font-size: 16px; }

@media (max-width: 1100px) {
  .ff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .ff-code-section { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ff-steps { grid-template-columns: minmax(0, 1fr); }
  .ff-group { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ff-group-head .ff-desk-pic { max-width: 560px; }
  .ff-big { grid-template-columns: minmax(0, 1fr); }
}
/* Narrow screens get no WebAssembly: a link to each component instead. */
@media (max-width: 760px) {
  .ff-big-item { display: flex; flex-direction: column; }
  .ff-big-stage { order: 1; display: flex; height: auto; border-bottom: 0; background: none; }
  .ff-live-frame { display: none; }
  .ff a.ff-big-run { display: inline-block; align-self: flex-start; margin: 0 18px 18px; padding: 7px 12px; border-radius: 8px; background: #c2410c; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
}
@media (max-width: 640px) {
  .ff { padding: 48px 20px 80px; }
  .ff section { margin-top: 72px; }
  .ff-app-grid, .ff-crate-list, .ff-stats { grid-template-columns: minmax(0, 1fr); }
  .ff-sub { font-size: 17px; }
  .ff-install code { font-size: 12px; }
  .ff-code code { font-size: 12px; }
  .ff-demo-frame { height: 560px; }
  .ff-close { padding-top: 56px; }
  .ff-close .ff-lede { font-size: 17px; }
}
