/* ==========================================================================
   HOUSE OF ELKI - HOMEPAGE (information architecture v2)
   Order: banners, positioning, craft clusters, trace the origin, collection intro,
   quick add. (Bundles, the box builder and the enquiry form live on design-a-box.html / design.css.)
   Builds on styles.css tokens and shared pieces.
   ========================================================================== */

[hidden] { display: none !important; }
.surface-sec { background: var(--surface); border-block: 1px solid var(--hairline); }
.center { text-align: center; justify-items: center; }

/* ---------- 1. Banner carousel (5 slides, swipe or buttons, no autoplay) ---------- */
.banners { position: relative; }
/* Without JS the rail is a plain scroll-snap strip. With JS (carousel.js) it becomes a drag-and-spring carousel. */
.banner-track { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline-offset: -4px; }
.banner-track::-webkit-scrollbar { display: none; }
.banner-rail { display: flex; }
.banner { flex: 0 0 100%; scroll-snap-align: start; position: relative; overflow: hidden; }
.js .banner-track { overflow: hidden; scroll-snap-type: none; touch-action: pan-y; cursor: grab; }
.js .banner-track.is-dragging { cursor: grabbing; }
.js .banner-track.is-dragging * { user-select: none; -webkit-user-select: none; }
.js .banner-rail { will-change: transform; }
.banner img, .banner a { -webkit-user-drag: none; }
.banner-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; min-height: clamp(540px, 74vh, 700px); padding-block: clamp(40px, 6vw, 72px) clamp(88px, 9vw, 112px); }
.banner h2 { font-size: clamp(2.6rem, 5.6vw, 5rem); line-height: 1; color: var(--ink); margin-block: 20px 28px; max-width: 14ch; }
.banner h2 em { font-style: italic; font-weight: 500; color: var(--gold); }
.banner-copy .btn { margin-top: 4px; }
.banner-art { position: relative; width: 100%; max-width: 520px; margin-inline: auto; aspect-ratio: 5 / 6; border-radius: 999px 999px 28px 28px; overflow: hidden; background: var(--navy-tone); box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .55); }
.banner-art img { width: 100%; height: 100%; object-fit: cover; }
.banner-art--wide { aspect-ratio: 4 / 3.2; max-width: 600px; border-radius: 28px 28px 28px 160px; }
.banner-art--cut { background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--gold) 70%, var(--paper)) 0 56%, color-mix(in srgb, var(--gold) 40%, var(--navy)) 100%); }
.banner-art--cut img { object-fit: contain; object-position: 50% 100%; padding: 6% 6% 0; }
.banner-tag { position: absolute; left: 18px; bottom: 18px; padding: 8px 14px; border-radius: var(--r-pill); background: rgba(246, 243, 240, .92); color: var(--navy); font-size: .75rem; font-weight: 500; letter-spacing: .04em; }
.banner-ctrl { position: absolute; inset: auto 0 22px 0; z-index: 2; pointer-events: none; }
.banner-ctrl .container--wide { display: flex; align-items: center; justify-content: space-between; }
.banner-ctrl > * > * { pointer-events: auto; }
.bctrl { display: flex; gap: 10px; }
.bctrl .ctrl { border-color: rgba(246, 241, 233, .6); color: var(--ink); width: 48px; height: 48px; }
.bctrl .ctrl:hover:not(:disabled) { background: var(--ink); color: var(--navy); }
.dots { display: flex; align-items: center; gap: 2px; }
.dot { display: grid; place-items: center; width: 28px; height: 44px; padding: 0; border: 0; background: none; }
.dot::before { content: ""; width: 10px; height: 10px; border-radius: 6px; background: rgba(246, 241, 233, .4); transition: width .3s var(--ease), background-color .3s var(--ease); }
.dot[aria-current="true"]::before { width: 28px; background: var(--gold); }
.dot:hover::before { background: rgba(246, 241, 233, .8); }
.banner-count { font-size: .8125rem; color: var(--soft); font-variant-numeric: tabular-nums; margin-right: 12px; }

/* ---------- 2. Positioning statement ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-copy { display: grid; gap: 24px; }
.about-copy h2 { font-size: clamp(2.25rem, 4.6vw, 4rem); line-height: 1.02; }
.about-copy h2 em { font-style: italic; font-weight: 500; color: var(--terracotta); }
.about-copy .lead { font-size: 1.125rem; }
.stats { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 8px clamp(28px, 5vw, 64px); padding-block: 22px; border-block: 1px solid var(--hairline); }
.stats b { display: block; font-family: var(--font-display); font-size: clamp(2.5rem, 4.5vw, 3.75rem); font-weight: 600; line-height: 1; font-variant-numeric: lining-nums; }
.stats b + span { display: block; margin-top: 8px; font-size: .875rem; color: var(--text-muted); max-width: 20ch; line-height: 1.35; }
.sdg-label { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.sdgs { display: flex; flex-wrap: wrap; gap: 12px; }
.sdgs li { width: 120px; }
.sdgs a { display: block; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.sdgs a:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(34, 47, 77, .18); }
.sdgs img { width: 100%; height: auto; aspect-ratio: 1; }
.sdg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-top: 10px; }
.sdg-foot .link-arrow { color: var(--navy); border-bottom-color: var(--ochre); }
.sdg-foot small { font-size: .75rem; color: var(--text-muted); }
.about-art { position: relative; justify-self: center; width: min(100%, 460px); }
.about-art > img { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 999px 999px var(--r-lg) var(--r-lg); background: color-mix(in srgb, var(--navy) 8%, var(--paper)); }
.about-art .arch-outline { position: absolute; inset: -12px 12px 12px -12px; border: 1px solid color-mix(in srgb, var(--ochre) 70%, transparent); border-radius: 999px 999px 32px 32px; pointer-events: none; }
.about-art figcaption { position: absolute; left: -16px; bottom: 28px; padding: 12px 18px; border-radius: var(--r-md); background: var(--navy); color: var(--ink); font-size: .8125rem; line-height: 1.35; box-shadow: 0 20px 36px -18px rgba(34, 47, 77, .6); max-width: 230px; }
.about-art figcaption b { display: block; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; color: var(--gold); }

/* ---------- 3. Craft clusters (kept from the previous build) ---------- */
.surface-sec .craft small { color: var(--text-muted); }
.surface-sec .craft h3 { color: var(--navy); }
.surface-sec .craft p { color: var(--text-muted); }
.surface-sec .craft-media { background: color-mix(in srgb, var(--navy) 10%, var(--paper)); }

/* ---------- 4. Trace the origin ---------- */
.trace-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.trace-media { position: relative; width: min(100%, 480px); justify-self: center; padding-bottom: 28px; }
.trace-media > img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r-lg); background: #fff; }
.qr-card { position: absolute; right: -18px; bottom: 0; width: 164px; padding: 16px; border-radius: var(--r-md); background: var(--paper); color: var(--navy); text-align: center; box-shadow: 0 28px 44px -20px rgba(0, 0, 0, .6); display: grid; gap: 8px; justify-items: center; }
.qr-card .qr-box { width: 96px; height: 96px; padding: 8px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); display: grid; place-items: center; }
.qr-card .qr-box .icon { width: 100%; height: 100%; stroke-width: 1.4; color: var(--navy); }
.qr-card b { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.qr-card small { font-size: .75rem; color: var(--text-muted); line-height: 1.3; }
.trace-copy { display: grid; gap: 22px; }
.trace-copy h2 { font-size: clamp(2.25rem, 4.4vw, 3.75rem); line-height: 1.02; text-transform: none; }
.scan-label { font-size: .875rem; font-weight: 600; letter-spacing: .2em; color: var(--gold); display: inline-flex; align-items: center; gap: 12px; }
.flow { position: relative; display: grid; gap: 0; counter-reset: step; }
.flow li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding-bottom: 28px; }
.flow li:last-child { padding-bottom: 0; }
.flow li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; background: var(--navy); position: relative; z-index: 1; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 25px; top: 52px; bottom: 0; width: 0; border-left: 1px dashed rgba(214, 168, 90, .55); }
.flow b { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.15; color: var(--ink); padding-top: 8px; }
.flow span { display: block; margin-top: 4px; font-size: .9375rem; color: var(--soft); }

/* ---------- 5. Collection intro ---------- */
.intro { padding-block: clamp(56px, 7vw, 96px) 0; }
.intro .section-head { margin-bottom: 0; max-width: 760px; margin-inline: auto; }
.intro h2 { font-size: clamp(2.25rem, 4.6vw, 4rem); line-height: 1.02; }


/* ---------- 6. Quick add (search a piece, add it to the box) ---------- */
.quick { padding-block: clamp(56px, 7vw, 96px); }
.quick-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.quick-copy { display: grid; gap: 20px; align-content: start; }
.quick-copy h2 { font-size: clamp(2rem, 3.6vw, 3rem); max-width: 14ch; }
.quick-box { font-size: .9375rem; color: var(--text-muted); }
.quick-box b { color: var(--navy); font-weight: 600; }
.quick-box a { text-decoration: underline; text-underline-offset: 3px; color: var(--navy); }
.quick-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.quick-panel { display: grid; gap: 14px; min-width: 0; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--hairline); }
.quick-label-top { display: block; margin-bottom: 8px; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.quick-hint { margin-top: 8px; font-size: .8125rem; color: var(--text-muted); }
.quick-label { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); padding-top: 6px; }
.quick-results { display: grid; gap: 0; }
.qa-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline); }
.qa-img img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: color-mix(in srgb, var(--navy) 8%, var(--paper)); }
.qa-info { min-width: 0; display: grid; gap: 2px; }
.qa-info b { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; line-height: 1.1; }
.qa-info a:hover b { color: var(--terracotta); }
.qa-info small { font-size: .8125rem; color: var(--text-muted); }
.qa-add { min-height: 44px; gap: 8px; white-space: nowrap; }
.qa-add .icon { width: 16px; height: 16px; }
.qa-add:hover .icon { transform: none; }
.qa-add[aria-pressed="true"] { background: var(--navy); color: var(--paper); }
.qa-none { padding: 18px 0 6px; border-top: 1px solid var(--hairline); color: var(--text-muted); }
.qa-none a { text-decoration: underline; text-underline-offset: 3px; color: var(--navy); }
.quick-all { justify-self: start; }
.quick-all[hidden] { display: none; }

/* ---------- Trust strip ---------- */
.trust { background: var(--surface); border-bottom: 1px solid var(--hairline); }
.trust ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 28px; padding-block: 22px; }
.trust li { display: flex; align-items: center; gap: 14px; }
.trust .icon { width: 30px; height: 30px; color: var(--terracotta); stroke-width: 1.4; flex: none; }
.trust b { display: block; font-size: .9375rem; font-weight: 600; line-height: 1.25; }
.trust small { display: block; margin-top: 2px; font-size: .8125rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- Shop by category tiles ---------- */
.cats-home { padding-block: clamp(40px, 5vw, 72px) clamp(56px, 7vw, 96px); }
.cat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.cat-tile { display: grid; gap: 14px; align-content: start; color: inherit; border-radius: var(--r-md); }
.cat-tile-media { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--r-md); background: color-mix(in srgb, var(--navy) 8%, var(--paper)); }
.cat-tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.cat-tile:hover .cat-tile-media img { transform: scale(1.045); }
.cat-tile-count { position: absolute; left: 12px; top: 12px; }
.cat-tile b { display: block; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.08; }
.cat-tile small { display: block; margin-top: 6px; font-size: .875rem; line-height: 1.45; color: var(--text-muted); }
.cat-tile-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 44px; font-size: .9375rem; font-weight: 500; border-bottom: 1px solid var(--ochre); }
.cat-tile-link .icon { width: 1.05em; height: 1.05em; transition: transform .2s var(--ease); }
.cat-tile:hover .cat-tile-link .icon { transform: translateX(4px); }
.cat-tile:hover b { color: var(--terracotta); }

/* ---------- Trace the origin: ring + connector draw in (motion.js sets --ring / --line / --pop) ---------- */
.flow.is-prepped li { --ring: 0; --line: 0; --pop: 1; }
.flow.is-prepped li::before { transform: scale(var(--pop)); box-shadow: 0 0 0 calc(var(--ring) * 7px) rgba(214, 168, 90, .22); background-color: rgba(214, 168, 90, calc(var(--ring) * .14)); }
.flow.is-prepped li:not(:last-child)::after { width: 1px; border-left: 0; background: linear-gradient(rgba(214, 168, 90, .75), rgba(214, 168, 90, .3)); transform: scaleY(var(--line)); transform-origin: top; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199px) {
}
@media (max-width: 1023px) {
  .trust ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .banner-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 36px 100px; gap: 28px; }
  .banner-art { max-width: 420px; aspect-ratio: 5 / 4.4; }
  .banner-art--wide { aspect-ratio: 4 / 3; max-width: 520px; }
  .banner h2 { max-width: 16ch; }
  .about-grid, .trace-grid { grid-template-columns: minmax(0, 1fr); }
  .about-art { order: -1; width: min(100%, 360px); }
  .about-art figcaption { left: 8px; }
  .trace-media { order: -1; }
  .qr-card { right: 0; }
}
@media (max-width: 767px) {
}
@media (max-width: 599px) {
  .trust ul { grid-template-columns: minmax(0, 1fr); }
  .cat-tiles { gap: 14px; }
  .cat-tile b { font-size: 1.375rem; }
  .qa-row { grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; }
  .qa-img img { width: 56px; height: 56px; }
  .qa-add { grid-column: 1 / -1; width: 100%; }
  .banner h2 { font-size: clamp(2.5rem, 12.5vw, 3.25rem); }
  .banner-count { display: none; }
  .bctrl .ctrl { width: 44px; height: 44px; }
  .banner-copy .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .sdgs li { width: calc((100% - 24px) / 3); }
  .qr-card { width: 140px; padding: 12px; }
  .qr-card .qr-box { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .sdgs a { transition: none; }
  .cat-tile:hover .cat-tile-media img { transform: none; }
  .dot::before { transition-duration: .01ms !important; }
}

/* ---------- Photo banners (assets/img/banners): headline is baked into the image, in a navy box at the top left
   (box spans 3.4%-27.3% of the width). The button sits inside that box, centred in the space under the text;
   --mid = that centre as a % of the image height (measured per slide). Phones: the box is too small to hold a
   tappable button, so the button moves to a full-width bar under the image. ---------- */
.banners:has(.banner--photo) { background: var(--navy); container-type: inline-size; }
/* fit the first screen: never taller than the viewport minus the header (117px) and a 56px peek of the next section,
   never shorter than 76% of the image (so the crop can't reach the headline). The crop takes 15% from the top and 85%
   from the bottom; the button is placed against the rendered image, so it stays inside the navy box. */
.banner--photo {
  --imgh: 50cqw;
  --h: max(38cqw, min(50cqw, 100vh - 173px));
  height: var(--h); background: var(--navy-tone);
}
@supports (height: 100svh) { .banner--photo { --h: max(38cqw, min(50cqw, 100svh - 173px)); } }
.banner-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.banner-cta { position: absolute; left: 4.9%; width: 20.9%; top: calc(var(--m, 44.6) * var(--imgh) / 100 - .15 * (var(--imgh) - var(--h))); transform: translateY(-50%); }
.banner-cta .btn { width: 100%; min-height: 0; height: clamp(32px, var(--bh, 3.5vw), 56px); padding: 0 10px; gap: 8px; font-size: clamp(.75rem, 1.02vw, 1.0625rem); font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55); }
.banner-cta .btn:hover { background: var(--ink); }
.cta-short { display: none; }
/* controls float on a dark pill so they stay readable over bright photos */
.banners:has(.banner--photo) .banner-ctrl { inset: auto 0 clamp(14px, 2vw, 26px) 0; }
.banners:has(.banner--photo) .banner-ctrl .container--wide { justify-content: flex-end; gap: 12px; }
.banners:has(.banner--photo) .dots, .banners:has(.banner--photo) .bctrl { padding: 2px 10px; border-radius: var(--r-pill); background: rgba(17, 26, 49, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.banners:has(.banner--photo) .bctrl { padding: 6px; align-items: center; }
.banners:has(.banner--photo) .bctrl .ctrl { width: 40px; height: 40px; }
.banners:has(.banner--photo) .banner-count { margin: 0 6px 0 8px; }

/* narrow boxes: a short label that always fits ("Shop now"); the link keeps its full name for screen readers */
@media (max-width: 1199px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
/* phones: full-width button bar under the image */
@media (max-width: 699px) {
  .banner--photo { height: auto; overflow: visible; }
  .banner-photo { aspect-ratio: 2 / 1; height: auto; }
  .banner-cta { position: static; transform: none; width: auto; padding: 14px var(--gutter) 72px; background: var(--navy); }
  .banner-cta .btn { height: 48px; font-size: .9375rem; }
  .cta-long { display: inline; }
  .cta-short { display: none; }
  .banners:has(.banner--photo) .banner-ctrl { inset: auto 0 14px 0; }
  .banners:has(.banner--photo) .banner-ctrl .container--wide { justify-content: space-between; }
  .banners:has(.banner--photo) .dots, .banners:has(.banner--photo) .bctrl { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* autoplay timer (home.js): the active dot fills over --auto-ms; its animationend moves to the next slide */
@property --fill { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes dotfill { from { --fill: 0%; } to { --fill: 100%; } }
.banners.is-auto .dot[aria-current="true"]::before {
  background: linear-gradient(90deg, var(--gold) var(--fill), rgba(214, 168, 90, .35) var(--fill));
  animation: dotfill var(--auto-ms, 5000ms) linear forwards;
}
.banners.is-auto.is-held .dot[aria-current="true"]::before { animation-play-state: paused; }

/* "Made by hand": the full artisan photo (Gifting Catalogue 2026), shown whole at its own 2:1 shape rather than cropped into the arch */
.about-grid:has(.about-art--wide) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.about-art--wide { width: 100%; margin: 0; justify-self: stretch; }
.about-art--wide > img { aspect-ratio: 2225 / 1108; object-fit: contain; border-radius: var(--r-lg); }
.about-art--wide figcaption { left: auto; right: 16px; bottom: -22px; }
@media (max-width: 1023px) {
  .about-grid:has(.about-art--wide) { grid-template-columns: minmax(0, 1fr); }
  .about-art--wide { width: 100%; margin-bottom: 22px; }
  .about-art--wide figcaption { right: 12px; left: auto; }
}

/* ---- Category tiles: the "Shop …" link sits on the same line in every tile, whatever the description length ---- */
.cat-tiles > li { display: grid; }
.cat-tile { grid-template-rows: auto 1fr; align-content: stretch; }
.cat-tile > span:last-child { display: flex; flex-direction: column; }
.cat-tile-link { margin-top: auto; align-self: flex-start; }
.cat-tile small { margin-bottom: 10px; }
@media (pointer: coarse) {
  .banners:has(.banner--photo) .bctrl .ctrl { width: 44px; height: 44px; }
}

/* 320px phones: dots and the three banner buttons share one row */
@media (max-width: 340px) {
  .bctrl { gap: 4px; }
  .banners:has(.banner--photo) .bctrl .ctrl { width: 40px; height: 40px; }
}
@media (max-width: 340px) {
  .bctrl .ctrl[aria-label^="Previous"], .bctrl .ctrl[aria-label^="Next"] { display: none; }   /* swipe and the dots still change slides */
}
