/* BonAppLab studio site. Shared by the landing page and every app page.
   Pages are generated by tools/build.ts from studio/apps/*.json. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/studio/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/studio/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/studio/fonts/fredoka-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Lilita One";
  src: url("/studio/fonts/lilita-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("/studio/fonts/rubik.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --plaster: #e3e7e1;
  --chalk: #f4f5f1;
  --bottle: #0f3029;
  --moss: #44605a;

  --f-studio: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --measure: 62ch;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Page theme. App pages override these inline from the app's JSON. */
  --bg: var(--plaster);
  --surface: var(--chalk);
  --ink: var(--bottle);
  --muted: var(--moss);
  --accent: var(--bottle);
  --accent-ink: var(--chalk);
  --display: var(--f-studio);
  --display-weight: 800;
}

/* Each app names the display face it ships with. */
[data-display="jakarta"] { --display: "Plus Jakarta Sans", var(--f-studio); --display-weight: 800; }
[data-display="fredoka"] { --display: "Fredoka", var(--f-studio); --display-weight: 600; }
[data-display="lilita"] { --display: "Lilita One", var(--f-studio); --display-weight: 400; }
[data-display="rubik"] { --display: "Rubik", var(--f-studio); --display-weight: 800; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-studio);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0.5rem;
  transform: translateY(-200%);
  z-index: 10;
}
.skip:focus { transform: none; }

/* ---------- Header ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark__dots {
  display: grid;
  grid-template-columns: repeat(2, 0.6rem);
  gap: 0.2rem;
}
.wordmark__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 0.18rem;
  background: var(--dot);
}

.bar__nav { display: flex; gap: 1.5rem; font-weight: 500; }
.bar__nav a { text-decoration: none; }
.bar__nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }

/* ---------- Landing: intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  padding: clamp(1.25rem, 3.5vw, 3rem) var(--gutter) clamp(1.25rem, 2.5vw, 2rem);
}
.intro__title {
  font-size: clamp(2.9rem, 6vw, 5.75rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 800;
  text-wrap: balance;
}
.intro__copy {
  max-width: 40ch;
  font-size: 1.1875rem;
  color: var(--muted);
}

/* ---------- Slabs: the lineup, and the mini version on app pages ---------- */

.lineup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0 var(--gutter);
  min-height: clamp(30rem, calc(100svh - 18.5rem), 54rem);
}

.slab {
  --slab-ink: #fff;
  position: relative;
  display: flex;
  flex: 1 1 14rem;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 24rem;
  padding: 1.25rem;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  border-radius: 1.75rem;
  background: var(--slab-bg);
  color: var(--slab-ink);
  text-decoration: none;
  transition: flex-grow 0.55s var(--ease);
}

.slab__art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--slab-pos, 50% 50%);
  transition: transform 0.9s var(--ease);
}
.slab[data-fit="contain"] .slab__art {
  inset: 5% 6% auto;
  width: 88%;
  height: 66%;
  object-fit: contain;
}
.slab[data-fit="top"] .slab__art {
  inset: 0 0 auto;
  height: 72%;
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.slab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(0 0 0 / var(--slab-scrim, 0.5)) 0%, rgb(0 0 0 / 0) 62%);
  pointer-events: none;
}

.slab__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.slab__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 22%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22);
}
.slab__kind {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.38);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.slab__name {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: clamp(2rem, 13cqi, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.slab__sub {
  margin-top: 0.3rem;
  font-weight: 700;
  font-size: clamp(1rem, 5cqi, 1.5rem);
  letter-spacing: 0.01em;
  opacity: 0.9;
}
.slab__tagline {
  margin-top: 0.75rem;
  max-width: 28ch;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.35);
}

.slab--mini { min-height: 15rem; flex-basis: 12rem; }
.slab--mini .slab__name { font-size: clamp(1.6rem, 11cqi, 2.6rem); }
.slab--mini .slab__tagline { display: none; }

@media (hover: hover) {
  .lineup .slab:hover,
  .lineup .slab:focus-visible { flex-grow: 2.1; }
  .slab:hover .slab__art,
  .slab:focus-visible .slab__art { transform: scale(1.045); }
}

/* ---------- Landing: index ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 7rem) var(--gutter) 0;
}
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem 4rem;
  align-items: end;
  margin-bottom: 1.5rem;
}
.section__title {
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.section__note { max-width: 40ch; color: var(--muted); }

.index { border-top: 2px solid var(--ink); }
.index__row {
  display: grid;
  grid-template-columns: 3.25rem minmax(11rem, 0.9fr) minmax(0, 2fr) minmax(7rem, 0.6fr) minmax(7rem, 0.6fr);
  gap: 1rem 1.5rem;
  align-items: center;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
  text-decoration: none;
  transition: background-color 0.2s;
}
.index__row:hover { background: var(--surface); }
.index__icon { width: 3.25rem; height: 3.25rem; border-radius: 22%; }
.index__name {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.index__kind { display: block; margin-top: 0.15rem; font-family: var(--f-studio); font-size: 0.9375rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.index__summary { color: var(--ink); }
.index__meta { color: var(--muted); font-size: 0.9375rem; }
.index__row:hover .index__name { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }

/* ---------- App page ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: min(46rem, calc(100svh - 5rem));
  padding: clamp(1rem, 3vw, 2.5rem) var(--gutter) clamp(2.5rem, 6vw, 5rem);
}
.hero__icon { width: 5rem; height: 5rem; border-radius: 22%; margin-bottom: 1.5rem; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent); }
.hero__name {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: clamp(3rem, 7.4vw, 7.25rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero__sub {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  line-height: 1;
  color: var(--accent);
}
.hero__tagline {
  margin-top: 1.5rem;
  max-width: 24ch;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero__text { margin-top: 1rem; max-width: 46ch; color: var(--muted); font-size: 1.1875rem; }
.hero__status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 2rem; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.hero__platforms { color: var(--muted); font-size: 0.9375rem; }

.hero__art { justify-self: stretch; }
.hero__art--frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2rem;
  background: var(--surface);
}
.hero__art--frame img { width: 100%; height: 100%; object-fit: cover; object-position: var(--slab-pos, 50% 50%); }
.hero__art--free img { width: 100%; max-height: 42rem; object-fit: contain; }

.block { padding: clamp(3rem, 7vw, 6rem) var(--gutter) 0; }
.block__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin-bottom: 2rem; }
.block__title {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.block__text { max-width: 46ch; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem clamp(2rem, 5vw, 5rem); }
.feature { padding-top: 1rem; border-top: 2px solid var(--ink); }
.feature__image { width: 9rem; margin-bottom: 0.5rem; }
.feature__title { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.625rem; line-height: 1.1; letter-spacing: -0.01em; }
.feature__text { margin-top: 0.6rem; max-width: 44ch; color: var(--muted); }

/* Gallery: cameras, badges, diagrams */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.25rem 0.75rem 1rem; border-radius: 1.25rem; background: var(--surface); text-align: center; }
.tile img { width: 100%; max-width: 8rem; aspect-ratio: 1; object-fit: contain; }
.tile figcaption { font-weight: 600; font-size: 0.9375rem; }
.gallery--badges { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.gallery--badges .tile img { max-width: 5.5rem; }
.gallery--diagram { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 40rem; }
.gallery--diagram .tile { padding: 0; overflow: hidden; align-items: stretch; gap: 0; }
.gallery--diagram .tile img { max-width: none; aspect-ratio: 4 / 5; }
.gallery--diagram .tile figcaption { padding: 0.9rem 1rem 1rem; font-size: 1.0625rem; }

/* Before / after */
.block--compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  grid-template-areas: "head stage" "picks stage";
  grid-template-rows: auto 1fr;
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
}
.block--compare .block__head { grid-area: head; align-self: end; margin-bottom: 0; }
.compare { display: contents; }
.compare__stage {
  grid-area: stage;
  --pos: 50%;
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 1.5rem;
  background: var(--surface);
  user-select: none;
  touch-action: pan-y;
}
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__img--after { clip-path: inset(0 0 0 var(--pos)); }
.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
  pointer-events: none;
}
.compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.75rem;
  height: 2.75rem;
  margin: -1.375rem 0 0 -1.375rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.compare__stage:has(.compare__range:focus-visible) { outline: 3px solid currentColor; outline-offset: 3px; }
.compare__tag {
  position: absolute;
  bottom: 0.9rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  pointer-events: none;
}
.compare__tag--before { left: 0.9rem; }
.compare__tag--after { right: 0.9rem; }
.compare__picks { grid-area: picks; display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.compare__pick {
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.compare__pick[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.links__item {
  padding: 0.7rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.links__item:hover { background: var(--ink); color: var(--bg); }

.more { display: flex; flex-wrap: wrap; gap: 0.75rem; }

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

.footer {
  margin-top: clamp(4rem, 9vw, 8rem);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) 2rem;
  background: var(--bottle);
  color: var(--chalk);
  --ink: var(--chalk);
}
.footer__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 2.5rem 4rem; }
.footer__brand .wordmark { font-size: clamp(2rem, 4vw, 3rem); }
.footer__blurb { margin-top: 1rem; max-width: 30ch; color: #b9c9c3; }
.footer__groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.75rem 2rem; }
.footer__group h3 { margin-bottom: 0.6rem; font-size: 1rem; font-weight: 700; }
.footer__group li + li { margin-top: 0.3rem; }
.footer__group a { color: #d6e2dd; text-underline-offset: 0.25em; }
.footer__group a:hover { color: #fff; }
.footer__none { color: #b9c9c3; font-size: 0.9375rem; }
.footer__fine { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgb(244 245 241 / 0.2); color: #b9c9c3; font-size: 0.9375rem; }

/* ---------- Legal and support pages: same text, wrapped in the app's theme ---------- */

.legal-page .bar__nav { flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem 1.25rem; }
.bar__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 2px; }

.legal-layout {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) var(--gutter) 0;
}
.legal-layout .eyebrow {
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: 1.2rem;
  color: var(--accent);
}
.legal-layout h1 {
  margin-top: 0.4rem;
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.legal-layout .updated { margin-top: 1rem; color: var(--muted); }
.legal-layout h2 {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.legal-layout h2 + p { margin-top: 0.6rem; }
.legal-layout p { margin-top: 0.85rem; }
.legal-layout ul, .legal-layout ol { margin-top: 0.85rem; padding-inline-start: 1.4rem; }
.legal-layout ul { list-style: disc; }
.legal-layout ol { list-style: decimal; }
.legal-layout li + li { margin-top: 0.4rem; }
.legal-layout a { text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
.legal-layout .note-band {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: var(--surface);
}

.legal-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: 1.5rem var(--gutter);
  background: var(--surface);
  color: var(--muted);
}
.legal-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 46rem;
  margin: 0 auto;
}
.legal-footer a { color: var(--ink); text-underline-offset: 0.2em; }

/* ---------- Motion: one page-load moment, everything else answers a user action ---------- */

@media (prefers-reduced-motion: no-preference) {
  .lineup .slab { animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(2.5rem); } }
}
@media (prefers-reduced-motion: reduce) {
  .slab, .slab__art, .index__row, .links__item { transition: none; }
}

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

@media (max-width: 56rem) {
  .intro, .section__head, .hero, .footer__top { grid-template-columns: minmax(0, 1fr); }
  .intro { gap: 1rem; }
  .lineup { min-height: 0; flex-direction: column; }
  .slab { flex: none; min-height: min(30rem, 72svh); }
  .slab--mini { min-height: 12rem; }
  .index__row { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .index__summary, .index__meta { grid-column: 2; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .gallery--diagram { grid-template-columns: minmax(0, 1fr); }
  .block--compare { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "picks"; grid-template-rows: none; }
  .compare__picks { flex-direction: row; flex-wrap: wrap; }
  .bar__nav { gap: 1rem; }
  .legal-page .bar { flex-wrap: wrap; row-gap: 0.5rem; }
  .legal-page .bar__nav { justify-content: flex-start; }
  .hero { min-height: 0; }
  .hero__art--frame { aspect-ratio: 1; }
}
