/* falla site. Mobile first: the page is designed at 375-390 px and widened from there.
   Colours are tokens defined once per theme (light, dark, and the dark token set again for an
   explicit data-theme). One accent: the blue. Mona Sans is served from this site (fonts/). */
@font-face {
  font-family: "Mona Sans";
  src: url("fonts/mona-sans-latin-wdth.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #ffffff;
  --raised: #f5f5f7;
  --shot: #f5f5f7;
  --hair: #d2d2d7;
  --hair-strong: #8e8e93; /* 3:1 or better against the page (WCAG 1.4.11) */
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --sheet: #ffffff;
  --accent: #0a64d8;
  --on-accent: #ffffff;
  --accent-wash: rgba(10, 100, 216, 0.1);
  --focus: #0a64d8;
  --scrim: rgba(0, 0, 0, 0.38);
  --disabled-bg: #e5e5ea;
  --disabled-ink: #56565b; /* 4.5:1 or better on the disabled background */
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --sans: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* only inside code, pre and kbd */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #000000;
    --raised: #1c1c1e;
    --shot: #141416;
    --hair: #2c2c2e;
    --hair-strong: #8e8e93;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --sheet: #1c1c1e;
    --accent: #4c9bff;
    --on-accent: #001a3d;
    --accent-wash: rgba(76, 155, 255, 0.16);
    --focus: #4c9bff;
    --scrim: rgba(0, 0, 0, 0.6);
    --disabled-bg: #2c2c2e;
    --disabled-ink: #aeaeb2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #000000;
  --raised: #1c1c1e;
  --shot: #141416;
  --hair: #2c2c2e;
  --hair-strong: #8e8e93;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --sheet: #1c1c1e;
  --accent: #4c9bff;
  --on-accent: #001a3d;
  --accent-wash: rgba(76, 155, 255, 0.16);
  --focus: #4c9bff;
  --scrim: rgba(0, 0, 0, 0.6);
  --disabled-bg: #2c2c2e;
  --disabled-ink: #aeaeb2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }
pre { background: var(--raised); border-radius: var(--radius-s); padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
code { background: var(--raised); border-radius: 6px; padding: 0 0.3em; }
pre code { background: none; padding: 0; }
kbd { background: var(--raised); border: 1px solid var(--hair-strong); border-radius: 6px; padding: 0 0.35em; }
a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
svg.i { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar ---- */
/* Both bars are opaque: text under them must not show through (a see-through bar reads as noise). */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--page);
  border-bottom: 1px solid var(--hair);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 80rem; margin: 0 auto; padding: 10px 16px; min-height: 56px; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.top-nav { display: none; gap: 4px; }
.top-nav a { color: var(--muted); font-weight: 500; text-decoration: none; padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a:hover { color: var(--ink); background: var(--raised); }
.top-nav a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.lang { display: flex; gap: 4px; background: var(--raised); border-radius: 999px; padding: 3px; }
.lang a {
  color: var(--ink); font-weight: 500; font-size: 0.94rem; text-decoration: none;
  min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.lang a[aria-current="true"] { background: var(--sheet); font-weight: 650; border: 1px solid var(--hair-strong); padding: 0 9px; }
.lang .flag { font-size: 1.05rem; line-height: 1; }

/* ---- bottom tab bar (under 1024 px, where the thumb reaches): Home and Docs only ---- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--page);
  border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; color: var(--muted); text-decoration: none; font-size: 0.875rem; font-weight: 600; line-height: 1.2;
}
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs svg.i { width: 24px; height: 24px; }

main, .foot-in { padding-left: 16px; padding-right: 16px; }
/* Room for the bottom tab bar and the phone's home indicator: the last control stays clear of it. */
main { max-width: 80rem; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---- type ---- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.025em; font-stretch: 108%; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(2.125rem, 1.4rem + 3vw, 3.5rem); line-height: 1.05; margin: 0 0 16px; }
h2 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); line-height: 1.1; margin: 0 0 14px; }
h3 { font-size: 1.25rem; line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { text-wrap: pretty; margin: 0 0 14px; }
.lead { font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem); line-height: 1.45; color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.94rem; color: var(--muted); }

/* ---- home: the demo and the drop zone ---- */
.hero { padding: 28px 0 8px; }
.hero-text { min-width: 0; }
.drop {
  border: 1.5px dashed var(--hair-strong); border-radius: var(--radius-l); background: var(--raised);
  padding: 24px 18px; text-align: center; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop-ico { color: var(--accent); margin: 0 auto 6px; width: 32px; height: 32px; }
.drop-title { margin: 0 0 4px; font-weight: 650; font-size: 1.05rem; }
.drop-sub { margin: 0 0 14px; color: var(--muted); font-size: 0.94rem; }

/* The sample frame, on wide screens, next to the text: a fixed 16:9 box, so nothing shifts when it fills. */
.hero-frame { display: none; margin: 0; }
.hero-frame .frame-box {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-l); overflow: hidden;
  background: var(--shot); border: 1px solid var(--hair-strong);
}
.hero-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-frame figcaption { margin-top: 8px; color: var(--muted); font-size: 0.94rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 1.0625rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.secondary { background: var(--raised); color: var(--ink); border-color: var(--hair-strong); }
.btn.secondary:hover { border-color: var(--ink); }
.btn.link { background: none; color: var(--accent); padding: 0 8px; font-weight: 600; font-size: 1rem; }
.btn:disabled { background: var(--disabled-bg); color: var(--disabled-ink); border-color: transparent; cursor: not-allowed; }
.btn:disabled svg.i { opacity: 0.8; }

.progress { margin-top: 14px; min-height: 48px; }
.progress p { margin: 0 0 6px; color: var(--muted); font-size: 0.94rem; }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

.notice { margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius-s); background: var(--accent-wash); font-size: 0.97rem; }
.notice.error { border: 1px solid var(--accent); }

.results { padding: 36px 0 8px; scroll-margin-top: 80px; }
.results-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.source { margin: 0; color: var(--muted); font-size: 0.94rem; overflow-wrap: anywhere; }

.confirm { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; padding: 16px; border-radius: var(--radius-l); background: var(--raised); }
.counter { margin: 0; font-weight: 600; font-size: 0.97rem; }
.hint { margin: 0; color: var(--muted); font-size: 0.92rem; }
.confirm .notice { width: 100%; }
#ts-slot:empty { display: none; }
#ts-slot { margin-top: 12px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.card { background: var(--page); border: 1px solid var(--hair-strong); border-radius: var(--radius-m); overflow: hidden; display: grid; }
.card figure { margin: 0; background: var(--shot); }
.card figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.card .body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.card h3, .where, .why, .verdict, .notice { overflow-wrap: anywhere; }
.card-inset { position: relative; }
.card-inset .inset { position: absolute; right: 10px; bottom: 10px; width: 30%; border: 2px solid var(--page); border-radius: var(--radius-s); background: var(--page); }
.card-inset .inset img { display: block; width: 100%; height: auto; aspect-ratio: auto; max-height: 150px; object-fit: contain; }
.empty { background: var(--raised); border-radius: var(--radius-m); padding: 18px 16px; color: var(--muted); }
.empty strong { color: var(--ink); }
.more { margin-top: 14px; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rank { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--page); display: inline-grid; place-items: center; font-size: 0.875rem; font-weight: 700; flex: none; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.875rem; font-weight: 600; border: 1px solid var(--hair-strong); background: var(--page); }
.chip.sev-high { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.where, .why { margin: 0; }
.where { color: var(--muted); font-size: 0.94rem; }
.objects { margin: 0; color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.verdict { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--raised); font-size: 0.95rem; }
.verdict.v-bug { background: var(--accent-wash); }
.verdict.v-skipped { background: var(--page); border: 1px dashed var(--hair-strong); color: var(--muted); }
.verdict strong { font-weight: 700; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.95rem; padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
details img { display: block; width: 100%; height: auto; border-radius: var(--radius-s); border: 1px solid var(--hair-strong); }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.again { margin-top: 10px; align-self: flex-start; }

/* ---- prose: how it works, what stays local, privacy, terms, docs ---- */
.section { padding: 40px 0 4px; }
.section ol, .section ul { padding-left: 1.2rem; margin: 0 0 14px; }
.section li { margin-bottom: 8px; }
.steps { padding-left: 0 !important; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 10px; margin: 0; }
.steps li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--raised); color: var(--ink);
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; grid-row: span 1;
}
.split { display: grid; gap: 14px; margin-top: 8px; }
.panel { background: var(--raised); border-radius: var(--radius-l); padding: 18px 18px 6px; }
.panel h3 { margin-bottom: 8px; }
.panel ul { margin: 0 0 12px; padding-left: 1.1rem; }
.panel li { margin-bottom: 6px; }
.panel .ico { color: var(--accent); margin-bottom: 4px; }

.legal h1 { margin-bottom: 8px; }
.legal .date { color: var(--muted); margin-bottom: 26px; }
.legal h2 { font-size: 1.35rem; margin-top: 30px; }
.legal p, .legal li { font-size: 1.0625rem; }
.legal ol { padding-left: 1.2rem; }

/* Docs: a 220 px rail with a sticky table of contents, and 42rem of text beside it from 900 px. */
.docs-layout { display: block; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.docs-nav a { font-weight: 600; text-decoration: none; background: var(--raised); border-radius: 999px; padding: 8px 14px; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.docs-nav a:hover { color: var(--accent); }
.docs-text { min-width: 0; }
.docs article section { padding-top: 26px; }
.docs h2 { font-size: 1.5rem; margin-top: 26px; scroll-margin-top: 80px; }
.docs h3 { font-size: 1.1rem; margin: 18px 0 8px; scroll-margin-top: 80px; }
.docs table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.96rem; }
.docs th, .docs td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.docs th { font-weight: 650; }
.docs .note { background: var(--raised); border-radius: var(--radius-s); padding: 10px 14px; color: var(--muted); font-size: 0.95rem; }
.docs-wide { overflow-x: auto; margin: 0 0 16px; }
.docs-wide table { margin-bottom: 0; }
.docs td code, .docs th code { overflow-wrap: anywhere; }

/* ---- the two calls to action, the proof of the sample, the downloads of the demo scene ---- */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.cta .btn { flex: 1 1 10rem; }
.demo-proof { display: grid; gap: 10px; margin: 0 0 18px; }
.proof { margin: 0; font-weight: 600; color: var(--ink); }
.demo-files { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-files .btn { flex: 1 1 14rem; }
.docs-rail { min-width: 0; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--hair); margin-top: 40px; }
.foot-in { max-width: 80rem; margin: 0 auto; padding-top: 22px; padding-bottom: 96px; color: var(--muted); font-size: 0.94rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.foot nav a { color: var(--muted); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.foot p { margin: 0; }

/* ---- small screens up: two-column hero, three steps, the cards wider ---- */
@media (min-width: 720px) {
  main, .foot-in, .top-in { padding-left: 24px; padding-right: 24px; }
  .hero { padding-top: 56px; }
  .drop { padding: 30px 24px; }
  .confirm { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
  .card { grid-template-columns: minmax(220px, 300px) 1fr; }
  .card figure { display: grid; place-items: center; }
  .card figure img { aspect-ratio: auto; height: auto; }
  .split { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}
/* Wide screens: the top bar carries the navigation, the bottom bar goes, the hero is two columns. */
@media (min-width: 1024px) {
  .foot-in { padding-bottom: 28px; }
  .top-nav { display: flex; }
  .tabs { display: none; }
  main { padding-bottom: 0; }
  html { scroll-padding-bottom: 0; }
  .hero { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: center; }
  .hero-frame { display: block; }
  .drop { min-height: 260px; }
}
@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { grid-template-columns: 1fr; }
  .card figure img { aspect-ratio: 16 / 9; }
}
@media (min-width: 900px) {
  .docs-layout { display: grid; grid-template-columns: 220px minmax(0, 42rem); gap: 48px; align-items: start; justify-content: center; }
  .docs-nav { position: sticky; top: 80px; flex-direction: column; flex-wrap: nowrap; margin: 0; }
  .docs-nav a { border-radius: var(--radius-s); }
}
/* Very wide screens: the page keeps a margin of about 50 px on each side, so no empty band stays over 200 px. */
@media (min-width: 1700px) {
  .top-in, main, .foot-in { max-width: 117rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
