/* The home page (site/pages/home.html, 2026-11-23). The app's Night print, on the web:
   values from Shared/Pool/Kit/Design/NightTokens.swift, faces from Shared/Fonts. Owns
   nothing outside .hm-*. */

@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url("/design/fonts/geist-400.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-display: swap; src: url("/design/fonts/geist-500.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url("/design/fonts/geist-600.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 700; font-display: swap; src: url("/design/fonts/geist-700.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-display: swap; src: url("/design/fonts/geist-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Doto"; font-weight: 900; font-display: swap; src: url("/design/fonts/doto-900.woff2") format("woff2"); }

:root {
  --stock: #000000;
  --ink: #F4F4F2;
  --text-soft: #C9C9C5;
  --text-secondary: #B5B5B1;
  --text-quiet: #9A9A96;
  --hairline: #1E1E1C;
  --border: #2A2A28;
  --live: #FF453A;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --dot: "Doto", var(--mono);
  color-scheme: dark;
}

html { background: var(--stock); }
body {
  margin: 0; background: var(--stock); color: var(--ink);
  font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--ink); }
.hm-skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 10px 14px; background: var(--ink); color: #000; border-radius: 8px; }
.hm-skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* The bar and its fade live in sitebar.css (site/templates/site-bar.html), shared with every site page. */

/* The wall: the pool's prints, printed by the app's own cover-print code. */
.hm-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
@media (max-width: 760px) { .hm-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hm-cell, .hm-tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--stock); }
.hm-cell { display: block; width: 100%; margin: 0; padding: 0; border: 0; cursor: pointer; }
.hm-cell:focus-visible { outline-offset: -3px; }
.hm-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-lit {
  opacity: 0; transition: opacity 0.35s ease;
  -webkit-mask-image: radial-gradient(circle 190px at var(--lx, 50%) var(--ly, 50%), #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 75%);
  mask-image: radial-gradient(circle 190px at var(--lx, 50%) var(--ly, 50%), #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 75%);
}
.hm-cell.is-lit .hm-lit { opacity: 1; }
.hm-photo {
  opacity: 0; filter: blur(8px) saturate(0.4); transform: scale(1.04);
  transition: opacity 0.9s ease, filter 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hm-cell[aria-pressed="true"] .hm-photo { opacity: 1; filter: none; transform: none; }

.hm-tile { box-sizing: border-box; padding: 24px; display: flex; flex-direction: column; }
.hm-word { justify-content: flex-start; align-items: flex-start; gap: 22px; }
.hm-word h1 { margin: 0; font-size: clamp(26px, 2.7vw, 40px); font-weight: 600; line-height: 1.06; letter-spacing: -0.025em; }
/* On a phone the tile is half the screen wide: size the words so "phototainment" fits. */
@media (max-width: 760px) { .hm-word { padding: 18px; gap: 16px; } .hm-word h1 { font-size: calc((50vw - 38px) / 7.2); } }

.hm-key {
  align-self: flex-start; display: inline-flex; align-items: center; height: 48px; padding: 0 22px;
  border-radius: 24px; background: var(--ink); color: #000; text-decoration: none; font-weight: 600; font-size: 16px;
  transition: transform 0.2s ease;
}
.hm-key:active { transform: scale(0.97); }
.hm-key-lg { height: 56px; padding: 0 28px; border-radius: 28px; font-size: 18px; }

/* The dive (dive.js): printed live on a canvas as you scroll, ending on the wordmark, which
   settles into the footer with the App Store key under it. Without the film (no script, no
   WebGL2, reduced motion) the dive is a column of still prints and the lines between them. */
.hm-dive { position: relative; }
.hm-stage { position: relative; background: var(--stock); }
.hm-film { display: none; }
.hm-line {
  margin: 0; padding: 48px 6vw; text-align: center;
  font-size: clamp(40px, 8vw, 120px); font-weight: 700; line-height: 0.95; letter-spacing: -0.045em;
}
.hm-still { display: block; width: 100%; height: 70vh; height: 70svh; }
.hm-still-word { height: 50vh; height: 50svh; }
.hm-end {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px 32px;
  padding: clamp(64px, 9vw, 120px) 24px 0; text-align: center;
}
.hm-end p { margin: 0; font-size: clamp(20px, 2vw, 28px); font-weight: 500; letter-spacing: -0.02em; color: var(--text-soft); }
.hm-end .hm-key { align-self: center; }

/* The film: the section's height is the scroll length (dive.js sets it). */
.hm-dive.is-film .hm-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.is-film .hm-film { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.is-film .hm-line {
  position: absolute; inset: 0; z-index: 1; padding: 0 6vw;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(56px, 10.5vw, 176px);
  text-shadow: 0 0 60px rgba(0, 0, 0, 0.55); pointer-events: none;
  opacity: 0; transform: scale(0.96);
}
.is-film .hm-end {
  position: absolute; left: 0; right: 0; bottom: calc(100% - var(--word-top, 70%) + clamp(36px, 7vh, 88px));
  padding-top: 0; padding-bottom: 0; opacity: 0; visibility: hidden;
}
@media (max-width: 700px) { .is-film .hm-end { flex-direction: column; gap: 20px; } }

/* The legal row under the dive is the site footer's (sitefoot.css .pf-legal). */
.hm-foot { background: var(--stock); }

@media (prefers-reduced-motion: reduce) {
  .hm-lit, .hm-photo, .hm-key { transition: none; }
  .hm-photo { filter: none; transform: none; }
}

/* Tile two (trying candidates locally). */
.hm-two { align-items: center; justify-content: center; }
.hm-two-ball { position: relative; display: block; width: min(78%, 320px); aspect-ratio: 1; }
.hm-two-ball img, .hm-two-spin { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
/* The spin covers the still once it plays; with reduced motion it never starts. */
.hm-two-spin { opacity: 0; transition: opacity .4s ease; background: transparent; }
.hm-two-spin.is-on { opacity: 1; }
.hm-two-icon { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; color: var(--text, #f4f4f2); text-decoration: none; }
.hm-two-word { width: min(52%, 200px); height: auto; display: block; }
.hm-two-qr { display: flex; flex-direction: column; align-items: center; gap: 18px; color: var(--text-secondary); font-size: 15px; text-decoration: none; }
.hm-two-qr img { width: min(70%, 260px); height: auto; background: #fff; border-radius: 18px; padding: 14px; }
.hm-two-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-two-word circle.is-blink { animation: hm-blink .7s ease-out; }
@keyframes hm-blink { 0% { opacity: 1; } 35% { opacity: .15; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hm-two-word circle.is-blink { animation: none; } }

/* Dust off a card: crumbs of its print that leave with the pointer and twinkle over the black
   tile they land in (dust.js). One small canvas inside each black tile. */
.hm-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
