/* ---------------------------------------------------------------------------------------------------------------
 * The portal's gallery (index.html). Calm, light, confident: the homes carry the colour, the page stays out of
 * the way. Colours are the CI design canon's semantic set, mirrored from @companionintelligence/tokens tokens.css
 * (CI-Common styles/tokens/src/) because this page is served standalone with no package to import them from:
 * re-copy them from there, never edit a value here. Light is :root, dark follows the system. Page-local values
 * carry the --pg-* prefix.
 * ------------------------------------------------------------------------------------------------------------- */

@font-face {
  font-family: "PG Manrope";
  src: url("../assets/fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --radius: 0.625rem;
  --font-letter-spacing: 0.2pt;
  --font-word-spacing: 0.4pt;
  --font-sans: "PG Manrope", "Manrope", system-ui, sans-serif;
  /* canon: semantic set, light */
  --background: #f3faf7;
  --foreground: #0a222e;
  --card: #f0f9f5;
  --popover: #f4fdfa;
  --primary: #0a6358;
  --primary-foreground: #f0fdf4;
  --secondary: #e8f2ec;
  --muted: #e8f2ec;
  --muted-foreground: #3a524b;
  --accent: #edf6f0;
  --border: #dfece6;
  --ring: #0a6358;
  --heat: #ff3f00;
  --phthalo-hover: #0d7a6e;
  --shadow-sm: 0 1px 2px rgba(4, 22, 32, 0.04), 0 4px 12px -4px rgba(10, 99, 88, 0.05);
  --shadow-md: 0 1px 3px rgba(4, 22, 32, 0.05), 0 6px 18px -6px rgba(10, 99, 88, 0.07);
  --shadow-lg: 0 2px 4px rgba(4, 22, 32, 0.05), 0 10px 24px -8px rgba(10, 99, 88, 0.08);
  --gradient-aurora: radial-gradient(1200px circle at 50% -20%, rgba(232, 242, 236, 0.65), transparent 52%),
    radial-gradient(900px circle at 80% 0%, rgba(10, 99, 88, 0.04), transparent 45%);
  /* page */
  --pg-surface: #ffffff;
  --pg-ink: #041620;                                   /* canon dark --background: the dialog's backdrop in both themes */
  --pg-logo-bg: #ffffff;                               /* a real logo sits on a white tile in both themes, so a dark mark stays visible */
  --pg-hairline: color-mix(in srgb, var(--foreground) 9%, transparent);
  --pg-thumb-bg: var(--secondary);
  --pg-wide: 1240px;
  --pg-gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    /* canon: semantic set, dark */
    --background: #041620;
    --foreground: #e8f2f4;
    --card: #0c323c;
    --popover: #143e48;
    --primary: #c5e8dc;
    --primary-foreground: #041620;
    --secondary: #073038;
    --muted: #073038;
    --muted-foreground: #a3babf;
    --accent: #0a2e38;
    --border: #073038;
    --ring: #c5e8dc;
    --phthalo-hover: #daf2ea;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 4px 12px -6px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.24), 0 6px 18px -8px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.26), 0 10px 24px -10px rgba(0, 0, 0, 0.36);
    --gradient-aurora: radial-gradient(1200px circle at 50% -20%, rgba(200, 230, 217, 0.08), transparent 55%),
      radial-gradient(800px circle at 15% 10%, rgba(4, 22, 32, 0.5), transparent 50%);
    --pg-surface: #0c323c;
    --pg-hairline: color-mix(in srgb, var(--foreground) 10%, transparent);
    --pg-thumb-bg: #073038;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  background-image: var(--gradient-aurora);
  background-repeat: no-repeat;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: var(--font-letter-spacing);
  word-spacing: var(--font-word-spacing);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; letter-spacing: inherit; word-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }
kbd {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 11px; letter-spacing: 0;
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--pg-hairline); color: var(--muted-foreground);
}
.skip { position: absolute; left: 12px; top: -60px; padding: 8px 12px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); z-index: 10; }
.skip:focus { top: 12px; }

/* ---------------- header ---------------- */
.site-head {
  max-width: var(--pg-wide);
  margin: 0 auto;
  padding: 14px var(--pg-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
/* the brand row: Companion Intelligence (the main site) / Virtual homes (the top of this one). Two links on one
   line, not stacked, so each is a target of its own; the logo is the main site's link on a screen too narrow for its name */
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand a { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; color: inherit; text-decoration: none; border-radius: 8px; }
.brand-ci span { font-size: 13px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; }
.brand-ci:hover span { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.brand-sep { color: var(--muted-foreground); opacity: 0.55; }
.brand-title { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px;
  color: var(--muted-foreground); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 0 12px; border-radius: 999px;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--foreground); background: var(--pg-hairline); }
.site-nav .nav-buy { margin-left: 4px; padding: 0 16px; background: var(--primary); color: var(--primary-foreground); font-weight: 700; box-shadow: var(--shadow-sm); }
.site-nav .nav-buy:hover { background: var(--phthalo-hover); color: var(--primary-foreground); }
.nav-short { display: none; }

/* ---------------- hero ----------------
   Sized so the first row of homes starts inside the first screen: on a 1440 × 900 laptop the thumbnails of the
   first row show under the hero, and on a shorter screen (or a tablet, stacked) the eyebrow and the figures give
   way before the homes do. */
.hero {
  max-width: var(--pg-wide);
  margin: 0 auto;
  padding: clamp(12px, 1.8vw, 24px) var(--pg-gutter) clamp(28px, 2.8vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  margin: 0 0 10px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
}
/* "Fictional family. Real software.": on the front page and a home's page it is always on screen, on a phone too (the ad rules) */
.fiction-label {
  display: inline-flex; align-items: center;
  min-height: 28px; margin: 0 0 12px; padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--primary);
  font-size: 13px; font-weight: 700; letter-spacing: 0.01em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.3vw, 52px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-spacing: 0;
  text-wrap: balance;
}
.lede {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted-foreground);
  text-wrap: pretty;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px;
  text-decoration: none;
  border: 0; cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn .i { width: 16px; height: 16px; }
.btn-primary, .btn-buy { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-md); }
.btn-primary:hover, .btn-buy:hover { background: var(--phthalo-hover); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--pg-hairline); }
.btn-ghost:hover { background: var(--pg-hairline); }
.hero-media {
  position: relative;
  display: block;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--pg-thumb-bg);
  box-shadow: var(--shadow-lg), 0 30px 60px -30px rgba(4, 22, 32, 0.35);
  isolation: isolate;
}
.hero-media picture { display: block; width: 100%; height: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hero-media:hover img { transform: scale(1.025); }
.hero-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); pointer-events: none; }
.hero-badge {
  position: absolute; left: 16px; top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  color: #e8f2f4;                                     /* canon dark --foreground, on the glass */
  background: color-mix(in srgb, #041620 55%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-badge .i { width: 14px; height: 14px; }
.hero-play {
  position: absolute; left: 50%; top: 50%;
  width: 72px; height: 72px; margin: -36px 0 0 -36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #041620;                                     /* canon dark --background on the sage disc */
  background: color-mix(in srgb, #c5e8dc 92%, transparent);
  box-shadow: 0 10px 30px -8px rgba(4, 22, 32, 0.5);
  transition: transform 0.25s ease;
}
.hero-play .i { width: 26px; height: 26px; margin-left: 4px; }
.hero-media:hover .hero-play { transform: scale(1.06); }

/* ---------------- homes ---------------- */
.homes {
  max-width: var(--pg-wide);
  margin: 0 auto;
  padding: 0 var(--pg-gutter) 72px;
  scroll-margin-top: 16px;
}
.homes-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pg-hairline);
}
.homes h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; }
.count { font-size: 14px; font-weight: 500; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; width: 340px; padding: 0 10px 0 14px;
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
  color: var(--muted-foreground);
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--ring), var(--shadow-sm); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--foreground); font-size: 14px; }
.search input::placeholder { color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search .i { width: 16px; height: 16px; }
/* The storeys control and the style tags are small pills with a 44 px touch target: the element is 44 px tall
   and a transparent border keeps the drawn pill (background-clip: padding-box) at its visual size. */
.seg {
  display: inline-flex; align-items: center; padding: 0 3px; gap: 2px;
  height: 44px;
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
}
.seg-label { padding: 0 6px 0 12px; font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; }
.seg button {
  height: 44px; min-width: 44px; padding: 0 13px;
  border: 0; border-block: 5px solid transparent; background-clip: padding-box;
  border-radius: 999px; background-color: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.seg button:hover { color: var(--foreground); }
.seg button[aria-pressed="true"] { background-color: var(--primary); color: var(--primary-foreground); }
.tag {
  height: 44px; padding: 0 13px;
  border: 0; border-block: 6px solid transparent; background-clip: padding-box;
  border-radius: 999px; cursor: pointer;
  background-color: transparent;
  font-size: 13px; font-weight: 600; color: var(--muted-foreground);
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
/* the hairline ring, drawn on the pill (an inset shadow would ring the whole 44 px box) */
.tag::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--pg-hairline); pointer-events: none; }
.tag small { font-size: 11.5px; font-weight: 600; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tag:hover:not(:disabled) { color: var(--foreground); background-color: var(--pg-hairline); }
.tag[aria-pressed="true"] { background-color: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.tag[aria-pressed="true"]::before { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.tag[aria-pressed="true"] small { color: inherit; }
.tag:disabled { cursor: default; color: color-mix(in srgb, var(--muted-foreground) 55%, transparent); }
.tag:disabled small { color: inherit; }
/* what they do: the filter a story visitor reaches for first (work from home, code, play, study, make, host), above the home style row */
/* the style and storeys filters are for browsing homes: one line that opens them (the script opens it on a wide screen) */
.grid {
  list-style: none; margin: 0; padding: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 34px 26px;
}
.card a { display: block; color: inherit; text-decoration: none; border-radius: 16px; }
.card a:focus-visible { outline-offset: 6px; }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--pg-thumb-bg);
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
  isolation: isolate;
}
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--foreground) 8%, transparent); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.thumb.missing img { opacity: 0; }
/* a thumbnail that did not load: the home's initial and name on a tinted tile */
.thumb-missing {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 16%, var(--pg-thumb-bg)), var(--pg-thumb-bg));
  color: var(--primary);
}
.thumb-missing b { font-size: 40px; line-height: 1; font-weight: 200; }
.thumb-missing span { font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.card a:hover .thumb, .card a:focus-visible .thumb { transform: translateY(-3px); box-shadow: var(--shadow-lg), 0 18px 36px -18px rgba(4, 22, 32, 0.35); }
.card a:hover .thumb img { transform: scale(1.035); }
.thumb-play {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  color: #041620;                                     /* canon dark --background on the sage pill */
  background: color-mix(in srgb, #c5e8dc 94%, transparent);
  box-shadow: 0 6px 16px -6px rgba(4, 22, 32, 0.45);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.thumb-play .i { width: 12px; height: 12px; }
.card a:hover .thumb-play, .card a:focus-visible .thumb-play { opacity: 1; transform: none; }
.card-body { padding: 14px 2px 0; }
.card h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.card .style {
  margin: 3px 0 0;
  font-size: 13.5px; color: var(--muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .facts { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.fact { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--secondary); color: var(--foreground); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted-foreground); }
.empty p { margin: 0 0 16px; }
.empty b { color: var(--foreground); }
.empty .btn-primary .i { width: 16px; height: 16px; }

/* a family's card (scripts/portal-front.mts familyCard): the home's picture, the family and its home, who lives there and the job each
   does, the apps that tell the story. The family's name is the link, stretched over the card, so the text stays a heading and two
   lists; the picture and the rest are not links of their own. */
.card-family { position: relative; display: flex; flex-direction: column; }
.card-family .card-body { flex: 1; display: flex; flex-direction: column; padding: 14px 2px 0; }
.card-family h3 { font-size: 18px; }
.card-family h3 a { display: block; color: inherit; text-decoration: none; }
.card-family h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.card-family h3 a:focus-visible { outline: none; }
.card-family:has(h3 a:focus-visible) { outline: 2px solid var(--ring); outline-offset: 6px; border-radius: 16px; }
.card-family:hover .thumb, .card-family:focus-within .thumb { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-family:hover .thumb img { transform: scale(1.035); }
.card-family:hover .thumb-play, .card-family:focus-within .thumb-play { opacity: 1; transform: none; }
.home-line { margin: 3px 0 0; font-size: 13.5px; color: var(--muted-foreground); }
.cast { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px 12px; }
.cast li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.disc {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 26%, transparent);
  color: var(--primary); font-size: 15px; font-weight: 700; line-height: 1;
}
.who { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; line-height: 1.25; color: var(--muted-foreground); }
.who b { color: var(--foreground); font-size: 13.5px; font-weight: 600; }
.apps {
  list-style: none; margin: 14px 0 0; padding: 12px 0 0;
  display: grid; gap: 3px;
  border-top: 1px solid var(--pg-hairline);
  font-size: 13px; color: var(--muted-foreground);
}
.apps b { color: var(--foreground); font-weight: 600; }
/* story v2: the app's real logo, 20 px, beside its line (the tile is portal/media.css's .logo) */
.apps li { display: flex; align-items: center; gap: 8px; }
.apps .logo { width: 20px; height: 20px; padding: 1px; border-radius: 5px; }
.go { margin: auto 0 0; padding-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--primary); }
.go .i { width: 15px; height: 15px; transition: transform 0.2s ease; }
.card-family:hover .go .i { transform: translateX(3px); }

/* placeholder cards while index.json loads */
.skel .thumb { box-shadow: none; }
.skel .thumb, .skel i { background: var(--pg-thumb-bg); animation: pg-pulse 1.6s ease-in-out infinite; }
.skel i { display: block; height: 12px; border-radius: 6px; margin-top: 10px; }
.skel i:nth-child(1) { width: 55%; height: 15px; margin-top: 2px; }
.skel i:nth-child(2) { width: 80%; }
.skel i:nth-child(3) { width: 40%; height: 22px; border-radius: 999px; margin-top: 12px; }
@keyframes pg-pulse { 50% { opacity: 0.55; } }

/* ---------------- the Companion Core band, after the homes ---------------- */
.cta-band {
  width: min(calc(100% - 2 * var(--pg-gutter)), calc(var(--pg-wide) - 2 * var(--pg-gutter)));
  margin: 0 auto 56px;
  padding: clamp(20px, 3vw, 32px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
}
.cta-copy { flex: 1 1 320px; max-width: 40em; }
.cta-copy h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.cta-copy p { margin: 0; color: var(--muted-foreground); text-wrap: pretty; }
.cta-copy .cta-note { margin-top: 6px; font-size: 13px; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.cta-docs { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 600; font-size: 14.5px; text-underline-offset: 3px; }

/* ---------------- footer ---------------- */
.site-foot {
  max-width: var(--pg-wide);
  margin: 0 auto;
  padding: 32px var(--pg-gutter) 48px;
  border-top: 1px solid var(--pg-hairline);
  color: var(--muted-foreground);
  font-size: 13px;
}
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; }
.foot-grid p { margin: 0 0 6px; max-width: 46em; }
.foot-grid b { color: var(--foreground); font-weight: 700; }
.foot-brand { display: flex; align-items: center; gap: 8px; min-height: 28px; color: var(--foreground); }
.foot-links ul { list-style: none; margin: 0; padding: 0; }
.foot-links a { display: inline-flex; align-items: center; min-height: 28px; font-weight: 600; text-underline-offset: 3px; }
/* every home's own page (scripts/portal-pages.mts galleryHomeIndex) */
.foot-homes { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--pg-hairline); }
.foot-homes p { margin: 0 0 6px; }
.foot-homes b { color: var(--foreground); font-weight: 700; }
.foot-homes ul { list-style: none; margin: 0; padding: 0; columns: 4 150px; column-gap: 28px; }
.foot-homes li { break-inside: avoid; }
.foot-homes a { display: inline-flex; align-items: center; min-height: 28px; font-weight: 600; text-underline-offset: 3px; }
.foot-notes { margin-top: 20px; }
.foot-notes p { margin: 0 0 7px; max-width: 62em; font-size: 12.5px; line-height: 1.45; }
.legal { margin: 28px 0 0; font-size: 12px; }

/* ---------------- a home's own page (homes/<id>, written by scripts/build-portal.mts) ---------------- */
.crumbs { max-width: var(--pg-wide); margin: 0 auto; padding: 4px var(--pg-gutter) 0; font-size: 13.5px; color: var(--muted-foreground); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.55; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--foreground); font-weight: 600; }
.home-page .hero h1 { font-size: clamp(32px, 4vw, 48px); }
.home-page .hero-media { aspect-ratio: 1200 / 630; }
.home-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.home-facts .fact { height: 28px; padding: 0 12px; font-size: 13px; }
.family-block {
  width: min(calc(100% - 2 * var(--pg-gutter)), calc(var(--pg-wide) - 2 * var(--pg-gutter)));
  margin: 0 auto 28px; padding: clamp(20px, 3vw, 32px);
  border-radius: 22px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
}
.family-block h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.family-block p { margin: 0; max-width: 40em; color: var(--muted-foreground); text-wrap: pretty; }
.family-block .fiction-label { margin: 14px 0 0; }
.family-block .hero-cta { margin-top: 16px; }
.home-note { margin: 14px 0 0; max-width: 34em; font-size: 13.5px; color: var(--muted-foreground); text-wrap: pretty; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* a short desktop screen (a 1280 × 800 laptop, a 1024 × 768 tablet on its side): the eyebrow and the figures go,
   so the homes start on the first screen */
@media (min-width: 901px) and (max-height: 860px) {
}

/* ---------------- narrow ---------------- */
/* Stacked (a tablet held upright): the picture, a shorter one, over the copy; no eyebrow, no figures and no second
   sentence, so the first homes start inside the first screen; the heading and the filters share a row when they fit. */
@media (max-width: 1100px) {
  .site-nav .nav-homes { display: none; }
}
@media (max-width: 900px) {
  .brand-ci span { display: none; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-media { order: -1; aspect-ratio: 21 / 9; border-radius: 18px; }
  .search { flex: 1 1 220px; width: auto; }
  .search kbd { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-links ul { columns: 2 180px; column-gap: 28px; }
}
@media (max-width: 700px) {
  .site-nav .nav-docs, .site-nav .nav-download { display: none; }
  .homes-head { align-items: stretch; flex-direction: column; }
}
/* Phones: the hero keeps the picture, the headline, the Core line and one button (the stats and the second
   button are for wider screens), the filters sit in two rows, and the homes go two to a row, compact: name
   and picture, so the first homes show on the first screen. */
@media (max-width: 520px) {
  .site-head { padding-top: 10px; padding-bottom: 8px; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .site-nav .nav-buy { padding: 0 14px; }
  .hero { padding-top: 2px; padding-bottom: 28px; gap: 18px; }
  .hero-media { aspect-ratio: 16 / 9; }
  .hero-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  .hero-play .i { width: 22px; height: 22px; }
  .hero h1 { font-size: 34px; }
  .lede { font-size: 15.5px; margin-top: 10px; }
  .cta-actions .btn { flex: 1 1 auto; }
  .hero-cta { margin-top: 18px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .homes-head { gap: 10px; padding-bottom: 12px; }
  .search { height: 44px; }
  .search kbd { display: none; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 6px; }
  .tag { flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; padding-top: 14px; }
  .thumb { border-radius: 11px; }
  .card-body { padding-top: 8px; }
  .card h3 { font-size: 14px; line-height: 1.25; }
  .card .style { display: none; }
  .card .facts { display: none; }
  /* on a two-up card the pill is only its play mark */
  .thumb-play { right: 6px; bottom: 6px; width: 28px; height: 28px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .thumb-play .i { width: 11px; height: 11px; margin-left: 2px; }
  .thumb-missing b { font-size: 28px; }
  .thumb-missing span { font-size: 11.5px; }
}
@media (pointer: coarse) {
  .search { height: 44px; }
  .site-nav a, .brand a, .foot-links a { min-height: 44px; }
  .foot-homes a { min-height: 36px; }
}
@media (hover: none) {
  .thumb-play { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ===================================================== the lander (reference/story/lander.md) ===================================================== */
/* The header is sticky, so Buy and Download are in reach at every scroll position, on a phone too. The bar spans the page; its content keeps the column. */
html { scroll-padding-top: 72px; }
.site-head {
  position: sticky; top: 0; z-index: 30;
  max-width: none; margin: 0;
  padding: 8px max(var(--pg-gutter), calc((100% - var(--pg-wide)) / 2 + var(--pg-gutter)));
  background: color-mix(in srgb, var(--background) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--pg-hairline);
}
#argument, #proof, #core, #swap, #homes { scroll-margin-top: 72px; }
#cta-title:focus { outline: none; }

/* hero: two chips (the fiction label and the beta line), the message, what a Core is, one action */
.hero { align-items: start; padding-top: clamp(20px, 3vw, 40px); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.hero-chips .fiction-label { margin: 0; }
.beta-chip {
  margin: 0; display: inline-flex; align-items: center; min-height: 28px; padding: 4px 12px; border-radius: 14px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--pg-hairline);
  color: var(--muted-foreground); font-size: 13px; font-weight: 600; line-height: 1.3;
}
.hero h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; }
.hero .lede { margin-top: 18px; max-width: 30em; font-size: clamp(16.5px, 1.5vw, 19px); color: var(--foreground); }
.lede-families { margin: 10px 0 0; max-width: 30em; font-size: 15.5px; line-height: 1.55; color: var(--muted-foreground); text-wrap: pretty; }
.hero-cta { align-items: center; gap: 4px 22px; margin-top: 24px; }
.hero-pointer { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; font-size: 15px; color: var(--foreground); text-underline-offset: 3px; }
.hero-pointer .i { width: 16px; height: 16px; }
.hero-hint { margin: 8px 0 0; font-size: 13.5px; color: var(--muted-foreground); }
.hero-noscript { margin: 12px 0 0; font-size: 14px; color: var(--muted-foreground); }

/* the blocks after the hero share one column and one rhythm */
.argument, .proof, .swap { max-width: var(--pg-wide); margin: 0 auto; padding-left: var(--pg-gutter); padding-right: var(--pg-gutter); }
.argument h2, .proof h2, .swap h2 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.argument { padding-top: clamp(8px, 2vw, 24px); padding-bottom: clamp(32px, 4.5vw, 56px); }
.argument-steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.argument-steps > li { counter-increment: step; padding: 22px 22px 20px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--pg-hairline); }
.argument-steps h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.argument-steps h3::before {
  content: counter(step); flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--primary-foreground); font-size: 14px; font-weight: 700;
}
.argument-steps p { margin: 0 0 10px; color: var(--muted-foreground); line-height: 1.6; text-wrap: pretty; }
.argument-steps p:last-child { margin-bottom: 0; }
.argument-more a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; text-underline-offset: 3px; }

/* one pair, in full: the service rented, the app that is an alternative, the honest limit, a way into that very moment of the tour */
.proof { padding-bottom: clamp(32px, 4.5vw, 56px); }
.proof-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.proof-pair { margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.proof-pair > div { position: relative; padding: 20px 22px; border-radius: 18px; }
.proof-before { background: var(--muted); }
.proof-after { background: color-mix(in srgb, var(--primary) 9%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 32%, transparent); }
.proof-after::before {
  content: ""; position: absolute; left: -17px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-top: 2px solid var(--primary); border-right: 2px solid var(--primary); transform: rotate(45deg);
}
.proof-pair dt { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.proof-after dt { color: var(--primary); }
.proof-pair dd { margin: 0; font-size: 17px; line-height: 1.55; text-wrap: pretty; }
.proof-before dd { color: var(--muted-foreground); }
.proof-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--pg-surface); box-shadow: inset 0 0 0 1px var(--pg-hairline); }
.proof-chips .chip:first-child { color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 42%, transparent); }
.proof-limit { margin: 12px 0 0; font-size: 14px; color: var(--muted-foreground); }
.proof-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 20px 0 0; }
.proof-family { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-underline-offset: 3px; }

/* the Core: what it is (claims.json's words), its picture, the offer, what it is not */
.cta-band { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 20px 40px; margin-bottom: clamp(32px, 4.5vw, 56px); }
.cta-band.has-fig { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
.cta-band .cta-copy { max-width: none; }
.cta-copy h2 { margin: 0 0 12px; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.015em; line-height: 1.15; }
.cta-copy .cta-lead { margin: 0; font-size: clamp(18px, 1.9vw, 22px); line-height: 1.45; color: var(--foreground); text-wrap: pretty; }
.cta-facts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; color: var(--muted-foreground); }
.cta-facts li { position: relative; padding-left: 20px; line-height: 1.5; }
.cta-facts li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.cta-band .cta-actions { margin-top: 22px; }
.core-fig { margin: 0; grid-column: 2; grid-row: 1; }
.core-fig picture, .core-fig img { display: block; width: 100%; height: auto; }
.core-fig img { border-radius: 16px; box-shadow: var(--shadow-md); }
.core-fig figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted-foreground); }
.cta-limits { grid-column: 1 / -1; display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--pg-hairline); }
.cta-limits p, .cta-copy .cta-limits p { margin: 0; max-width: 62em; font-size: 13.5px; line-height: 1.5; color: var(--muted-foreground); }

/* "What do you rent today?": the chooser. One chip for each service (the service, the app that is an alternative under it), the jobs, a search */
.swap { padding-bottom: clamp(28px, 3.5vw, 44px); }
.swap-lead { margin: 8px 0 0; color: var(--muted-foreground); line-height: 1.55; }
.swap .search { width: min(100%, 540px); margin-top: 18px; }
.pairs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.pair {
  width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 14px;
  border: 0; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; color: var(--foreground);
  background: var(--pg-surface); box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.pair b { font-size: 15px; font-weight: 700; }
.pair span { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--primary); }
.pair .i { width: 13px; height: 13px; }
.pair:hover:not(:disabled) { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent), var(--shadow-md); }
.pair[aria-pressed="true"] { background: color-mix(in srgb, var(--primary) 8%, var(--pg-surface)); box-shadow: inset 0 0 0 2px var(--primary), var(--shadow-md); }
.pair:disabled { cursor: default; opacity: 0.5; }
html:not([data-gallery]) .pair:disabled, html:not([data-gallery]) .search input:disabled { opacity: 1; }
.jobs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin-top: 18px; }
.jobs-label { margin-right: 6px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.jobs .tag { font-size: 14px; color: var(--foreground); padding: 0 15px; }
.jobs .tag[aria-pressed="true"] { color: var(--primary); }
.swap .types { margin-top: 14px; }
.swap-note { margin: 14px 0 0; font-size: 14px; color: var(--muted-foreground); }

/* the families: a count in words, what the filter shows, six cards, then every family and every home behind a native disclosure */
.homes { padding-top: 4px; }
.homes-head { justify-content: flex-start; align-items: baseline; }
.homes-count { margin: 0; font-size: 15px; color: var(--muted-foreground); }
.homes-live { margin: 0; font-size: 14px; font-weight: 600; color: var(--primary); }
.homes-live:empty { display: none; }
.homes-head #clear { margin-left: auto; }
.btn-small { height: 36px; padding: 0 14px; font-size: 14px; }
.all-homes { margin-top: 30px; }
.all-homes > summary {
  list-style: none; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 15px; background: var(--pg-surface); box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm);
}
.all-homes > summary::-webkit-details-marker { display: none; }
.all-homes > summary::after { content: ""; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s ease; }
.all-homes[open] > summary::after { margin-top: 2px; transform: rotate(-135deg); }
.grid-rest { padding-top: 28px; }
.card-family .pairs-lines { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; line-height: 1.4; color: var(--muted-foreground); }
.pairs-lines li[hidden] { display: none; }
.pairs-lines li.hit { order: -1; color: var(--primary); font-weight: 600; }
.siblings { position: relative; z-index: 2; margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted-foreground); }
.siblings a { display: inline; font-weight: 600; text-underline-offset: 3px; }
.no-family { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; color: var(--muted-foreground); }
.card-family .thumb-play span { display: inline; }

/* footer: the sign-off, the fine print, the apps the stories name */
.foot-signoff { margin: 10px 0 0; font-size: 17px; font-weight: 700; color: var(--foreground); }
.foot-apps { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--pg-hairline); }
.foot-apps summary { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; font-weight: 600; color: var(--foreground); text-underline-offset: 3px; }
.apps-named { list-style: none; margin: 8px 0 0; padding: 0; columns: 4 170px; column-gap: 24px; font-size: 13px; }
.apps-named li { break-inside: avoid; padding: 2px 0; }

@media (max-width: 900px) {
  .hero-media { order: 0; }
  .argument-steps { grid-template-columns: 1fr; }
  .proof-pair { grid-template-columns: 1fr; gap: 22px; }
  .proof-after::before { left: 50%; top: -17px; margin: 0 0 0 -6px; transform: rotate(135deg); }
  .cta-band.has-fig { grid-template-columns: minmax(0, 1fr); }
  .core-fig { grid-column: 1; grid-row: auto; }
}
@media (max-width: 700px) {
  .site-nav .nav-docs { display: none; }
  .site-nav .nav-download { display: inline-flex; }
  .homes-head { flex-direction: row; align-items: baseline; }
}
@media (max-width: 520px) {
  .site-head { padding-top: 8px; padding-bottom: 8px; }
  .brand-title, .brand-sep { display: none; }
  .hero { padding-top: 14px; gap: 22px; }
  .hero-media { aspect-ratio: 16 / 9; }
  .hero h1 { font-size: 34px; line-height: 1.04; }
  .hero-cta { gap: 2px 16px; }
  .hero-cta .btn { flex: 1 1 100%; height: 48px; }
  .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pair { padding: 8px 12px; }
  .jobs { flex-wrap: nowrap; overflow-x: auto; margin: 16px calc(-1 * var(--pg-gutter)) 0; padding: 0 var(--pg-gutter); scroll-padding-inline: var(--pg-gutter); scrollbar-width: none; scroll-snap-type: x proximity; }
  .jobs::-webkit-scrollbar { display: none; }
  .jobs-label, .jobs .tag { flex: none; scroll-snap-align: start; }
  .cta-band .cta-actions .btn { flex: 1 1 100%; height: 48px; }
  .homes-head #clear { margin-left: 0; }
  .all-homes > summary { width: 100%; }
  .card-family .pairs-lines { font-size: 12.5px; }
  .apps-named { columns: 2 140px; }
  /* compact cards, two to a row on a phone (the picture and the name, then who lives there and the pairs on the family's own page), so the six featured families are
     about three rows; the first card, the one that names the same people's other homes, takes the row */
  .card-family .card-body { padding-top: 8px; }
  .card-family .cast, .card-family .pairs-lines, .card-family .go { display: none; }
  .card-family .home-line { font-size: 12.5px; }
  #grid > .card-family:first-child { grid-column: 1 / -1; }
  #grid > .card-family:first-child h3 { font-size: 18px; line-height: 1.3; }
  #grid > .card-family:first-child .go { display: inline-flex; }
  .card-family .thumb-play span { display: none; }
  .homes { padding-bottom: 40px; }
  .hero { padding-bottom: 20px; }
  .site-foot { padding-bottom: 32px; }
  .argument-steps > li { padding: 18px 18px 16px; }
}
@media (pointer: coarse) {
  .hero-pointer, .proof-family, .argument-more a { min-height: 44px; }
  .foot-apps summary { min-height: 44px; }
}
