/* The home page (public/home.html, served at /). Tokens, header and footer come from workspace.css.

   Ink on paper: the only pictures are the film and codes made in pixie.codes. A code is 49 squares across (41 plus four
   light squares each side) at 10 px a square, shown only at whole multiples of 49 px so every square stays square: 294
   px (6 px a square) wherever there is room, 245 (5 px a square) otherwise (never 2 or 3 px a square, where the
   squares are too small to make out). Every picture and the film's box have a fixed size at each width,
   so nothing moves while the page loads or when the film is played.

   Phone first: one column. From 721 px the doors and the reasons sit side by side; from 900 px the film sits beside
   the headline. */
.home-page :is(h1, h2, h3, p, ul, figure) { margin: 0; }
.home-page .shell { padding-top: 0; }
.home-page .shell a { color: var(--px-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.home-page .shell a:hover { color: var(--px-accent-strong); text-decoration-thickness: 2px; }
.home-page .px-brand { color: var(--px-ink); min-height: 44px; }
.home-page :is(p, li, a, h1, h2, h3, figcaption) { overflow-wrap: break-word; }
.home-page .hm-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- First view: the headline, the sentence, the film ---- */
.home-page .hm-hero { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 20px; padding: 24px 0 32px; }
.home-page .hm-hero-words { display: grid; gap: 12px; align-content: start; }
.home-page .hm-hero h1 { font-size: 36px; font-weight: 600; line-height: 1.04; letter-spacing: -0.025em; }
.home-page .hm-lede { max-width: 30em; font-size: 17px; line-height: 1.5; color: var(--px-ink); }
.home-page .hm-film { min-width: 0; }
/* The film's box: 16:9 at every width, in the poster's navy until the poster arrives. */
.home-page .hm-film-box { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--px-radius-panel); background: #172A46; }
.home-page .hm-film-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #172A46; }
/* On an upright screen under 768 px the film is the portrait cut (home.js), in a 9:16 box from the first paint, so
   switching moves nothing; a phone held sideways keeps the landscape box, with its play button on the screen. Until
   the script has chosen the cut (data-cut on the box) the film is held back, so the box shows its navy rather than the
   landscape poster letterboxed in the tall box; the hold ends by itself after a second. Without JavaScript a <noscript>
   rule in the page keeps the landscape cut's 16:9 box and shows the film at once. */
@media (max-width: 767px) and (orientation: portrait) {
  .home-page .hm-film-box { aspect-ratio: 9 / 16; }
  .home-page .hm-film-box:not([data-cut]) .hm-film-video { animation: hm-film-hold 1s step-end both; }
}
@keyframes hm-film-hold { from { visibility: hidden; } }
/* The play button covers the poster (home.js shows it, and gives the film its own controls once it plays). */
.home-page .hm-film-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.home-page .hm-film-play[hidden] { display: none; }
.home-page .hm-film-play-mark { position: relative; width: 72px; height: 72px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(11, 31, 59, 0.2), 0 6px 20px rgba(11, 13, 16, 0.35); }
.home-page .hm-film-play-mark::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -12px 0 0 -7px; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent var(--px-ink); }
.home-page .hm-film-play:hover .hm-film-play-mark { background: var(--px-accent-soft); }
/* Pressed, until the film's own controls take over: the mark is drawn pressed in. */
.home-page .hm-film-play[aria-busy="true"] { cursor: default; }
.home-page .hm-film-play[aria-busy="true"] .hm-film-play-mark { background: var(--px-accent-soft); box-shadow: 0 0 0 3px var(--px-accent), 0 6px 20px rgba(11, 13, 16, 0.35); transform: scale(0.94); }
.home-page .hm-film-play:focus-visible { outline-offset: -6px; }
.home-page .hm-film-status { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: var(--px-radius); background: #FFFFFF; color: var(--px-error-ink); font-size: 15px; line-height: 1.4; }
.home-page .hm-film-status[hidden] { display: none; }
.home-page .hm-film figcaption { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--px-muted); }

/* ---- Two doors: columns under an ink rule ---- */
.home-page .hm-doors { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
/* The code at the top at its full size, then the words, then the button (at the door's full width on a phone). A door
   is never narrower than 294 px from a 326 px window (the page's 16 px gutters) to 720, nor from 721 px where the two
   sit side by side; below 326 px the code is 245 px. */
.home-page .hm-door { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'code' 'words' 'button'; row-gap: 16px; align-items: start; padding-top: 16px; border-top: 2px solid var(--px-ink); }
.home-page .hm-door-code { grid-area: code; }
.home-page .hm-door-words { grid-area: words; }
.home-page .hm-door .hm-button { grid-area: button; }
.home-page .hm-door-code { display: block; justify-self: start; width: 245px; height: 245px; image-rendering: pixelated; background: #FFFFFF; box-shadow: 0 0 0 1px var(--px-line); }
.home-page .hm-door-words { display: grid; gap: 8px; justify-items: start; }
.home-page .hm-door h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.home-page .hm-door p { max-width: 30em; font-size: 16px; line-height: 1.5; color: var(--px-muted); }
.home-page .shell a.hm-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border: 1px solid var(--px-line-strong); border-radius: var(--px-radius); background: var(--px-surface); color: var(--px-ink); font-size: 16px; font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none; }
.home-page .shell a.hm-button:hover { border-color: var(--px-ink); color: var(--px-ink); }
.home-page .shell a.hm-button--primary { border-color: var(--px-accent); background: var(--px-accent); color: #FFFFFF; }
.home-page .shell a.hm-button--primary:hover { border-color: var(--px-accent-strong); background: var(--px-accent-strong); color: #FFFFFF; }

/* ---- Sections ---- */
.home-page .hm-section { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--px-line); }
.home-page .hm-section > h2 { margin-bottom: 20px; font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }

/* Why it's different: three short reasons. */
.home-page .hm-why-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.home-page .hm-why-item { display: grid; gap: 8px; align-content: start; }
.home-page .hm-why-item h3 { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.home-page .hm-why-item p { max-width: 34em; font-size: 16px; line-height: 1.6; color: var(--px-muted); }

/* The gallery: codes, each a link. On a phone one to a row, each code at the card's full width up to 294 px. Its markup
   is off the page since November 29, 2026 (the codes with art were taken off; public/home.html marks the spot); these
   rules are kept for the gallery that goes back in its place. */
.home-page .hm-gallery-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0; list-style: none; }
.home-page .hm-gallery-list > li { display: flex; }
.home-page .hm-code { flex: 1 1 auto; display: grid; justify-items: center; align-content: start; gap: 10px; padding: 12px 8px 10px; border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); background: var(--px-surface); }
.home-page .shell a.hm-code { color: var(--px-ink); text-decoration: none; }
.home-page .hm-code img { display: block; width: 245px; height: 245px; image-rendering: pixelated; }
.home-page .hm-code span { font-size: 15px; font-weight: 500; line-height: 1.3; text-align: center; }
.home-page .shell a.hm-code:hover { border-color: var(--px-ink); }
.home-page .shell a.hm-code:hover span { text-decoration: underline; text-underline-offset: 3px; }
.home-page .hm-gallery-note { max-width: 80ch; margin-top: 16px; font-size: 13px; line-height: 1.6; color: var(--px-muted); }

/* The closing band: the two doors' buttons again, side by side where they fit. */
.home-page .hm-closing-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.home-page .hm-closing-row .hm-button { flex: 1 1 220px; }

/* The switching line, at the foot. */
.home-page .shell > .hm-switch { margin-top: 48px; padding: 16px 0; border-top: 1px solid var(--px-line); border-bottom: 1px solid var(--px-line); font-size: 16px; line-height: 1.6; color: var(--px-ink); }

.home-page .px-workspace-footer nav { gap: 0 20px; }
.home-page .px-workspace-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--px-muted); text-decoration: none; }
.home-page .px-workspace-footer a:hover { color: var(--px-ink); text-decoration: underline; }

/* 294 px codes: a door from a 326 px window, a gallery card (its padding and border inside) from 344. */
@media (min-width: 326px) {
  .home-page .hm-door-code { width: 294px; height: 294px; }
}
@media (min-width: 344px) {
  .home-page .hm-code img { width: 294px; height: 294px; }
}
@media (min-width: 721px) {
  .home-page .hm-hero { row-gap: 24px; padding: 40px 0 40px; }
  .home-page .hm-hero h1 { font-size: clamp(40px, 2.6vw + 23px, 56px); }
  .home-page .hm-lede { font-size: 20px; line-height: 1.45; }
  .home-page .hm-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  /* Side by side. Inside each, still the picture beside the words with the button under both, at its own width. */
  .home-page .hm-door { padding-top: 20px; }
  .home-page .hm-door .hm-button { justify-self: start; }
  .home-page .hm-door h2 { font-size: 24px; }
  .home-page .hm-section { margin-top: 64px; padding-top: 32px; }
  .home-page .hm-section > h2 { margin-bottom: 24px; font-size: 28px; }
  .home-page .hm-gallery-list { gap: 16px; }
  .home-page .hm-code { padding: 16px 8px 12px; }
  .home-page .hm-closing-row .hm-button { flex: 0 0 auto; }
  .home-page .shell > .hm-switch { margin-top: 64px; }
}
@media (min-width: 900px) {
  /* The words on the left, the film on the right. */
  .home-page .hm-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; align-items: center; padding: 56px 0 56px; }
  .home-page .hm-hero-words { gap: 16px; }
  .home-page .hm-doors { gap: 48px; }
  .home-page .hm-why-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
  .home-page .hm-code span { font-size: 16px; }
}
/* The gallery has its own steps, because a card cannot be narrower than its code. Two cards in a row hold 294 px codes
   in a window of 668 px, four hold 245 px codes in 1,220 px (cards of code, side padding and border, the gaps and the
   page's two gutters); each step starts 17 px later, the most a classic scrollbar takes from a desktop window, which
   the width query counts and the page cannot use (at 668 px the gap between two cards fell from 12 to about 4 px).
   Every size is a whole number of pixels a square (a code is 49 squares across with its margin). */
@media (min-width: 685px) {
  .home-page .hm-gallery-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1237px) {
  .home-page .hm-gallery-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .home-page .hm-code { padding: 20px 12px 16px; }
  .home-page .hm-code img { width: 245px; height: 245px; }
}
@media (max-width: 720px) {
  /* One row while the Menu button holds the links; without the menu the links wrap under the brand when they do not fit. */
  :is(.px-menu-pending, .px-menu-ready) .home-page .px-app-header__inner { flex-wrap: nowrap; }
  .home-page .px-app-nav { width: auto; gap: 0; }
  .home-page .px-app-nav a { font-size: 13px; padding: 9px 8px; }
}
@media (max-width: 360px) {
  .home-page .px-app-header__inner { flex-wrap: wrap; }
  .home-page .px-app-nav { width: 100%; }
}
/* A phone held sideways is short: in one column the film's play button fell below a 375 px screen. Under 900 px wide
   and 500 px tall the words and the film sit side by side, as from 900 px, so the whole film box is in the first screen.
   Last in the file, so it wins over the width rules above. */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .home-page .hm-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 24px; align-items: center; padding: 16px 0 24px; }
  .home-page .hm-hero h1 { font-size: 30px; }
}
