/* v2 landing and gallery (/v2/). Shared pieces live in components.css. */

.btn-small { min-height: 38px; padding: 0 var(--s4); font-size: var(--text-s); }
.landing { padding-bottom: calc(96px + var(--safe-bottom)); }
/* a fan's outer cards must not widen the page on a phone (on a desktop they fade out in the margin) */
@media (max-width: 1023px) { .landing { overflow-x: clip; } }

/* --- Hands of cards (the one carousel, fan layout; lib/carousel.js writes the transforms) --- */
/* .fc-card is one card of a hand: it pivots on a point below it (.cz-fan in components.css). */
.fc-card { width: var(--fcw); aspect-ratio: var(--card-ratio); border-radius: var(--card-radius) / calc(var(--card-radius) * 816 / 1110); }
/* A hand not built yet (landing.js builds it near the viewport) takes its cards out of the page
   entirely. Hidden but in flow, a 55-card deck stacked 55 cards tall below its hand and doubled
   the page's scroll height until the visitor scrolled close enough to build it. */
.fc-card:not(.cz-item) { display: none; }
.fc-face {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background: var(--card); box-shadow: var(--shadow-card);
}
.fc-face img { width: 100%; height: 100%; object-fit: cover; }

/* --- Hero: one hand walking through every deck -------------------------------------------- */
.l-hero { display: flex; flex-direction: column; gap: var(--s3); padding: 0 0 var(--s6); }
.l-fan-wrap { display: flex; flex-direction: column; align-items: center; margin: 0 calc(-1 * var(--s5)) var(--s2); overflow: hidden; }
.l-fan { --fcw: 150px; width: 100%; height: calc(var(--fcw) * 1110 / 816 + 90px); }
.l-fan .fc-card { top: 30px; }
.l-fan-name {
  min-height: calc(1.5em + 6px); font-size: var(--text-s); font-weight: 600; color: var(--ink-2);
  text-decoration: none;
  padding: 3px 8px; margin: -3px -8px;   /* a 24 px+ tap target that takes the same room as before */
}
.l-fan-name:hover { color: var(--ink); }
.l-title { margin: 0; font-size: var(--text-3xl); }
.l-note { text-align: center; margin: 0; }

/* --- Ideas ---------------------------------------------------------------------------------- */
.l-kicker { margin: 0 0 var(--s2); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.l-ideas .chip { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.l-ideas { padding-bottom: var(--s8); }

/* --- Gallery -------------------------------------------------------------------------------- */
.l-h2 { margin: 0; font-size: var(--text-xl); }
.l-h2-sub { margin: var(--s1) 0 var(--s4); font-size: var(--text-s); }
.g-deck { margin: 0 0 var(--s8); }
.g-fan { --fcw: min(34vw, 150px); height: calc(var(--fcw) * 1110 / 816 + 96px); margin: var(--s2) calc(-1 * var(--s5)) var(--s3); }
.g-fan .fc-card { top: 30px; }
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.g-title { margin: 0; font-size: var(--text-l); font-weight: 700; }
.g-title a, .q-title a { color: inherit; text-decoration: none; }
.g-title a:hover, .q-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.g-tag {
  flex: none; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--paper-2); color: var(--ink-2); font-size: var(--text-xs); font-weight: 600;
}
.g-tagline { margin: var(--s1) 0 0; font-size: var(--text-s); color: var(--ink-2); }
.g-actions { display: flex; gap: var(--s2); }
.g-actions .btn { flex: 1; min-height: 46px; padding: 0 var(--s3); font-size: var(--text-s); white-space: nowrap; }

/* --- How it works ------------------------------------------------------------------------- */
.l-how { padding: var(--s4) 0 var(--s8); }
.steps { list-style: none; margin: var(--s4) 0 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: var(--s4); }
.steps li { counter-increment: step; position: relative; padding-left: 48px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: var(--text-s);
}
.steps strong { display: block; }
.steps span { color: var(--ink-2); font-size: var(--text-s); }

.l-final { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s6) 0 var(--s8); }

/* --- Dock: the button follows you once the hero's button scrolls away ----------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-dock);
  max-width: 560px; margin: 0 auto;
  padding: var(--s3) var(--s5) calc(var(--s3) + var(--safe-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgba(245, 239, 228, 0));
  transform: translateY(110%); transition: transform var(--dur-2) var(--ease-out);
}
.dock.is-on { transform: translateY(0); }

@media (min-width: 700px) and (max-width: 1023px) {
  .l-title { font-size: 3.5rem; }
}

/* --- Desktop: hero in two columns, decks side by side, steps in a row ---------------------- */
@media (min-width: 1024px) {
  .landing { padding-bottom: 0; }
  .l-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "title fan" "cta fan" "note fan";
    grid-template-rows: auto auto 1fr;
    column-gap: 64px; row-gap: var(--s4);
    align-content: center; min-height: min(640px, calc(100dvh - 140px));
    padding: var(--s10) 0 var(--s12);
  }
  .l-fan-wrap { grid-area: fan; align-self: center; margin: 0; overflow: visible; }
  .l-fan { --fcw: 230px; }
  .l-title { grid-area: title; align-self: end; font-size: var(--text-3xl); }
  #hero-cta { grid-area: cta; width: auto; justify-self: start; padding: 0 var(--s10); }
  .l-note { grid-area: note; text-align: left; font-size: var(--text-s); }

  .l-ideas { padding-bottom: var(--s12); }
  .l-kicker { font-size: var(--text-s); }
  .l-h2 { font-size: var(--text-2xl); }
  .l-h2-sub { font-size: var(--text-m); margin-bottom: var(--s8); }

  #decks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s12) 56px; }
  .g-deck { margin: 0; display: flex; flex-direction: column; }
  .g-title { font-size: var(--text-xl); font-family: var(--font-display); font-weight: 600; }
  .g-tagline { font-size: var(--text-m); }
  .g-fan { --fcw: 170px; margin: var(--s4) 0 var(--s5); }
  .g-actions { margin-top: auto; }
  .g-actions .btn { flex: 0 1 auto; padding: 0 var(--s6); }

  .l-how { padding: var(--s12) 0; }
  .steps { flex-direction: row; gap: var(--s8); margin-top: var(--s6); }
  .steps li { flex: 1; padding: 52px 0 0; }
  .steps li::before { top: 0; }
  .steps strong { font-size: var(--text-l); margin-bottom: var(--s1); }
  .steps span { font-size: var(--text-m); }

  .l-final { align-items: center; text-align: center; padding: var(--s12) 0; }
  .l-final .btn { width: auto; padding: 0 var(--s12); }
  .dock { display: none; }
}

/* --- Commissioned: an art director designs your deck; the three agent decks are the proof -- */
.l-pro {
  margin: var(--s4) calc(-1 * var(--s5)) var(--s8); padding: var(--s10) var(--s5) var(--s8);
  background: linear-gradient(170deg, #22262e, #121418); color: #f5efe4;
  display: flex; flex-direction: column; gap: var(--s4);
}
.l-pro-kicker { color: rgba(245, 239, 228, 0.6); margin: 0; }
.l-pro .l-h2 { color: #fff; }
.l-pro-sub { margin: 0; color: rgba(245, 239, 228, 0.78); max-width: 60ch; }
.l-pro-decks {
  display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory;
  margin: var(--s2) calc(-1 * var(--s5)); padding: 0 var(--s5);
}
.l-pro-decks::-webkit-scrollbar { display: none; }
.l-pro-deck {
  flex: none; width: 86%; scroll-snap-align: center; position: relative;
  border-radius: var(--radius-m); overflow: hidden; color: #fff; text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.l-pro-deck img { width: 100%; aspect-ratio: 3000 / 1600; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.l-pro-deck-name {
  padding: var(--s3) var(--s4) var(--s4); background: rgba(255, 255, 255, 0.05);
  display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs);
}
.l-pro-deck-name strong { font-family: var(--font-display); font-size: var(--text-l); font-weight: 600; }
.l-pro-deck-name span { opacity: 0.8; }
.l-pro-steps { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: var(--s3); counter-reset: pro; }
.l-pro-steps li { counter-increment: pro; padding-left: 40px; position: relative; font-size: var(--text-s); }
.l-pro-steps li::before {
  content: counter(pro); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: #f5efe4; color: #121418; font-weight: 700; font-size: var(--text-xs);
}
.l-pro-steps strong { display: block; }
.l-pro-steps span { color: rgba(245, 239, 228, 0.7); }
.l-pro-cta { align-self: stretch; }
.l-pro-note { margin: 0; color: rgba(245, 239, 228, 0.55); text-align: center; }
.g-deck.is-commissioned .g-tag { background: #22262e; color: #f5efe4; }

.l-tiers { padding: 0 0 var(--s8); }
.l-tiers-note { margin: 0; text-align: center; }

@media (min-width: 1024px) {
  .l-pro {
    margin: var(--s8) 0 var(--s12); padding: var(--s12) var(--s12) var(--s10);
    border-radius: var(--radius-l); display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s12);
  }
  .l-pro > * { grid-column: 1 / -1; }
  .l-pro-sub { font-size: var(--text-l); }
  .l-pro-decks { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: var(--s4) 0; padding: 0; }
  .l-pro-deck { width: auto; }
  .l-pro-deck:hover img { transform: scale(1.04); }
  .l-pro-steps { grid-template-columns: repeat(3, 1fr); gap: var(--s8); }
  .l-pro-steps li { font-size: var(--text-m); }
  .l-pro-cta { justify-self: start; align-self: auto; padding: 0 var(--s10); grid-column: 1; }
  .l-pro-note { text-align: left; grid-column: 1 / -1; }
  .l-tiers { padding: var(--s4) 0 var(--s12); }
}

/* --- What arrives: a 3D render of the physical product ----------------------------------- */
.l-box { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4) 0 var(--s8); }
.l-box-fig { margin: 0 calc(-1 * var(--s5)); position: relative; }
.l-box-fig img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.l-box-fig figcaption { position: absolute; right: var(--s5); bottom: var(--s3); margin: 0; }
.l-box-text p { margin: var(--s2) 0 0; }
@media (min-width: 1024px) {
  .l-box { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--s12); padding: var(--s8) 0 var(--s12); }
  .l-box-fig { margin: 0; border-radius: var(--radius-l); overflow: hidden; }
}
.l-gallery .l-h2 { margin-bottom: var(--s5); }

/* --- Instant decks: drawn by the free preview in seconds (scripts/import_draft_deck.py) ------ */
.l-quick { padding: 0 0 var(--s8); }
.l-quick .l-h2 { margin-bottom: var(--s4); }
/* phone: one deck per row, its hand on the left and its name on the right */
.q-grid { display: grid; gap: var(--s4); }
.q-deck {
  display: grid; grid-template-columns: 172px minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr;
  column-gap: var(--s3); align-items: start; min-width: 0;
}
.q-fan { grid-row: 1 / -1; --fcw: 84px; height: calc(var(--fcw) * 1110 / 816 + 40px); margin-left: calc(-1 * var(--s3)); }
.q-title, .q-tagline, .q-links { position: relative; z-index: 1; }
.q-fan .fc-card { top: 16px; }
.q-title { grid-row: 2; margin: 0; font-size: var(--text-m); font-weight: 700; line-height: 1.25; }
.q-tagline {
  grid-row: 3; margin: 2px 0 var(--s2); font-size: var(--text-xs); color: var(--ink-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.q-links { grid-row: 4; align-self: start; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.q-see, .q-like { font-size: var(--text-s); font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
.q-like { color: var(--ink-2); }
@media (min-width: 1024px) {
  .l-quick { padding: var(--s4) 0 var(--s8); }
  .l-quick .l-h2 { margin-bottom: var(--s6); }
  .q-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s10) var(--s8); }
  .q-deck { display: flex; flex-direction: column; align-items: stretch; }
  .q-title, .q-tagline, .q-links { align-self: flex-start; }
  .q-fan { --fcw: 132px; height: calc(var(--fcw) * 1110 / 816 + 72px); margin: 0 0 var(--s3); }
  .q-links { margin-top: auto; }
  .q-fan .fc-card { top: 24px; }
  .q-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-l); }
  .q-tagline { font-size: var(--text-s); }
}

/* A card's <picture> (lib/ui.js lazyArt) is transparent to layout: its <img> fills the face. */
.fc-face picture { display: contents; }

/* Until landing.js fills the gallery, hold a screen of room for it, so the sections below
   don't show at the bottom of the first paint and then jump away (layout shift). */
#decks:empty { min-height: 100vh; }
#quick-decks:empty { min-height: 50vh; }
