/* Styles for index.html only. Shared tokens and components live in css/styles.css.
   Everything here is scoped under .home-* so it can't leak into other pages. */

/* ---------- Hero ---------- */
.home-hero { padding-block: var(--s7, 48px) var(--s8, 64px); }
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s8, 64px);
  align-items: center;
}
.home-hero-copy { max-width: 30rem; }
.home-hero-copy h1 {
  font-family: var(--font-display);
  font-size: var(--t-4xl, 48px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.home-lede {
  margin: var(--s5, 20px) 0 0;
  font-size: var(--t-lg, 18px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34ch;
}
.home-actions { display: flex; flex-wrap: wrap; gap: var(--s3, 12px); margin-top: var(--s6, 32px); }
.home-hero-note {
  margin: var(--s5, 20px) 0 0;
  font-size: var(--t-sm, 14px);
  color: var(--muted);
}

/* Collage: one tall photo, two stacked. Real product photos only. */
.home-collage {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s3, 12px);
  aspect-ratio: 7 / 5;
}
.home-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius, 8px);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  min-height: 0;
}
.home-tile-a { grid-row: 1 / span 2; }
.home-tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .2s ease;
}
.home-tile-tag {
  position: absolute;
  left: var(--s3, 12px); bottom: var(--s3, 12px);
  display: inline-flex; align-items: baseline; gap: var(--s2, 8px);
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border-radius: var(--radius-btn, 6px);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-sm, 14px);
  font-weight: 500;
  box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
.home-tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.home-tile-price { font-weight: 600; flex: none; }
.home-tile-credit {
  position: absolute;
  right: var(--s2, 8px); top: var(--s2, 8px);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: calc(100% - 16px);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: rgb(0 0 0 / .62);
  color: #fff;
  font-size: var(--t-xs, 12px);
  opacity: 0;
  transition: opacity .2s ease;
}
.home-tile:hover .home-tile-credit,
.home-tile:focus-visible .home-tile-credit { opacity: 1; }
/* Phones and touch screens can't hover: always show who made the print. */
@media (max-width: 767px), (hover: none) { .home-tile-credit { opacity: 1; } }
.home-tile:hover .home-tile-name { color: var(--accent); }
.home-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Categories ---------- */
.home-cats-section { padding-top: 0; }
.home-cats {
  display: grid;
  grid-template-columns: repeat(var(--home-cats-n, 6), minmax(0, 1fr));
  gap: var(--s4, 16px);
}
.home-cat {
  display: grid;
  gap: var(--s3, 12px);
  color: var(--ink);
  text-decoration: none;
}
.home-cat-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius, 8px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.home-cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-cat-text { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2, 8px); }
.home-cat-name { font-weight: 600; font-size: var(--t-md, 16px); }
.home-cat-count { font-size: var(--t-sm, 14px); color: var(--muted); white-space: nowrap; }
.home-cat:hover .home-cat-name { color: var(--accent); }
.home-cat:hover .home-cat-img { border-color: var(--ink-2); }
.home-cat:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--radius, 8px); }

/* ---------- How it works ---------- */
.home-steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s6, 32px);
  counter-reset: none;
}
.home-step {
  border-top: 2px solid var(--ink);
  padding-top: var(--s5, 20px);
}
.home-step-n {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--accent-text);
  font-weight: 600;
  font-size: var(--t-sm, 14px);
  font-variant-numeric: tabular-nums;
}
.home-step h3 {
  margin: var(--s4, 16px) 0 var(--s2, 8px);
  font-family: var(--font-display);
  font-size: var(--t-xl, 22px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.home-step p { margin: 0; color: var(--ink-2); line-height: 1.55; max-width: 38ch; }

/* ---------- Custom prints band ---------- */
.home-custom { padding-bottom: var(--s8, 64px); }
.home-custom-band {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s6, 32px);
  padding: var(--s7, 48px);
  border-radius: var(--radius, 8px);
  background: var(--surface);
}
.home-custom-band h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-2xl, 28px);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-custom-band p { margin: var(--s2, 8px) 0 0; color: var(--ink-2); max-width: 52ch; }
.home-custom-band .btn { flex: none; }

/* ---------- Credit strip ---------- */
.home-credits { border-top: 1px solid var(--line); padding-block: var(--s6, 32px); }
.home-credits-inner { display: flex; align-items: center; gap: var(--s4, 16px); }
.home-credits-inner p { margin: 0; flex: 1; color: var(--ink-2); font-size: var(--t-sm, 14px); line-height: 1.5; }
.home-credits-icon { display: inline-flex; color: var(--muted); flex: none; }
.home-credits-icon:empty { display: none; }
.home-credits-icon svg { width: 20px; height: 20px; }
.home-credits .btn { flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .home-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 8 categories: 4 + 4 instead of 3 + 3 + 2. */
  .home-cats[data-count="8"], .home-cats[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .home-hero { padding-block: var(--s5, 20px) var(--s7, 48px); }
  .home-hero-grid { grid-template-columns: 1fr; gap: var(--s6, 32px); }
  .home-hero-copy { max-width: none; }
  .home-steps { grid-template-columns: 1fr; gap: var(--s5, 20px); }
  .home-custom-band { flex-direction: column; align-items: flex-start; padding: var(--s6, 32px) var(--s5, 20px); }
}
@media (max-width: 767px) {
  /* Phones: headline, both buttons on one row, then the photos, so a real print shows above the fold. */
  .home-hero { padding-block: var(--s4, 16px) var(--s6, 32px); }
  .home-hero-grid { gap: var(--s5, 24px); }
  .home-hero-copy h1 { font-size: clamp(28px, 8.2vw, 34px); line-height: 1.08; }
  .home-lede { margin-top: var(--s3, 12px); font-size: var(--t-md, 16px); line-height: 1.5; max-width: none; }
  .home-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s2, 8px); margin-top: var(--s5, 24px); }
  .home-actions .btn { --btn-h: 50px; padding-inline: 10px; font-size: var(--t-md, 16px); justify-content: center; min-width: 0; }
  .home-hero-note { margin-top: var(--s3, 12px); font-size: 13px; }
  .home-collage { aspect-ratio: 4 / 3.3; gap: var(--s2, 8px); }
  .home-tile-tag { left: 8px; bottom: 8px; padding: 5px 8px; font-size: var(--t-xs, 12px); }
  .home-tile-b .home-tile-tag, .home-tile-c .home-tile-tag { display: none; }

  /* Categories and product rows scroll sideways on phones, showing about 1.6 items. */
  .home-cats {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: var(--s3, 12px);
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .home-cats::-webkit-scrollbar { display: none; }
  .home-cat { flex: 0 0 calc((100% - 2 * var(--s3)) / 2.5); scroll-snap-align: start; }

  .home-row {
    display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: var(--s3, 12px);
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .home-row::-webkit-scrollbar { display: none; }
  .home-row > * { flex: 0 0 calc((100% - var(--s3)) / 1.6); scroll-snap-align: start; min-width: 0; }

  .home-credits-inner { flex-wrap: wrap; }
  .home-credits-inner p { flex: 1 1 100%; }
  .home-credits-icon { display: none; }
  .home-credits .btn { padding-inline: 0; min-height: 44px; }
  .home-cat-text { flex-direction: column; gap: 2px; }
  .home-cat-name { font-size: var(--t-sm, 14px); }
  .home-cat-count { font-size: var(--t-xs, 12px); }
  .home-steps { gap: var(--s4, 16px); }
  .home-step { display: grid; grid-template-columns: 28px 1fr; column-gap: var(--s3, 12px); border-top-width: 1px; border-top-color: var(--line); padding-top: var(--s4, 16px); }
  .home-step h3 { margin: 2px 0 var(--s1, 4px); font-size: var(--t-lg, 18px); }
  .home-step p { grid-column: 2; font-size: var(--t-sm, 14px); }
  .home-custom { padding-bottom: var(--s7, 48px); }
  .home-custom-band h2 { font-size: var(--t-xl, 22px); }
  .home-custom-band .btn { width: 100%; }
}
/* Bigger tap targets for the "View all" links on touch screens. */
@media (pointer: coarse) {
  .section-head .view-all { min-height: 44px; padding-inline: 8px; margin-right: -8px; }
}
@media (max-width: 339px) {
  .home-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .home-tile img, .home-tile-credit { transition: none; }
}
