/* app-family.css: the Sandstone pixel family on every app page (owner 2026-11-13: "I want all my app sites to
   match each other, like Sandstone does: the pixel style, and apply just different colours").
   One hero composition, one dot-matrix rule, one pill button, one section rhythm, one card. Each page only sets
   --app-acc (its colour) and --app-word (its own display face, used for ONE word in the hero headline).
   Values are copied from /sandstone/styles.css so the five pages read as one family. Sculk, Calcite and Garnet
   load this after apps2.css (body.fam). Lapis (body.fam-px, 2026-11-14) takes the same hero, pixel headings and
   rules but keeps its own navy page, buttons and cards below the hero. */

@font-face { font-family: "BubbledotICG-FinePos"; src: url("/sandstone/fonts/BubbledotICG-FinePos.woff2") format("woff2"), url("/sandstone/fonts/BubbledotICG-FinePos.woff") format("woff"); font-weight: normal; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Pixel Circle"; src: url("/sandstone/fonts/GeistPixel-Circle.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

body.fam, body.fam-px {
  --fh-acc: var(--app-acc, #fff);
  --fh-dot: "BubbledotICG-FinePos", "Geist Pixel Circle", monospace;
  --fh-word: var(--app-word, var(--fh-dot));
  --fh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fh-card: #0c0c0c;
  --fh-hair: rgba(255, 255, 255, 0.09);
  --fh-hair-h: rgba(255, 255, 255, 0.2);
  --fh-mute: #9a9a9a;
  /* the app colour reaches apps2's own bits (bullets, focus ring, slider fills) */
  --accent: var(--app-acc); --accent-hi: var(--app-acc); --accent-soft: color-mix(in srgb, var(--app-acc) 22%, transparent);
  --hv-w: 1.5px;
}
body.fam { background: #000; }

/* the nav: shell.css's per-page theme hook (data-nav-theme, build.cjs). "pixel" is the "sandstone" theme with the
   page's own colour, so the five pills are one family: black glass, pixel-face links, marker in the app colour. */
:is(.sn, .sn-sheet)[data-nav-theme="pixel"] {
  --sn-acc: var(--app-acc, #fff); --sn-bg: rgba(0, 0, 0, .86); --sn-solid: #050505; --sn-panel: #0a0a0a;
  --sn-ink: #fff; --sn-mute: #8e8e8e; --sn-hair: rgba(255, 255, 255, .14);
  --sn-cta: #fff; --sn-cta-ink: #000; --sn-cta-h: #f1f1f1;
  --sn-links-font: "BubbledotICG-FinePos", "Geist Pixel Circle", monospace;
}
.sn[data-nav-theme="pixel"] .sn-links a { font-size: 17px; letter-spacing: .02em; }

/* ---------- the hero: background film, trust row, headline, subhead, pill, stats ---------- */
.fh-top { position: relative; padding: 0 !important; border: 0; }
.fh-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; background: #000 var(--fh-poster, none) center / cover no-repeat; overflow: hidden; z-index: 0; }
/* the recoloured film is lighter than Sandstone's purple at the top: a soft shade keeps white type readable on it */
.fh-top .fh-bg::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 62% 46% at 50% 44%, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 72%), linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0) 40%); }
.fh-bg video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; }
.fh-page {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  padding: calc(clamp(16px, 2.4vh, 28px) + 64px) clamp(14px, 3vw, 32px) clamp(16px, 2.4vh, 28px);
  height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden;
}
.fh-hero { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%; max-width: 900px; min-height: 0; }

.fh-trust { --ts: clamp(36px, 4.5vw, 42px); display: inline-flex; align-items: center; margin-bottom: clamp(16px, 2.5vh, 26px); }
.fh-av { position: relative; display: grid; width: var(--ts); height: var(--ts); padding: 5px; border-radius: 50%; background: #28282a; border: 1px solid rgba(255, 255, 255, 0.4); }
.fh-av > span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.fh-av svg { width: calc(var(--ts) * 0.4); height: calc(var(--ts) * 0.4); color: #111; }
.fh-av + .fh-av { margin-left: calc(var(--ts) * -0.42); }
.fh-av:nth-child(1) { z-index: 1; } .fh-av:nth-child(2) { z-index: 2; } .fh-av:nth-child(3) { z-index: 4; }
.fh-tpill { position: relative; z-index: 3; display: inline-flex; align-items: center; height: var(--ts); margin-left: calc(var(--ts) * -0.42); padding: 0 16px 0 calc(var(--ts) * 0.58); border-radius: 999px; background: #28282a; border: 1px solid rgba(255, 255, 255, 0.4); color: #c4c2c3; font-weight: 500; font-size: clamp(12px, 1.4vw, 13.5px); white-space: nowrap; }

:is(body.fam, body.fam-px) .fh-head { margin: 0; font-family: var(--fh-dot); font-weight: 400; font-size: clamp(28px, 6.2vw, 80px); letter-spacing: -0.04em; line-height: 1.12; color: #fff; max-width: 100%; text-wrap: balance; }
.fh-head .ln { display: block; white-space: nowrap; }
/* the page's own display face, for one word, in the app colour */
.fh-head .w { font-family: var(--fh-word); font-weight: 500; letter-spacing: 0; color: color-mix(in srgb, var(--fh-acc) 86%, #fff); font-size: 0.96em; text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35); }
.fh-sub { max-width: min(520px, 92%); margin: clamp(14px, 2.2vh, 22px) auto 0; font-size: clamp(15.5px, calc(1.55vw + 2pt), 19px); line-height: 1.55; color: #d0d0d0; }

.fh-cta, body.fam .btn.primary, body.fam .btn-l:not(.ghost) {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; background: #fff; color: #000; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 22px rgba(255, 255, 255, 0.32), 0 0 44px rgba(255, 255, 255, 0.12);
  transition: background-color 0.25s ease, box-shadow 0.3s ease;
}
.fh-cta { margin-top: clamp(20px, 3.2vh, 32px); padding: clamp(11px, 1.6vh, 13px) clamp(22px, 3vw, 28px); font-size: clamp(13.5px, 1.5vw, 14.5px); text-decoration: none; }
@media (hover: hover) {
  .fh-cta:hover, body.fam .btn.primary:hover { background: #f1f1f1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 30px rgba(255, 255, 255, 0.5), 0 0 64px rgba(255, 255, 255, 0.2); }
}

.fh-stats { position: relative; flex-shrink: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 24px); width: 100%; max-width: 920px; margin: 0; padding: 0 0 clamp(4px, 1vh, 12px); }
.fh-stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(4px, 0.8vh, 8px); margin: 0; }
.fh-stat .i { font-family: var(--fh-dot); font-size: clamp(22px, 3vw, 33px); line-height: 1; color: var(--fh-acc); }
.fh-stat .v { font-weight: 500; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.1; }
.fh-stat .l { font-size: clamp(12px, 1.2vw, 13px); color: #8e8e8e; line-height: 1.35; }

/* entrance, on load: rise, unblur; no pop, no bounce */
@keyframes fh-in { to { opacity: var(--o, 1); transform: none; filter: none; } }
html:not(.rm) .fh-a { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px); animation: fh-in 0.85s var(--fh-ease) forwards; animation-delay: var(--d, 0s); }
html:not(.rm) .fh-head .ln { opacity: 0; transform: translateY(14px); animation: fh-in 0.85s var(--fh-ease) forwards; }
html:not(.rm) .fh-head .ln:nth-child(1) { animation-delay: 0.12s; }
html:not(.rm) .fh-head .ln:nth-child(2) { animation-delay: 0.3s; }
.fh-sub.fh-a { --o: 0.92; }

/* ---------- the dot-matrix rule between sections: the app-colour dots run across as you scroll in ---------- */
.fh-dots {
  --p: 0; position: relative; height: 12px; margin-bottom: clamp(54px, 9vh, 96px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1.3px, transparent 1.8px) 0 50% / 12px 12px repeat-x;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fh-dots::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, var(--app-acc, #fff) 1.4px, transparent 1.9px) 0 50% / 12px 12px repeat-x; clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0); }

/* ---------- the black app pages below the hero (Sculk, Calcite, Garnet): Sandstone's rhythm and cards ---------- */
body.fam main#main > section:not(.fh-top) { padding-block: clamp(96px, 17vh, 190px) 0; border: 0; }
body.fam .wrap { max-width: calc(1664px + 2 * var(--sv-pad, 32px)); }
body.fam main h2 { font-family: var(--fh-dot); font-weight: 400; letter-spacing: -0.04em; line-height: 1.08; color: #fff; text-wrap: balance; }
/* card and step titles stay in the body face, as on Sandstone; the pixel face is for section headings only */
body.fam main h3 { font-family: var(--ff-body, "Satoshi", sans-serif); font-weight: 500; letter-spacing: -0.01em; }
body.fam .sec-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 64px); align-items: end; max-width: none; margin-bottom: clamp(36px, 6vh, 64px); }
body.fam .sec-head h2 { font-size: clamp(34px, 5.2vw, 68px); }
body.fam .sec-head p { margin: 0; max-width: 46ch; font-size: clamp(15px, 1.25vw, 17px); line-height: 1.6; color: #a3a3a3; }
body.fam .lib h2 { font-size: clamp(34px, 4.4vw, 60px); margin-bottom: 18px; }

/* every box is the Sandstone card: near-black, one hairline, 28 px corners, no glass shine */
body.fam :is(.pane, .dl-card, .log, .glass) {
  background: var(--fh-card); color: #fff; border: 1px solid var(--fh-hair); border-radius: 28px;
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: border-color 0.35s ease;
}
body.fam .glass::before { display: none; }
@media (hover: hover) { body.fam :is(.pane, .dl-card, .more > div):hover { border-color: var(--fh-hair-h); } }
body.fam :is(.pane, .dl-card, .log) :is(h2, h3) { color: #fff; }
body.fam :is(.pane, .dl-card, .log, .more > div) :is(p, li, dd) { color: var(--fh-mute); }
body.fam :is(.pane, .dl-card, .log, .more > div, .note, .sum) :is(b, strong), body.fam :is(.note, .sum) > b { color: #fff !important; }
body.fam .pane dl.spec dt, body.fam .spec dt { color: #fff; }
body.fam :is(.note, .sum, .upd) { color: #8e8e8e; }
body.fam .muted { color: var(--fh-mute); }
body.fam .try-frame, body.fam .wipe-box, body.fam .nw-pic img, body.fam .tour-pic img { border-radius: 20px; }
body.fam .nw-pic, body.fam .tour-pic, body.fam .wipe, body.fam .try-view { padding: 8px; }

/* "And the rest": Sandstone's card grid instead of a ruled list */
body.fam .more { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); border: 0; }
body.fam .more > div { padding: clamp(22px, 2.4vw, 32px); border-radius: 28px; background: var(--fh-card); border: 1px solid var(--fh-hair); transition: border-color 0.35s ease; }
body.fam .more h3 { font: 500 clamp(18px, 1.5vw, 21px)/1.3 var(--font); letter-spacing: -0.01em; color: #fff; }
body.fam .more p { margin-top: 10px; }
body.fam .more kbd, body.fam .pane kbd { background: #1c1c1e; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: none; }

/* pills: the white download pill (above) and the dark Sandstone "What's new" pill for everything else */
body.fam .btn { border-radius: 999px; min-height: 46px; padding: 0 clamp(18px, 2.2vw, 24px); background: #28282a; color: #c8c8c8; box-shadow: none; font-weight: 500; transition: background-color 0.25s ease, color 0.25s ease; }
body.fam .btn.primary { min-height: 48px; padding: 0 26px; color: #000; }
body.fam .btn.sm { min-height: 40px; border-radius: 999px; font-size: 14.5px; }
body.fam .btn small { color: inherit; opacity: 0.62; }
@media (hover: hover) { body.fam .btn:not(.primary):hover { background: #323234; color: #fff; } }
body.fam .tag { background: color-mix(in srgb, var(--app-acc) 16%, transparent); color: var(--app-acc); border-radius: 999px; padding: 3px 10px; }
body.fam pre.code, body.fam .code { background: #141414; color: #d8d8d8; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 14px; }
body.fam :is(.pane, .dl-card, .log, .more > div) a:not([class]) { --hv-rest: rgba(255, 255, 255, 0.28); color: #fff; }
@media (hover: hover) { body.fam :is(.pane, .dl-card, .log, .more > div) a:not([class]):hover { color: var(--app-acc); } }

/* what's new: the version in the pixel face and the app colour, like Sandstone */
body.fam .log { padding: clamp(24px, 2.6vw, 36px); }
body.fam .log h2 { font-size: clamp(34px, 5.2vw, 68px); margin-bottom: clamp(18px, 3vh, 32px); }
body.fam .log h3 { font-family: var(--fh-dot); font-weight: 400; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.03em; color: var(--app-acc); margin-top: 30px; gap: 14px; }
body.fam .log h3 span { font: 400 14px var(--font); letter-spacing: 0; color: #8e8e8e; font-variant-numeric: tabular-nums; }
body.fam .log ul { color: #a3a3a3; }
body.fam .cols h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 18px; }

@media (max-width: 900px) { body.fam .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .fh-stats { grid-template-columns: repeat(2, 1fr); row-gap: clamp(14px, 2.4vh, 22px); }
  :is(body.fam, body.fam-px) .fh-head { letter-spacing: -0.08em; line-height: 1.05; }
  .fh-head .ln { white-space: normal; }
  .fh-head .w { letter-spacing: 0; }
  body.fam .sec-head { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.fam .more { grid-template-columns: minmax(0, 1fr); }
  body.fam :is(.pane, .dl-card, .log, .glass, .more > div) { border-radius: 24px; }
}
@media (max-width: 420px) { .fh-trust { --ts: 34px; } :is(body.fam, body.fam-px) .fh-head { letter-spacing: -0.09em; line-height: 1.04; } }
@media (max-height: 700px) { .fh-trust { margin-bottom: 12px; } .fh-sub { margin-top: 10px; line-height: 1.45; } .fh-cta { margin-top: 16px; } .fh-stat { gap: 3px; } }

/* reduced motion and performance mode: everything shown at once, the film rests on its poster */
html.rm .fh-a, html.rm .fh-head .ln { opacity: 1; transform: none; filter: none; animation: none; }
html.rm .fh-sub { opacity: 0.92; }
html.perf .fh-bg video, html.rm .fh-bg video { display: none; }
