/* The start page (apps.zlex.me round 4, FINAL 2026-11-18): the name, a sentence and every app as a
   hand of cards (D25); Play with friends; then the apps in full-length cards (D22), Yours, Games,
   then Apps with the private ones locked (D24), each card leading to its page with a quiet Play
   beside See more (D23). Loads after style.css, whose tokens, fonts and labels it uses; nothing here
   reaches another page. Motion: the deal once on load, and answers to touch and pointer; none of it
   under reduced motion. */

.start {
  --gl: max(clamp(20px, 4vw, 40px), env(safe-area-inset-left, 0px));
  --gr: max(clamp(20px, 4vw, 40px), env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bezel: #060a14;
  max-width: 1120px;
  margin-inline: auto;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  padding-left: var(--gl);
  padding-right: var(--gr);
  /* The hand runs to the screen's edges on a phone; nothing may push the page sideways. */
  overflow-x: clip;
}

/* ── The top: the mark, Sign in ───────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.mark { width: 26px; height: 26px; }
/* The account side spans the rest of the row, its contents to the right, so its own box never moves
   when Sign in becomes a name and Sign out: a moved box counts as a layout shift. */
.topbar .account { flex: 1; justify-content: flex-end; }

/* ── The hero: the name, a sentence, the hand ──────────────────────────────── */
.hero { margin-top: 10px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 12vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede { color: var(--muted); margin-top: 14px; max-width: 46ch; font-size: 16px; text-wrap: pretty; }

/* Every app's screen as a card with its suit band, fanned from one point below the line that cuts
   them off, as if held from below the page. The middle card lies on top. The fan is each card's
   `rotate`, set once, so `transform` stays free for a card coming up. The hand's own
   state (--rise, --dx, --s, --un, --rx, --ry, --mx, --my) never shares a name with a page token: a
   card that doesn't set one must fall back, not inherit a colour (--lift is Lift Navy). */
.hand {
  position: relative;
  height: 150px;
  margin: 22px calc(-1 * var(--gr)) 0 calc(-1 * var(--gl));
  border-bottom: 1px solid var(--line-strong);
  clip-path: inset(-120px -400px 0 -400px);
}
.hand-card {
  --w: 128px;
  --h: 179px;
  --a: calc((var(--i) - 3) * 8deg);
  position: absolute;
  left: 50%;
  bottom: -50px;
  width: var(--w);
  height: var(--h);
  margin-left: calc(var(--w) / -2);
  border-radius: 12px;
  transform-origin: 50% 240%;
  rotate: var(--a);
  transform: translateX(var(--dx, 0px)) translateY(var(--rise, 0px));
  z-index: calc(10 - var(--d));
  transition: transform 340ms var(--ease);
  animation: deal 500ms var(--ease) backwards;
  animation-delay: calc(var(--i) * 30ms + 120ms);
}
/* The card's face: its picture, suit band and name. It straightens, grows and tilts on its own
   middle while the card keeps its place on the fan; it only takes that transform where the card can
   come up (a pointer that hovers, or keyboard focus), so a phone keeps flat faces and no extra layers. */
.hand-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--raised);
  box-shadow: var(--sleeve-shadow), 0 0 0 1px var(--line-strong);
  transform-origin: 50% 60%;
  transition: transform 400ms var(--ease), box-shadow 300ms var(--ease);
}
.hand-face::before { content: ''; position: absolute; inset: 0 0 auto; height: 7px; background: var(--suit); z-index: 1; }
/* A glare where the pointer is, while the card is up. */
.hand-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 22%), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 58%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 250ms var(--ease);
}
.hand-face img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hand-card:focus-visible { outline: none; }
/* The name shows on a pointer or keyboard focus; a touch goes straight to the card below. */
.hand-name {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 14px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(10, 16, 31, 0.88);
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}
/* Up: the card a pointer picks (.up) or keyboard focus comes to the front, so no other card covers
   its name, as Modplex's Quick Mod hand does. The pointer picks by where it is across the fan, each
   card owning an equal slice (main.js), not by which card is under it: a card in front covers all
   of the next one's strip, so by hover the next card never came up (his ask, 2026-11-30). With
   motion it also lifts out of the hand, straightens most of the way and grows a little, its
   neighbours make room, and it tilts toward the pointer. */
@media (hover: hover) {
  .hand-face { transform: perspective(700px) rotate(var(--un, 0deg)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1)); }
  .hand-card.up { z-index: 20; }
  .hand-card.up .hand-name { opacity: 1; transform: none; }
  .hand-card.up .hand-face { box-shadow: var(--sleeve-shadow-up), 0 0 0 1px var(--line-hover); }
  .hand-card.up .hand-face::after { opacity: 1; }
}
.hand-card:focus-visible { z-index: 20; }
.hand-card:focus-visible .hand-name { opacity: 1; transform: none; }
.hand-card:focus-visible .hand-face { transform: perspective(700px) rotate(var(--un, 0deg)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1)); box-shadow: 0 0 0 2px var(--aqua), var(--sleeve-shadow-up); }
@media (prefers-reduced-motion: no-preference) {
  .hand-card:focus-visible { --rise: -34px; }
  .hand-card:focus-visible .hand-face { --s: 1.07; --un: calc(var(--a) * -0.65); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hand-card.up { --rise: -34px; }
  .hand-card.up .hand-face { --s: 1.07; --un: calc(var(--a) * -0.65); }
  .hand-card:active .hand-face { --s: 0.99; transition-duration: 100ms; }
  .hand-card.tilting .hand-face { transition: transform 120ms linear, box-shadow 300ms var(--ease); }
  /* Its neighbours make room: 32 px beside it, 32 / n px n cards off. */
  .hand-card.up + .hand-card { --dx: 32px; }
  .hand-card.up + * + .hand-card { --dx: 16px; }
  .hand-card.up + * + * + .hand-card { --dx: 10.7px; }
  .hand-card.up + * + * + * + .hand-card { --dx: 8px; }
  .hand-card.up + * + * + * + * + .hand-card { --dx: 6.4px; }
  .hand-card.up + * + * + * + * + * + .hand-card { --dx: 5.3px; }
  .hand-card:has(+ .hand-card.up) { --dx: -32px; }
  .hand-card:has(+ * + .hand-card.up) { --dx: -16px; }
  .hand-card:has(+ * + * + .hand-card.up) { --dx: -10.7px; }
  .hand-card:has(+ * + * + * + .hand-card.up) { --dx: -8px; }
  .hand-card:has(+ * + * + * + * + .hand-card.up) { --dx: -6.4px; }
  .hand-card:has(+ * + * + * + * + * + .hand-card.up) { --dx: -5.3px; }
}
/* The deal, as Modplex's Quick Mod hand deals (his ask, 2026-11-30: "copy that animation its
   nice"): the cards rise from under the line that cuts them off, already fanned, 30 ms apart. It
   moves `translate` only and holds nothing once it ends, so a card can still come up. */
@keyframes deal {
  from { translate: 0 200px; }
}
/* At rest the hand breathes, as Modplex's does: each face floats 3 px up and back every 6 s, each
   card a step behind the one before, and holds still while its card is up. */
@media (prefers-reduced-motion: no-preference) {
  .hand-face { animation: hand-bob 6s ease-in-out calc(var(--i) * -750ms) infinite; }
  .hand-card.up .hand-face, .hand-card:focus-visible .hand-face { animation-play-state: paused; }
}
@keyframes hand-bob {
  50% { translate: 0 -3px; }
}

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
    grid-template-areas: 'title title' 'words hand';
    align-items: end;
    column-gap: 32px;
    margin-top: 28px;
    border-bottom: 1px solid var(--line-strong);
  }
  .hero h1 { grid-area: title; }
  .lede { grid-area: words; margin-bottom: 40px; }
  .hand { grid-area: hand; height: 236px; margin: 18px 0 0; border-bottom: 0; }
  /* Spread wider than the phone's fan, the hand taking more of the row (his pick, 2026-11-30). */
  .hand-card { --w: 186px; --h: 260px; --a: calc((var(--i) - 3) * 9.5deg); bottom: -64px; transform-origin: 50% 215%; }
  .hand-name { font-size: 12.5px; }
}

/* ── Play with friends (Play concept D5): kept, slimmer, until Play's own look rework says where ── */
.play-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}
.play-bar-say { flex: 1 1 300px; min-width: 0; }
.play-bar h2 { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; }
.play-bar-say p { color: var(--muted); margin-top: 4px; font-size: 14px; max-width: 60ch; }
.play-bar-do { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.host-room {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--teal);
  color: var(--teal-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: background 160ms ease-out;
}
.host-room:hover { background: var(--teal-hover); }
.join { display: grid; gap: 6px; }
.join-row { display: flex; gap: 8px; }
/* 16px so iOS doesn't zoom in on it; Unbounded's capitals keep Z apart from 2. */
.join input {
  width: 5.8em;
  height: 44px;
  padding: 0 10px;
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.join input::placeholder { color: var(--faint); opacity: 1; }
.join input:hover { border-color: var(--line-hover); }
.join input[aria-invalid='true'] { border-color: var(--rose); }
.join button {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.join button:hover { background: var(--lift); border-color: var(--line-hover); }
.join-hint { color: var(--rose); font-size: 13px; max-width: 24ch; }
.join-hint:empty { display: none; }
.hidden-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── The groups: Yours, Games, Apps ───────────────────────────────────────── */
.group { margin-top: clamp(36px, 7vw, 64px); scroll-margin-top: 16px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 18px; }
.group-title { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 30px); line-height: 1.1; letter-spacing: -0.015em; }
.ask { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; white-space: nowrap; color: var(--teal); font-family: var(--display); font-weight: 700; font-size: 14px; }
.ask svg { width: 18px; height: 18px; flex: none; transition: transform 200ms var(--ease); }
.ask:hover { color: var(--teal-hover); }
.ask:hover svg { transform: translateX(4px); }

/* ── A card: full length, one app a row; the name is its link, stretched over the card ── */
.cards { display: grid; gap: clamp(18px, 3vw, 28px); }
.start .card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sleeve-shadow);
  overflow: hidden;
  scroll-margin-top: 16px;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.start .card::before { content: ''; position: absolute; inset: 0 0 auto; height: 8px; background: var(--suit); z-index: 2; }
.start .card:active { transform: scale(0.985); transition-duration: 90ms; }
@media (hover: hover) {
  .start .card:hover { transform: translateY(-4px); box-shadow: var(--sleeve-shadow-up); border-color: var(--line-hover); }
  .start .card:hover .shot-phone { translate: 0 -8px; }
  .start .card:hover .more svg { transform: translateX(4px); }
}
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 18px; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--aqua); outline-offset: -3px; }

/* The pictures, on a panel in the app's suit colour: the iPad shot with a phone screen over it. */
.media { position: relative; aspect-ratio: 16 / 11.2; overflow: hidden; background: color-mix(in oklab, var(--suit) 15%, var(--surface)); }
.media img { position: absolute; height: auto; border-radius: 10px; background: var(--raised); }
.shot-ipad { left: 6%; top: 11%; width: 74%; box-shadow: var(--sleeve-shadow), 0 0 0 1px rgba(0, 0, 0, 0.35); }
.start .shot-phone {
  right: 5%;
  top: 21%;
  width: 25%;
  border: 3px solid var(--bezel);
  border-radius: 14px;
  box-shadow: var(--sleeve-shadow-up);
  transition: translate 260ms var(--ease);
}
/* An app with phone pictures only shows three, the outer two leaning out. */
.phones .shot-phone { top: 10%; width: 27%; }
.phones .shot-phone:nth-of-type(1) { left: 7%; right: auto; top: 15%; rotate: -4deg; }
.phones .shot-phone:nth-of-type(2) { left: 36.5%; right: auto; }
.phones .shot-phone:nth-of-type(3) { right: 7%; top: 15%; rotate: 4deg; }

.start .card .body { padding: 18px 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.start .card .head { display: flex; align-items: center; gap: 14px; }
.start .card .icon { width: 52px; height: 52px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px var(--line-strong); }
.start .card .title { min-width: 0; }
.start .card .name { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.labels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.labels .public, .labels .yours { color: var(--leaf); }
.labels .private { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.labels .private svg { width: 11px; height: 11px; }
.labels .note {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.start .card .line { color: var(--muted); font-style: italic; font-size: 15px; max-width: 62ch; }
.about { font-size: 14.5px; max-width: 62ch; }
.start .card .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 4px; }
/* See more: the card's own action, the one teal thing on it. */
.more { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--teal); font-family: var(--display); font-weight: 700; font-size: 14.5px; }
.more svg { width: 18px; height: 18px; transition: transform 200ms var(--ease); }
/* Play or Open beside it (D23): quiet, and above the card's stretched link. */
.play {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13.5px;
  transition: background 0.12s, border-color 0.12s;
}
.play svg { width: 12px; height: 12px; }
.play:hover { background: var(--lift); border-color: var(--line-hover); }

@media (min-width: 860px) {
  .start .card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .media { aspect-ratio: auto; min-height: 400px; }
  .start .card:nth-child(even) .media { order: 2; }
  .start .card .body { padding: 40px 36px 32px; gap: 16px; justify-content: center; }
  .start .card .icon { width: 60px; height: 60px; }
  .start .card .line { font-size: 16px; }
  .start .card .foot { margin-top: 6px; }
}

/* The pages as plain links where the script never runs and no card is drawn (tools/crawl.mjs writes
   the list into a noscript). */
.plain-list { margin: clamp(32px, 6vw, 56px) 0 0; padding: 0; list-style: none; display: grid; gap: 12px; color: var(--muted); }
.plain-list a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 4px; }

/* ── The foot ─────────────────────────────────────────────────────────────── */
/* Nothing under the lists shows until they are drawn, so nothing on screen moves down when they
   come: someone signed in gets their own apps first (site/account.js). */
.lists:empty ~ * { display: none; }
.foot-links { margin-top: clamp(48px, 8vw, 80px); padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; color: var(--muted); }
.foot-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 4px; }
.foot-links a:hover { color: var(--teal-hover); }
.foot-links .fine { color: var(--faint); font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  .hand-card { animation: none; transition: none; }
  .hand-face, .hand-face::after, .hand-name { transition: none; }
  .start .card, .start .shot-phone, .more svg, .ask svg, .host-room, .join button, .play { transition: none; }
  .start .card:hover, .start .card:active { transform: none; }
  .start .card:hover .shot-phone { translate: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html:has(.start) { scroll-behavior: smooth; }
}
