/* chimpvibe.dev/games: the games listing (the Specimen Wall and the High score board). Layout only, on the design-system
   tokens and components (/shared/cv-tokens.css, /shared/cv-components.css). Nothing here applies outside body.cv-home.
   One column: the head (title, welcome line and the view switch), then the three step cards, then the wall.
   (It was the front page until the landing page (/) became the scroll journey; its old masthead is gone.) */

* { box-sizing: border-box; }

.cv-home {
  margin: 0;
  min-height: 100vh;
  padding: var(--space-8) var(--space-gutter) 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--weight-regular) var(--text-body)/var(--leading-body) var(--font-body);
  font-variant-numeric: tabular-nums lining-nums;
}
.cv-home ::selection { background: var(--color-primary); color: var(--color-on-primary); }
.cv-home :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.cv-home [hidden] { display: none !important; }
.cv-home a { color: inherit; }
/* the site's top bar (site-nav.css) spans the window over the page's own padding, with a breath under it */
.cv-home > .cv-nav { margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-gutter)) var(--space-6); }

/* width 100%: the body is a flex column (site-footer.css), where auto margins alone would shrink the page to its content */
.cv-home__page {
  display: grid;
  gap: var(--space-7);
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

/* ---- the head: the title and the welcome line on the left, the view switch at the right, level with the line ---- */
.cv-home__games { display: grid; gap: var(--space-7); min-width: 0; scroll-margin-top: var(--space-6); }
.cv-home__games-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-6); align-items: end; min-width: 0; }
.cv-home__games-head > * { min-width: 0; }
.cv-home__lead { grid-column: 1; }
.cv-home__views { grid-column: 2; grid-row: 1 / span 2; align-self: end; }

/* ---- how it works: three step cards in a row, joined by a thin line (stacked under 700px) ---- */
.cv-home .cv-home__how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); align-items: stretch; margin-top: calc(-1 * var(--space-2)); }
.cv-home .cv-home__how li { position: relative; display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface-sunken); font: var(--weight-medium) var(--text-meta)/var(--leading-snug) var(--font-body); color: var(--color-text); }
.cv-home .cv-home__how li + li::before { content: ""; position: absolute; left: calc(-1 * var(--space-3)); top: 50%; width: var(--space-3); height: 2px; background: var(--color-surface-raised); }
.cv-home__how-icon { display: grid; place-items: center; flex: none; align-self: center; width: var(--size-target); height: var(--size-target); border-radius: var(--radius-pill); background: var(--color-surface); }
.cv-home__how-text { min-width: 0; }
.cv-home__how-text > .cv-eyebrow { display: block; margin-bottom: var(--space-1); }

/* ---- the wall ---- */
/* a thin edge round every capture, so a dark game does not melt into the dark page; it turns green under the pointer */
.cv-home .cv-wall .cv-card__play { border-radius: var(--radius-lg); overflow: hidden; isolation: isolate; }
.cv-home .cv-wall .cv-card__play::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--color-surface-raised); pointer-events: none; transition: box-shadow var(--duration-hover) var(--ease-standard); }
/* the capture's focus ring is drawn on the link itself (the frame now clips what is inside it) */
.cv-home .cv-wall .cv-card__play:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.cv-home .cv-wall .cv-card__play:focus-visible .cv-card__capture { outline: none; }
/* the game's name: a line draws under it when the pointer is on the game */
.cv-home .cv-wall .cv-card__name span:not(.cv-dot) { padding-bottom: 2px; background: linear-gradient(var(--color-primary), var(--color-primary)) 0 100% / 0 2px no-repeat; transition: background-size var(--duration-hover) var(--ease-standard); }
/* the author: "by" in the muted meta text, then the name: the site's profile link (shared/profile-card.css) for an
   account with a profile, plain ink text otherwise */
.cv-home .cv-wall .cv-card__author { display: flex; align-items: center; gap: var(--space-2); overflow: visible; }
.cv-home .cv-wall .cv-card__author-by { flex: none; }
.cv-home .cv-wall .cv-card__author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
/* pointer only (no sticky hover on touch): the capture zooms a touch inside its frame, its edge turns green, the name underlines */
@media (hover: hover) and (pointer: fine) {
  .cv-home .cv-wall .cv-card:has(.cv-card__play:hover, a.cv-card__name:hover) .cv-card__play::after { box-shadow: inset 0 0 0 2px var(--color-primary-edge); }
  .cv-home .cv-wall .cv-card:has(.cv-card__play:hover, a.cv-card__name:hover) .cv-card__name span:not(.cv-dot) { background-size: 100% 2px; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cv-home .cv-wall .cv-card__capture { transition: transform var(--duration-pop) var(--ease-grow); }
  .cv-home .cv-wall .cv-card:has(.cv-card__play:hover, a.cv-card__name:hover) .cv-card__capture { transform: scale(1.03); }
}
/* with the full catalogue a long name ("Med Boards Arcade") is wider than its capture at 1920: on the wall a game's
   name wraps onto a second line instead of being cut off with an ellipsis (the component's default) */
.cv-home .cv-wall .cv-card__name span { white-space: normal; overflow-wrap: break-word; }

/* tree fallback only: the tree code lifts each SVG's own style into an adopted sheet that wins; these keep a tree
   visible on a browser without constructable stylesheets, coloured from the --t0..--t4 the page sets (as site.css) */
.cv-home .tree-host { position: relative; isolation: isolate; }
.cv-home .tree-host > svg { position: relative; z-index: 1; }
.cv-home .tree-host svg .w { fill: none; stroke: var(--t1); stroke-linecap: round; stroke-linejoin: round; }
.cv-home .tree-host svg .b { stroke: var(--t0); }
.cv-home .tree-host svg .m { stroke: var(--t1); }
.cv-home .tree-host svg .l { fill: var(--t2); }
.cv-home .tree-host svg .f { fill: var(--t3); }
.cv-home .tree-host svg .h { fill: var(--t4); }

/* the shared footer (site-footer.css) spans the window over the page's own padding, like the top bar, with a breath above it */
.cv-home__page { margin-bottom: var(--space-section); }
.cv-home > .cv-foot { width: auto; margin-inline: calc(-1 * var(--space-gutter)); }

/* below the concept's 1920 frame: as many columns as fit with room for the capture beside the 120px tree, so the art
   never squeezes just above 900px */
@media (max-width: 1599px) {
  .cv-home .cv-wall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
}
/* phone: a little less air under the bar */
@media (max-width: 899px) {
  .cv-home { padding-top: var(--space-6); }
  .cv-home > .cv-nav { margin-top: calc(-1 * var(--space-6)); margin-bottom: var(--space-5); }
}
/* half a window and narrower: the switch goes under the welcome line, and the step cards stack, joined by a short line */
@media (max-width: 760px) {
  .cv-home__games-head { grid-template-columns: minmax(0, 1fr); }
  .cv-home__views { grid-column: 1; grid-row: auto; margin-top: var(--space-3); }
  .cv-home .cv-home__how { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .cv-home .cv-home__how li { align-items: center; padding: var(--space-2) var(--space-3); }
  .cv-home .cv-home__how li + li::before { left: calc(var(--space-3) + var(--space-7) / 2 - 1px); top: calc(-1 * var(--space-2)); width: 2px; height: var(--space-2); }
  .cv-home__how-icon { width: var(--space-7); height: var(--space-7); }
  .cv-home__how-text > .cv-eyebrow { display: inline; margin: 0 var(--space-2) 0 0; }
}
/* half a window: two games side by side once two tiles of 280px fit (about 640px and up), one column below that; the
   narrower tree (as on phones) keeps each picture from squeezing in the half-width tiles */
@media (max-width: 760px) {
  .cv-home .cv-wall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); column-gap: var(--space-5); }
}
/* phone and half a window: a narrower tree beside each capture, so the game picture is bigger; the column keeps room for
   "Open the tree" on one line */
@media (max-width: 760px) {
  .cv-home .cv-wall__item .cv-card { grid-template-columns: minmax(0, 1fr) auto; }
  .cv-home .cv-wall__tree { width: var(--space-9); justify-self: center; }
  .cv-home .cv-wall__item .cv-card__end { white-space: nowrap; }
}
