/* Lombana Apps: static site stylesheet.
   One variable font (Bricolage Grotesque, self-hosted). Light and dark follow the system.
   Studio brand: warm stone ground, deep ink, one pine-green accent. Each app brings its own
   contained palette through --app-* variables set by [data-app="<id>"] (generated per app).
   Markup contract: notes/design-direction.md. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;

  /* studio colour roles, light */
  --bg: #f2f0eb;
  --bg-2: #e8e5dc;          /* tinted band behind the app cards */
  --surface: #faf9f6;
  --ink: #1a1814;
  --muted: #5a564b;
  --line: #d6d2c6;
  --accent: #0b5d4b;        /* links, primary button fill */
  --on-accent: #ffffff;
  --focus: #0b5d4b;
  --dot: #14a37f;           /* the dot of the studio mark */
  --band: #0b5d4b;          /* full-colour field (contact) */
  --on-band: #f2f0eb;
  --band-dot: #8fe8c4;

  /* component colours: studio by default, an app scope maps them to --app-* (see .themed) */
  --c-ink: var(--ink);
  --c-muted: var(--muted);
  --c-line: var(--line);
  --c-accent: var(--accent);
  --c-on-accent: var(--on-accent);
  --c-surface: var(--surface);

  /* type */
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --fs-h2: clamp(1.875rem, 1.3rem + 2.2vw, 3rem);
  --fs-h1: clamp(2.375rem, 1.4rem + 3.8vw, 4.25rem);
  --fs-display: clamp(2.75rem, 1rem + 7.4vw, 6.25rem);

  /* space (4px base) */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4.5rem; --s9: 7rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --max: 72rem;
  --measure: 66ch;
  --section: clamp(3.5rem, 8vw, 6.5rem);

  /* shape and motion: controls 0.625rem, cards 1.5rem, icons 22.37% (app-icon squircle), pills round */
  --r-ctl: 0.625rem;
  --r-card: 1.5rem;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --t: 150ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12130f;
    --bg-2: #191a15;
    --surface: #1b1c17;
    --ink: #f1efe8;
    --muted: #a9a599;
    --line: #302f27;
    --accent: #6fddb4;
    --on-accent: #0a1410;
    --focus: #6fddb4;
    --dot: #8fe8c4;
    --band: #0f3a2f;
    --on-band: #f1efe8;
    --band-dot: #8fe8c4;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
img { height: auto; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
h1, h2 { font-stretch: 86%; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 650; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.num, time, .tnum { font-variant-numeric: tabular-nums lining-nums; }

a { color: var(--c-accent); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--accent); color: var(--on-accent); padding: 0.75rem 1rem; border-radius: var(--r-ctl);
  font-weight: 650; text-decoration: none;
}
.skip:focus { top: 0.75rem; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--c-muted); max-width: 40rem; }
.fine { font-size: var(--fs-small); color: var(--c-muted); line-height: 1.5; }

/* app scope: any element with data-app supplies --app-*; .themed maps them onto the generic --c-* roles */
.themed, .app-card, .app-page, .group-head {
  --c-ink: var(--app-ink);
  --c-muted: var(--app-muted);
  --c-line: var(--app-line);
  --c-accent: var(--app-accent);
  --c-on-accent: var(--app-on-accent);
  --c-surface: var(--app-surface);
  background: var(--app-bg);
  color: var(--app-ink);
}

/* ------------------------------------------------------------------ buttons, pills, icons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.5rem; border: 2px solid transparent; border-radius: var(--r-ctl);
  background: var(--c-accent); color: var(--c-on-accent);
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color var(--t) ease-out, border-color var(--t) ease-out;
}
.btn:hover { background: color-mix(in srgb, var(--c-accent) 86%, #000); text-decoration: none; }
.btn:active { background: color-mix(in srgb, var(--c-accent) 76%, #000); }
.btn-ghost { background: transparent; color: var(--c-ink); border-color: var(--c-muted); }
.btn-ghost:hover { background: transparent; border-color: var(--c-ink); }
.btn[aria-disabled="true"], .btn:disabled {
  background: transparent; color: var(--c-muted); border-color: var(--c-line); cursor: not-allowed; pointer-events: none;
}

.pill {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 1.75rem; padding: 0 0.75rem;
  border-radius: 99px; font-size: 0.8125rem; font-weight: 650; line-height: 1; white-space: nowrap;
}
.pill::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; flex: none; }
.pill-available { background: var(--app-accent); color: var(--app-on-accent); }
.pill-coming { background: transparent; color: var(--app-ink); box-shadow: inset 0 0 0 1.5px var(--app-muted); }
.pill-coming::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

.app-icon {
  display: block; width: var(--icon, 4.5rem); height: auto; aspect-ratio: 1; flex: none;
  border-radius: 22.37%; box-shadow: 0 8px 18px -8px rgb(0 0 0 / 0.4);
}
.app-icon-xs { --icon: 2.75rem; }

/* ------------------------------------------------------------------ header */
.site-head { border-bottom: 1px solid var(--line); }
.head-in { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s2); padding-block: 0.375rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-stretch: 88%; font-size: 1.0625rem; letter-spacing: -0.01em;
}
.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.brand-mark .mark-l { stroke: var(--ink); }
.brand-mark .mark-dot { fill: var(--dot); }
.nav { display: flex; order: 3; flex-basis: 100%; margin-inline: -0.75rem; }
.lang { display: flex; order: 2; margin-left: auto; margin-right: -0.375rem; }
.nav a, .lang a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.75rem;
  color: var(--ink); text-decoration: none; font-weight: 550; font-size: 1rem;
}
.lang a { min-width: 2.5rem; justify-content: center; padding-inline: 0.25rem; color: var(--muted); font-size: 0.9375rem; }
.nav a:hover, .lang a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.nav a[aria-current], .lang a[aria-current] {
  color: var(--ink); font-weight: 750; text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 0.15em; text-underline-offset: 0.35em;
}
@media (min-width: 640px) {
  .head-in { flex-wrap: nowrap; column-gap: var(--s5); }
  .nav { order: 2; flex-basis: auto; margin-left: auto; margin-right: var(--s3); }
  .lang { order: 3; margin-left: 0; }
}

/* ------------------------------------------------------------------ home */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero-copy { position: relative; z-index: 1; }
/* The mark is a ghost behind the first lines: about 40% of the viewport shows, the rest bleeds off the right edge.
   Stroke and dot are tints of the ground, so the type above keeps AA contrast. */
.hero-mark {
  position: absolute; z-index: 0; top: clamp(1.5rem, 6vw, 3rem); right: -22vw; width: 62vw; height: auto; max-width: none; margin: 0;
  pointer-events: none;
}
.hero-mark .mark-l { stroke: var(--bg-2); }
.hero-mark .mark-dot { fill: color-mix(in srgb, var(--dot) 28%, var(--bg)); }
.hero h1 { font-size: var(--fs-display); line-height: 1; letter-spacing: -0.02em; font-stretch: 88%; max-width: 11.5em; }
.hero .lead { margin-top: var(--s5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); margin-top: var(--s6); }
@media (min-width: 900px) {
  .hero-copy { max-width: 46rem; }
  .hero-mark { right: max(-4rem, calc((100vw - var(--max)) / 2 - 5rem)); top: 50%; transform: translateY(-50%); width: clamp(21rem, 36vw, 34rem); }
  .hero-mark .mark-dot { fill: var(--dot); }
}

.section { padding-block: var(--section); }
.split { display: grid; gap: var(--s5) var(--s7); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

.what { border-top: 1px solid var(--line); padding-top: var(--section); padding-bottom: var(--section); }
.what-body { display: grid; gap: var(--s4); max-width: var(--measure); }
.what-body p { color: var(--muted); }
.what-body p:first-child { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink); font-weight: 500; }

/* apps band */
.apps { background: var(--bg-2); padding-block: var(--section); }
.apps-head { margin-bottom: var(--s7); align-items: end; }
.apps-head p { color: var(--muted); max-width: 36rem; }
.app-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); } }
@media (min-width: 1040px) { .app-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.app-card {
  position: relative; display: grid; align-content: start; justify-items: start; gap: var(--s2); padding: clamp(1.25rem, 3vw, 1.75rem);
  grid-template-columns: minmax(0, 1fr);
  /* edge: 1px, at least 2:1 against the stone band for every app theme (ink mixed into the card ground) */
  border: 1px solid color-mix(in srgb, var(--app-ink) 48%, var(--app-bg)); border-radius: var(--r-card);
  transition: border-color var(--t) ease-out;
}
.app-card:hover { border-color: var(--app-accent); }
.app-card .app-icon { --icon: 5rem; }
.app-card .pill { margin-top: var(--s3); }
.app-card-name { margin-top: var(--s4); font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem); font-stretch: 86%; line-height: 1.05; }
.app-card-name a { color: inherit; text-decoration: none; }
.app-card-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card-name a:focus-visible { outline: none; }
.app-card-name a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.app-card:hover .app-card-name a { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.18em; }
.app-card-line { color: var(--app-muted); max-width: 30ch; line-height: 1.45; }

/* seven apps or more: the same card becomes a compact row, so the list stays scannable */
.app-grid:has(> :nth-child(7)) .app-card {
  padding: var(--s4) var(--s5); align-items: center; justify-items: stretch; gap: var(--s1) var(--s4);
  grid-template-columns: auto 1fr auto; grid-template-rows: auto auto;
  grid-template-areas: "icon name pill" "icon line line";
}
.app-grid:has(> :nth-child(7)) .app-icon { --icon: 3.5rem; grid-area: icon; }
.app-grid:has(> :nth-child(7)) .app-card-name { grid-area: name; margin: 0; font-size: 1.25rem; align-self: end; }
.app-grid:has(> :nth-child(7)) .app-card-line { grid-area: line; align-self: start; max-width: none; font-size: 0.9375rem; }
.app-grid:has(> :nth-child(7)) .pill { grid-area: pill; align-self: center; margin: 0; }
@media (min-width: 1040px) { .app-grid:has(> :nth-child(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) {
  .app-grid:has(> :nth-child(7)) .app-card { grid-template-areas: "icon name" "icon line" "icon pill"; grid-template-columns: auto 1fr; justify-items: start; }
  .app-grid:has(> :nth-child(7)) .pill { margin-top: var(--s1); }
}

/* principles */
.principles { padding-block: var(--section); }
.principles h2 { margin-bottom: var(--s7); }
.rows { border-bottom: 1px solid var(--line); }
.row { display: grid; gap: var(--s2) var(--s7); padding-block: var(--s5); border-top: 1px solid var(--line); }
.row p { color: var(--muted); max-width: 52ch; }
@media (min-width: 900px) { .row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-block: var(--s6); } }

/* contact: one full field of colour */
.contact { background: var(--band); color: var(--on-band); padding-block: clamp(3.5rem, 9vw, 7rem); }
.contact h2 { max-width: 14em; }
.contact p { margin-top: var(--s4); max-width: 38rem; opacity: 1; }
.contact-mail {
  display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: var(--s6); padding-block: 0.375rem; color: inherit; font-weight: 700; font-stretch: 84%;
  font-size: clamp(1.625rem, 0.6rem + 5.2vw, 3.75rem); line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere;
  text-decoration-thickness: 0.06em; text-underline-offset: 0.16em; text-decoration-color: var(--band-dot);
}
.contact-mail:hover { text-decoration-thickness: 0.1em; }
.contact :focus-visible { outline-color: var(--on-band); }

/* ------------------------------------------------------------------ crumbs */
.crumbs { padding-top: var(--s5); font-size: var(--fs-small); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
.crumbs li { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--c-muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--c-line); }
.crumbs a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--c-muted); }
.crumbs [aria-current] { color: var(--c-ink); font-weight: 600; }

/* ------------------------------------------------------------------ app page (main.app-page[data-app]) */
.app-page { padding-bottom: var(--section); border-block: 1px solid var(--app-line); } /* 1px seam against the stone header and footer */
.app-hero { padding-block: clamp(1.5rem, 4vw, 3rem) var(--section); }
.app-hero-in { display: grid; gap: var(--s5) var(--s7); align-items: start; }
.app-hero .app-icon { --icon: 6rem; box-shadow: 0 18px 36px -14px rgb(0 0 0 / 0.5); }
.app-hero h1 { font-size: var(--fs-display); line-height: 1; letter-spacing: -0.02em; font-stretch: 88%; }
.app-hero .lead { margin-top: var(--s5); }
.app-hero .app-joke { margin-top: var(--s4); font-size: 1rem; line-height: 1.5; color: var(--c-muted); max-width: 40rem; }
.app-status { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s6); color: var(--c-ink); font-weight: 600; }
/* the pill and the note say the same thing: on the page the pill is only the status dot (aria-hidden in the markup), the note is the statement */
.app-status .pill { font-size: 0; min-height: 0; padding: 0; gap: 0; background: none; box-shadow: none; color: var(--app-accent); }
.app-status .pill::before { width: 0.875rem; height: 0.875rem; }
.app-status .pill-coming { color: var(--app-ink); }
.app-status .pill-coming::before { box-shadow: inset 0 0 0 2px currentColor; }
.store { margin-top: var(--s4); }
@media (min-width: 820px) {
  .app-hero-in { grid-template-columns: auto minmax(0, 1fr); }
  .app-hero .app-icon { --icon: 10rem; margin-top: 0.75rem; }
}

.app-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--c-line); }
.app-section-head { display: grid; gap: var(--s3); margin-bottom: var(--s6); max-width: 44rem; }
.app-section-head p { color: var(--c-muted); }

.price-block {
  display: grid; gap: var(--s4) var(--s7); padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-card);
}
.price-block h2 { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem); }
.price-text { font-size: var(--fs-lead); line-height: 1.45; max-width: 36rem; }
.price-text .num { display: inline-block; font-size: 1.75em; line-height: 1; font-weight: 750; font-stretch: 85%; color: var(--c-accent); margin-right: 0.05em; }
.price-block .fine { margin-top: var(--s3); max-width: 46ch; font-size: 0.9375rem; }
@media (min-width: 820px) { .price-block { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

/* list: plain ruled items in two columns; steps: a real sequence, numbered */
.list { display: grid; gap: 0 var(--s7); }
.list > li { padding-block: var(--s5); border-top: 1px solid var(--c-line); }
.list h3 { margin-bottom: var(--s2); }
.list p { color: var(--c-muted); max-width: 46ch; }
@media (min-width: 760px) { .list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.steps { counter-reset: step; display: grid; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0 var(--s4); padding-block: var(--s5); border-top: 1px solid var(--c-line); }
.steps > li::before {
  content: counter(step); grid-row: span 2; font-size: 2.25rem; line-height: 1; font-weight: 750; font-stretch: 80%;
  color: var(--c-accent); font-variant-numeric: tabular-nums;
}
.steps h3 { margin-bottom: var(--s2); }
.steps p { color: var(--c-muted); max-width: 52ch; grid-column: 2; }
@media (min-width: 760px) { .steps > li { grid-template-columns: 5rem minmax(0, 1fr); } .steps > li::before { font-size: 3rem; } }

/* FAQ (details/summary, no JS) */
.faq { border-bottom: 1px solid var(--c-line); max-width: 52rem; }
.faq details { border-top: 1px solid var(--c-line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 3.5rem; padding-block: var(--s3);
  font-weight: 650; font-size: 1.125rem; line-height: 1.3; cursor: pointer; list-style: none; color: var(--c-ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.6rem; height: 0.6rem; margin-right: 0.25rem; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform var(--t) ease-out;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.faq-a { padding-bottom: var(--s5); max-width: 62ch; color: var(--c-ink); }
.faq-a > * + * { margin-top: var(--s3); }
.faq-a a { color: var(--c-accent); }

.legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--s5); margin-top: var(--s4); }
.legal-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--c-accent); font-weight: 600; }

/* ------------------------------------------------------------------ legal documents and support */
.doc-head { padding-block: clamp(1.5rem, 4vw, 3rem) var(--s7); max-width: 48rem; }
.doc-head h1 { margin-top: var(--s3); }
.doc-meta { margin-top: var(--s4); color: var(--muted); font-size: var(--fs-small); }
.doc-summary { margin-top: var(--s5); font-size: var(--fs-lead); line-height: 1.5; max-width: 44rem; }
.doc-layout { display: grid; gap: var(--s6) var(--s8); padding-bottom: var(--section); }

.toc { font-size: 0.9375rem; }
.toc details { border-block: 1px solid var(--line); }
.toc-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 2.75rem; font-weight: 700; cursor: pointer; list-style: none; }
.toc-title::-webkit-details-marker { display: none; }
.toc-title::after { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform var(--t) ease-out; }
.toc details[open] > .toc-title::after { transform: rotate(-135deg); }
.toc a { display: block; min-height: 2.75rem; padding-block: 0.6rem; color: var(--ink); text-decoration: none; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc a:hover { text-decoration: underline; }
.toc-list > li { border-top: 1px solid var(--line); }
.toc-list > li > a { font-weight: 600; }
.toc-sub { display: none; padding-bottom: var(--s2); }
.toc-sub a { min-height: 2.25rem; padding-block: 0.35rem; padding-left: var(--s4); color: var(--muted); }
@media (min-width: 640px) { .toc-list { columns: 2; column-gap: var(--s6); } .toc-list > li { break-inside: avoid; } }
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: 15.5rem minmax(0, 1fr); align-items: start; }
  .toc { position: sticky; top: var(--s5); max-height: calc(100vh - 3rem); overflow-y: auto; padding-right: var(--s3); }
  .toc-list { columns: 1; }
  .toc-sub { display: block; }
  .toc a { min-height: 2.25rem; padding-block: 0.3rem; }
  .toc-sub a { min-height: 2rem; }
  /* collapsed on phones, always open beside the text; where the browser cannot force a closed <details> open it stays collapsible */
  @supports selector(::details-content) {
    .toc details::details-content { content-visibility: visible; display: block; }
    .toc-title { cursor: default; pointer-events: none; }
    .toc-title::after { display: none; }
    .toc details { border-block: 0; }
  }
}

.doc { min-width: 0; max-width: 46rem; }
.doc-sec { padding-top: var(--s7); }
.doc-sec:first-child { padding-top: 0; }
.doc-sec > h2 { padding-top: var(--s6); border-top: 1px solid var(--line); scroll-margin-top: var(--s5); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); }
.doc-sec:first-child > h2 { padding-top: 0; border-top: 0; }
.doc-sec > h3 { margin-top: var(--s6); scroll-margin-top: var(--s5); }
.doc-sec > h3:first-of-type { margin-top: var(--s5); }
.doc-sec > h2 + .prose { margin-top: var(--s4); }
.doc-sec > h3 + .prose { margin-top: var(--s3); }

/* one group per app, headed by a full-width band in the app's own colours with a 4px rule in its accent; its subsections are h3 */
.group-head {
  display: flex; align-items: center; gap: var(--s4); margin-top: var(--s8); padding: var(--s5);
  border-top: 4px solid var(--app-accent); border-radius: 0; scroll-margin-top: var(--s5);
}
.group-head .app-icon { --icon: 3rem; }
.group-head h2 { font-size: var(--fs-h2); line-height: 1.05; padding: 0; border: 0; }
.doc-group > .doc-sec { padding-top: var(--s6); }
.doc-group > .doc-sec:first-of-type { padding-top: var(--s6); }
.doc-group .doc-sec > h3 { margin-top: var(--s6); }
.doc-group .doc-sec:first-of-type > h3 { margin-top: 0; }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s4); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: var(--s2); }
.prose li::marker { color: var(--muted); }
.prose a { color: var(--accent); }
.prose strong { font-weight: 650; }
.prose h4 { font-size: 1.0625rem; font-weight: 650; margin-top: var(--s5); }

.contact-box { margin-top: var(--s6); padding: clamp(1.25rem, 3vw, 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); max-width: 46rem; }
.contact-box p + p { margin-top: var(--s3); }
.contact-box .mail { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: var(--s2); font-size: clamp(1.375rem, 1rem + 1.8vw, 2rem); font-weight: 700; font-stretch: 86%; overflow-wrap: anywhere; }
.support-group .faq { margin-top: var(--s5); }
.support-group > .group-head { margin-top: var(--s8); }
.support-main .doc-head { max-width: 48rem; }

/* ------------------------------------------------------------------ 404 */
.nf { padding-block: clamp(3rem, 9vw, 7rem); }
.nf-code { display: block; font-size: clamp(7rem, 30vw, 17rem); line-height: 0.85; font-weight: 800; font-stretch: 86%; letter-spacing: -0.02em; color: var(--accent); }
.nf h1 { margin-top: var(--s5); }
.nf p { margin-top: var(--s4); color: var(--muted); max-width: 40ch; font-size: var(--fs-lead); }
.nf .btn { margin-top: var(--s6); }

/* ------------------------------------------------------------------ Kuido public page (PHP: /kuido/p/<CODE>)
   body.themed.pub[data-app="kuido"]: one column for a stranger on a phone. Uses the app palette and the generic parts above. */
.pub-main { width: min(100% - 2 * var(--gutter), 26rem); margin-inline: auto; padding-block: var(--s5) var(--s6); display: flex; flex-direction: column; align-items: center; gap: var(--s4); text-align: center; }
.pub-brand { --icon: 2rem; display: flex; align-items: center; gap: 0.625rem; font-weight: 700; font-stretch: 88%; letter-spacing: -0.01em; }
.pub-brand .app-icon { box-shadow: none; }
.pub-photo { width: min(68vw, 14rem); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; margin-top: var(--s3); background: var(--app-surface); border: 1px solid var(--app-line); }
.pub-photo-none { display: grid; place-items: center; color: var(--app-muted); font-size: var(--fs-small); }
.pub-main h1 { font-size: clamp(1.875rem, 1.45rem + 2.4vw, 2.5rem); overflow-wrap: anywhere; }
.pub-lead { font-size: 1.125rem; line-height: 1.5; color: var(--app-muted); max-width: 24rem; overflow-wrap: anywhere; }
.pub-call { width: 100%; min-height: 3.75rem; padding: 0.75rem 1.25rem; margin-top: var(--s2); font-size: 1.25rem; text-align: center; overflow-wrap: anywhere; }
.pub-phone { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem; color: var(--app-muted); overflow-wrap: anywhere; }
.pub-phone strong { color: var(--app-ink); font-size: 1.25rem; }
.pub-note { width: 100%; padding: var(--s5); border: 1px solid var(--app-line); border-radius: var(--r-card); background: var(--app-surface); text-align: left; }
.pub-note h2 { font-size: 1.25rem; font-stretch: 100%; line-height: 1.25; }
.pub-note p { margin-top: var(--s2); color: var(--app-muted); }
.pub-clinic { width: 100%; padding: var(--s5); border: 1px solid var(--app-line); border-radius: var(--r-card); background: var(--app-surface); display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.pub-clinic h2 { font-size: 1.25rem; font-stretch: 100%; line-height: 1.25; }
.pub-clinic .pub-lead { font-size: 1rem; }
.pub-clinic .pub-call { font-size: 1.125rem; min-height: 3.25rem; margin-top: 0; }
.pub-clinic .pub-map { margin-top: 0; }
.pub-privacy { margin-top: var(--s3); max-width: 22rem; font-size: var(--fs-small); line-height: 1.5; color: var(--app-muted); }
.pub-foot { margin-top: auto; padding: var(--s4) var(--gutter) var(--s5); border-top: 1px solid var(--app-line); text-align: center; font-size: var(--fs-small); color: var(--app-muted); }
.pub-foot a { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.5rem; font-size: 1rem; font-weight: 600; }
@supports (padding: max(0px)) { .pub-foot { padding-bottom: max(var(--s5), env(safe-area-inset-bottom)); } }

/* ------------------------------------------------------------------ footer */
.site-foot { margin-top: auto; border-top: 1px solid var(--line); padding-block: var(--s7) var(--s6); font-size: 0.9375rem; }
.foot-grid { display: grid; gap: var(--s6) var(--s7); }
.foot-brand .brand { margin-bottom: var(--s2); }
.foot-brand p { color: var(--muted); max-width: 32ch; }
.foot-h { display: flex; align-items: center; min-height: 2.75rem; font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; margin: 0 0 var(--s2); line-height: 1.3; }
.foot-links a { display: flex; align-items: center; min-height: 2.75rem; color: var(--ink); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-apps:has(> :nth-child(6)) { columns: 2; column-gap: var(--s5); }
.foot-bottom { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); display: grid; gap: var(--s1); }
@media (min-width: 720px) { .foot-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 720px) and (max-width: 899px) { .foot-brand { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ motion: one moment, the dot of the mark arriving */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .mark-dot { transform-box: fill-box; transform-origin: center; animation: dot-in 800ms var(--ease) 200ms both; }
  @keyframes dot-in {
    from { transform: translate(-25%, -180%); opacity: 0; }
    60% { opacity: 1; }
    to { transform: none; opacity: 1; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
}

@media print {
  .site-head, .site-foot, .toc, .skip { display: none; }
  body { background: #fff; color: #000; }
}


/* ------------------------------------------------------------------ K-Even landing (main.kv[data-app="keven"])
   Neón palette from the generated [data-app] block. Titles: Bricolage Grotesque 800, tracking -0.025em (brand tokens). */
.kv { --kv-band: #8e7fe3; --kv-on-band: #1e1830; }
.kv h1, .kv h2 { font-weight: 800; font-stretch: 100%; letter-spacing: -0.025em; }
.kv h3 { font-weight: 700; letter-spacing: -0.015em; }
.btn-cta { background: var(--app-cta); color: var(--app-on-cta); }
.btn-cta:hover { background: color-mix(in srgb, var(--app-cta) 88%, #888); }
.kv-soon {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 3rem; padding: 0 1.25rem; margin: 0; border-radius: 99px;
  box-shadow: inset 0 0 0 2px var(--app-muted); color: var(--app-ink); font-weight: 650; font-size: 1rem;
}
.kv-soon::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--app-accent); flex: none; }
.kv-hero { padding-block: clamp(1rem, 4vw, 2.5rem) clamp(3rem, 7vw, 6rem); overflow: hidden; }
.kv-hero-in { display: grid; gap: var(--s7); align-items: center; }
.kv-icon { --icon: 4.5rem; margin-bottom: var(--s5); }
.kv-hero h1 { font-size: clamp(2.75rem, 1.2rem + 7vw, 6rem); line-height: 0.98; max-width: 9em; }
.kv-hero .lead { margin-top: var(--s5); }
.kv-cta { margin-top: var(--s6); }
.kv-note { margin-top: var(--s4); max-width: 34rem; }
.kv-phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; max-width: 34rem; }
.kv-shot { display: block; width: 100%; height: auto; border-radius: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--app-line); background: var(--app-surface); }
.kv-shot-b { margin-top: clamp(2rem, 8vw, 4.5rem); }
@media (min-width: 900px) {
  .kv-hero-in { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s8); }
  .kv-phones { max-width: none; margin-right: -1rem; }
  .kv-shot-a { transform: rotate(-3deg); }
  .kv-shot-b { transform: rotate(2.5deg); margin-top: 5rem; }
}
.kv-sec { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--app-line); }
.kv-sec h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); line-height: 1; }
.kv-feat-in { display: grid; gap: var(--s7); }
.kv-feats { margin-top: var(--s6); display: grid; }
.kv-feats > li { padding-block: var(--s5); border-top: 1px solid var(--app-line); max-width: 46rem; }
.kv-feats h3 { margin-bottom: var(--s2); }
.kv-feats p { color: var(--app-muted); max-width: 46ch; }
.kv-feat-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; max-width: 34rem; }
.kv-feat-shots .kv-shot:nth-child(2) { margin-top: clamp(2rem, 8vw, 4.5rem); }
@media (min-width: 900px) {
  .kv-feat-in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s8); align-items: start; }
  .kv-feat-shots { position: sticky; top: var(--s5); max-width: 28rem; margin-left: auto; margin-top: 4.5rem; }
}
/* plan table: a real table from 700px; below, every row becomes a block with the column names beside each value */
.kv-tablewrap { margin-top: var(--s2); }
.kv-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
.kv-table thead th { text-align: left; padding: var(--s3) var(--s4); font-weight: 800; font-size: 1.125rem; border-bottom: 2px solid var(--app-ink); }
.kv-table tbody th { text-align: left; font-weight: 650; padding: var(--s4); vertical-align: top; }
.kv-table td { padding: var(--s4); vertical-align: top; color: var(--app-ink); }
.kv-table tbody tr { border-bottom: 1px solid var(--app-line); }
.kv-table td:last-child { background: var(--app-surface); }
@media (max-width: 699px) {
  .kv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .kv-table, .kv-table tbody, .kv-table tr, .kv-table th, .kv-table td { display: block; }
  .kv-table tbody tr { padding-block: var(--s4); }
  .kv-table tbody th { padding: 0 0 var(--s2); }
  .kv-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s3); padding: var(--s2) 0; background: none !important; }
  .kv-table td::before { content: attr(data-label); font-weight: 700; color: var(--app-muted); }
}
.kv-plan-note { margin-top: var(--s6); max-width: 52rem; color: var(--app-muted); }
.kv-plan-note a { color: var(--app-accent); }
.kv-last { background: var(--kv-band); color: var(--kv-on-band); padding-block: clamp(3.5rem, 9vw, 7rem); }
.kv-last h2 { font-size: clamp(2.5rem, 1.2rem + 6vw, 5.5rem); line-height: 0.98; max-width: 10em; }
.kv-last .btn-cta { background: #1e1830; color: #c6ff24; }
.kv-last .kv-soon { box-shadow: inset 0 0 0 2px #1e1830; color: #1e1830; }
.kv-last .kv-soon::before { background: #1e1830; }
.kv-last-links { margin-top: var(--s6); font-weight: 600; }
.kv-last-links a { color: inherit; display: inline-flex; align-items: center; min-height: 2.75rem; }
.kv-last :focus-visible { outline-color: #1e1830; }
.contact-box .contact-h { font-size: 1.5rem; margin-bottom: var(--s3); }
.doc-intro { margin-top: var(--s4); max-width: 44rem; color: var(--muted); }
.doc-group > .doc-intro { padding: var(--s4) var(--s5) 0; }

/* Generated from each app definition (app.mjs in src/apps). Do not edit by hand. */
[data-app="crazyblocks"]{--app-bg:#0F172A;--app-surface:#1E293B;--app-ink:#F8FAFC;--app-muted:#B4C0D2;--app-accent:#FB923C;--app-on-accent:#0F172A;--app-line:#334155}
[data-app="kuido"]{--app-bg:#F3F5F9;--app-surface:#FFFFFF;--app-ink:#121A2B;--app-muted:#586074;--app-accent:#1F5EFF;--app-on-accent:#FFFFFF;--app-line:#D5D9E2}
[data-app="keven"]{--app-bg:#FFFFFF;--app-surface:#F1EFFC;--app-ink:#1E1830;--app-muted:#5B5378;--app-accent:#5B45C9;--app-on-accent:#FFFFFF;--app-line:#DAD5F1;--app-cta:#1E1830;--app-on-cta:#C6FF24}
@media (prefers-color-scheme: dark){
[data-app="crazyblocks"]{--app-bg:#0B1222;--app-surface:#18233A;--app-ink:#F8FAFC;--app-muted:#B4C0D2;--app-accent:#FB923C;--app-on-accent:#0F172A;--app-line:#2A3750}
[data-app="kuido"]{--app-bg:#0C111C;--app-surface:#171E2D;--app-ink:#EEF1F6;--app-muted:#A3ABBD;--app-accent:#5B8CFF;--app-on-accent:#0C111C;--app-line:#262E40}
[data-app="keven"]{--app-bg:#1E1830;--app-surface:#2A2242;--app-ink:#F3F1FD;--app-muted:#B9AFF3;--app-accent:#C6FF24;--app-on-accent:#1E1830;--app-line:#3A3158;--app-cta:#C6FF24;--app-on-cta:#1E1830}
}
